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
  • 110,296
  • 20
  • 185
  • 221
Khant Thu Linn
  • 5,575
  • 6
  • 47
  • 112

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,276
  • 2
  • 22
  • 26