UIImage Resize without quality loss

I am looking for an external library (or a method using Apple frameworks that does not destroy quality) that will allow me to scale images.

I tried this “simple image processing library”, but it works only for black and white - I don’t know how to make it work for color images. ( http://code.google.com/p/simple-iphone-image-processing/ )

I tried Core Graphics, UIKit, the "trevor" method ( http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/ ), which makes EXTREMELY blurry images, and in fact, I don’t know what else I can do - I can’t continue to program my application without getting at least half-decent image scaling. I think interpolation is required to get decent results.

Given the recent advances in iOS, I really hope someone can help me. This is not a problem that only I encounter, many other people have the same problem, so if someone can solve it here, I’m sure that if it would be appreciated by a very wide audience!

Many thanks

+8
iphone cocoa-touch uikit image-processing core-graphics
source share
1 answer

My answer:

OK - the one who actually answered my question and then deleted their answer, I really don't know why.

Here are three different approaches:

  • Using the Trevor Category approach - I think it's awful to keep it sharp. This is more useful if you are trying to prevent jagged lines from appearing.
  • Using support for iOS5 Core Image and the AffineTransform filter - the more advanced CILanczosScaleTransform is not available in iOS (as far as I know). Actually, pretty bad results.
  • Using the MGImageUtilities category - this seems to give excellent results while decreasing. ( https://github.com/mattgemmell/MGImageUtilities )

Here is a screenshot of four images. ENLARGE IT !: http://i.stack.imgur.com/M3DVE.jpg Left → Right: original, alarm, kernel image, MGIU.

enter image description here

Surprisingly, the picture on the right edge has about sixty times less memory use than the image on the left. Almost the same quality. On a small screen - always resize large images!

+10
source share

All Articles