in reply to Loading PNG in Perl?

Did you look at http://www.w3.org/TR/PNG/ ?

The GD module does what you want, but you also need to install the GD library for that. There should be a windows version available I think.

Replies are listed 'Best First'.
Re^2: Loading PNG in Perl?
by Xenofur (Monk) on Jul 31, 2008 at 03:06 UTC
    Wow, useful reference. If it's concise enough that may be useful to help me write my own loader, yes.

    GD wouldn't be useful since it only creates images and doesn't read them.
      GD wouldn't be useful since it only creates images and doesn't read them.

      Not so. GD happily loads existing images in the usual formats:

      #! perl -slw use strict; use GD; my $img = GD::Image->new( $ARGV[ 0 ] ); my( $w, $h ) = $img->getBounds; print "The image '$ARGV[ 0 ]' is $w x $h pixels."; printf "The color of the pixel in the middle is: [0x%02x:0x%02x:0x%02x +].\n", $img->rgb( $img->getPixel( $w/2, $h/2 ) ); __DATA__ c:\test>junk5 694790clustered.png The image '694790clustered.png' is 800 x 800 pixels. The color of the pixel in the middle is: [0xfc:0xfe:0xfc]. c:\test>junk5 img\worldx2-2.jpg The image 'img\worldx2-2.jpg' is 5400 x 2700 pixels. The color of the pixel in the middle is: [0x04:0x0c:0x11]. c:\test>junk5 img\gradient.gif The image 'img\gradient.gif' is 108 x 108 pixels. The color of the pixel in the middle is: [0xff:0xff:0xff].

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Oh wow, i totally missed those. Thanks a lot!