1

I have image with only red and white color. In image processing, we can reduce image from 24 bit to 8 bit or something like that.

Is it possible to reduce image size? In my iPad application, I can save image as png or jpeg. But I want to reduce the size more. How should I write code?

zaph
  • 111,848
  • 21
  • 189
  • 228
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120

1 Answers1

0

Have you looked into the method UIImageJPEGRepresentation? Once you have your UIImage you just need to do something like:

NSData* imgData = UIImageJPEGRepresentation(myImage, 0.4); //0.4 is the compression rate.
[imgData writeToURL:myFileURL atomically:YES];
micantox
  • 5,446
  • 2
  • 23
  • 27