Low level PNG image manipulation

  • I'm writing my first serious/hopefully useful Cocoa application which
    manipulates PNG images, reducing the number of colours used and
    paletising the image to reduce the file size.

    In order to do this, I'll need to manipulate the PNG image file at a
    fairly low level and I'm wondering what the best approach would be.
    I've been searching the Developer Documentation for information on
    using the PNG file format, but not found anything that looks useful.

    Does anyone know if there is anything in the Cocoa API that would help
    me do this?  All I've found so far is CGImageProperties-
    > kCGImagePropertyIsIndexed.

    Or should I just revert to using libpng/zlib which are both open
    source libraries written in C?

    thanks,

    Andrew
  • Hi Andrew,

    Image I/O is written over libpng so it prob has the api that you need,
    its probably just named differently. Following the trail of the
    kCGImagePropertyIsIndexed property will likely lead you to what you
    are looking for in terms of low level png stuff.

    But before you dig too deeply into that I'd suggest you take a look at
    Core Image, from your description it sounds like a custom filter would
    do just what you are looking for.

    http://tinyurl.com/2hhqg7

    is a good tutorial for getting started from ADC.

    HTH,

    -bd-
    http://bill.dudney.net/roller/objc

    On Dec 8, 2007, at 1:16 AM, Andrew Ebling wrote:

    > I'm writing my first serious/hopefully useful Cocoa application
    > which manipulates PNG images, reducing the number of colours used
    > and paletising the image to reduce the file size.
    >
    > In order to do this, I'll need to manipulate the PNG image file at a
    > fairly low level and I'm wondering what the best approach would be.
    > I've been searching the Developer Documentation for information on
    > using the PNG file format, but not found anything that looks useful.
    >
    > Does anyone know if there is anything in the Cocoa API that would
    > help me do this?  All I've found so far is CGImageProperties-
    >> kCGImagePropertyIsIndexed.
    >
    > Or should I just revert to using libpng/zlib which are both open
    > source libraries written in C?
    >
    > thanks,
    >
    > Andrew
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today