Please provide APIs to optimize graphic files (PNG, JPEG, etc.)

Originator:dwood
Number:rdar://10075332 Date Originated:9/5/2011
Status: Resolved:
Product:Mac OS X SDK Product Version:N/A
Classification:Enhancement Reproducible:N/A
 
Summary:

There are a number of third-party libraries that will optimize image data without a loss in quality.  It would be extremely useful to having that ability to accessible via APIs.


The normal ImageIO routines for writing images like PNGs, JPEGs, etc. but they do not do a very good job in optimizing the output to try to get the smallest file size possible.

There are a number of open-source tools and algorithms that will analyze the data and LOSSLESSLY write it out in a much more compact format.  The advantage of this is reduced file storage space, but perhaps more importantly, reduced bandwidth when these images are served on websites.

Some of these trade analysis time for better data reduction, so it might make sense to pass in a parameter to indicate preference for speed vs. optimum reduction.

For example:

AdvPNG  http://advancemame.sourceforge.net/doc-advpng.html
... and others from AdvanceCOMP  http://advancemame.sourceforge.net/comp-readme.html

OptiPNG http://optipng.sourceforge.net/

Pngcrush http://pmt.sourceforge.net/pngcrush/

JpegOptim http://www.kokkonen.net/tjko/projects.html

jpegtran http://jpegclub.org/

Gifsicle http://www.lcdf.org/gifsicle/

PNGOUT http://www.advsys.net/ken/util/pngout.htm


Some technical articles on PNG recompression:  http://optipng.sourceforge.net/pngtech/


Also there are lossy recompression techniques that can result in much smaller images as well.  My favorite is jpegmini for jpegs, which would be great if Apple could license:  http://www.jpegmini.com/

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!