This is one of those internet myths that just persists.
According to your formula, this image and this one ought to approach 2.0. They are to all intents and purposes identical.
The actual result:
C:\test>jimagezipcmp.pl adding: 1.png (160 bytes security) (deflated 90%) adding: 2.png (160 bytes security) (deflated 89%) adding: 1.png (160 bytes security) (deflated 90%) adding: 2.png (160 bytes security) (deflated 89%) 1.0272952853598
Try it yourself:
#! perl -slw use strict; use GD; sub rgb2n { unpack 'N', pack 'CCCC', 0, @_ } for my $n ( 1, 2 ) { my $im1 = GD::Image->new( 600, 400, 1 ); $im1->filledRectangle( 0, 0, 600, 400, rgb2n( 255, 255, 255 ) ); $im1->filledRectangle( 100, 100, 500, 300, rgb2n( 255 - $n, 0, 0 ) + ); open O, '>:raw', $n . '.png' or die $!; print O $im1->png; close O; } system q[zip 1.zip 1.png]; system q[zip 2.zip 2.png]; system q[zip 3.zip 1.png 2.png]; my $size1 = -s '1.zip'; my $size2 = -s '2.zip'; my $size3 = -s '3.zip'; print +( $size1 + $size2 ) / $size3;
In reply to Re^2: Can i Compare two images in perl ? (It's a myth!)
by BrowserUk
in thread Can i Compare two images in perl ?
by deep3101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |