Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library for run-time PNG compression on iOS

I need to be able to compress PNG files at run-time but can't find any libraries that are iOS ready that can do that. JPEG does is not a great fit for me because I need to the Alpha channel that PNG provides, and JPEG does not. Turning PNG crush into something I can use within my iOS project is probably beyond my skill/knowledge set when it comes to C.

Just to be extra-clear, I need to do this at run-time, not compile-time.

like image 719
Rob Reuss Avatar asked Mar 19 '12 22:03

Rob Reuss


People also ask

How do I compress a PNG without losing quality?

The best option to compress your PNG files without affecting image quality is using a program such as WinZip.

Is there compression in PNG?

File compression for a PNG is lossless. Like the term indicates, lossless compression retains all of the data contained in the file, within the file, during the process. Lossless compression is necessary when you have images that are still in the editing process.

Does PNG compression lose quality?

The biggest advantage of PNG over JPEG is that the compression is lossless, meaning there is no loss in quality each time it is opened and saved again. PNG also handles detailed, high-contrast images well.

Does PNG have lossless compression?

Both PNG and TIFF files benefit from lossless compression, meaning that no matter how often you save, open, or resize them, they'll maintain their quality.


2 Answers

Try ImageIO. See ImageIO Programming Guide

like image 164
EricS Avatar answered Sep 27 '22 23:09

EricS


Have you tryed UIImagePNGRepresentation?

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/c/func/UIImagePNGRepresentation

like image 22
Eduardo Costa Avatar answered Sep 28 '22 00:09

Eduardo Costa