如何像素化/添加像素化效果到UIImage在iOS中 [英] How to pixelize / add pixelating effect to a UIImage in iOS

查看:141
本文介绍了如何像素化/添加像素化效果到UIImage在iOS中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一种方法来像素化一个UIImage在Cocoa touch。我不知道什么最好的办法(有些人建议我使用OpenGL),但我有一种感觉,必须存在一些其他简单的方式,我可以俯瞰。有人知道吗?

I am looking for a way to pixelize a UIImage in Cocoa touch. I don't know what the best approach would be (some people have suggested me using OpenGL) but I have a feeling there must exist some other simple way I may be overlooking. Does anyone know of one?

推荐答案

信号处理说明如何处理图片:

Signal processing explanation of what to do to the image:


  1. 缩减示例按N

  2. Upsample N

  3. 然后卷动图像与NxN框过滤器(Matlab代码创建NxN框过滤器 rect = ones(N,N))。

  1. Downsample by N
  2. Upsample by N
  3. Then convolve the image with a NxN box filter (Matlab code to create NxN box filterrect = ones(N,N)).

Comp sci说明:

Comp sci explanation:


  1. 创建一个大小相同的空白新图片

  2. 在原始图片中每隔N个像素迭代

  3. 在新图片中每第N个像素重复

这篇关于如何像素化/添加像素化效果到UIImage在iOS中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆