#! perl -slw use strict; use GD; GD::Image->trueColor( 1 ); my $img1 = GD::Image->new( $ARGV[ 0 ] ); my $img2 = GD::Image->new( $ARGV[ 1 ] ); die "Different dimensions" unless $img1->width == $img2->width and $img1->height == $img2->height; my $raw1 = $img1->gd; my $raw2 = $img2->gd; die "images are different" unless $raw1 eq $raw2; print "Images are the same"; __END__ c:\test>cmpImages mandrill.jpg mandrill.png Images are the same