问题
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?
回答1:
Signal processing explanation of what to do to the image:
- Downsample by N
- Upsample by N
- Then convolve the image with a NxN box filter (Matlab code to create NxN box filter
rect = ones(N,N)
).
Comp sci explanation:
- create an empty new image that is the same size
- iterate over every Nth pixel in the original image
- repeat every Nth pixel in the new image
来源:https://stackoverflow.com/questions/6853376/how-to-pixelize-add-pixelating-effect-to-a-uiimage-in-ios