This will do the job, including comparing different image formats provided they contain the same picture:
#! 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
But be aware, that images that look the same to the our eyes may be quite different in detail.
In reply to Re: Matching Images
by BrowserUk
in thread Matching Images
by virtualweb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |