views:

364

answers:

2

Hello,

Is there anyway to reduce the Image file size or Raw RGB buffer ?

Actually I have RGB buffer which it has 500KB with 320X420 size.I tried to save it to disk using UIimage and it comes to 240 KB.

As per the image size, I want it to have less than 50KB or so.(loosing quality is OK)

Is it possible ?

Thanks,

Raghu

A: 

The 240KB size sounds exactly like the raw RGB image data, uncompressed (320x420x3). Doesn't the iPhone have a PNG or JPEG exporter? The internet says to use UIImageJPEGRepresentation or UIImagePNGRepresentation and NSData writeToFile.

JeeBee
I tried with UIImageJPEGRepresentation but it is very slow. I need to compress a lot of images on the fly.
Sridhar
The only way to compress a lot of images on the fly is to use the hardware accelerated JPEG or H264 codec. This is a private API
rpetrich