Image::Compare

Compare two images in a variety of ways.
Download

Image::Compare Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Avi Finkel
  • Publisher web site:
  • http://search.cpan.org/~avif/

Image::Compare Tags


Image::Compare Description

Compare two images in a variety of ways. Image::Compare is a Perl module that allows you to compare two images in a variety of ways.USAGE use Image::Compare; use warnings; use strict; my($cmp) = Image::Compare->new(); $cmp->set_image1( img => '/path/to/some/file.jpg', type => 'jpg', ); $cmp->set_image2( img => 'http://somesite.com/someimage.gif', ); $cmp->set_method( method => &Image::Compare::THRESHOLD, args => 25, ); if ($cmp->compare()) { # The images are the same, within the threshold } else { # The images differ beyond the threshold }This library implements a system by which 2 image files can be compared, using a variety of comparison methods. In general, those methods operate on the images on a pixel-by-pixel basis and reporting statistics or data based on color value comparisons.Image::Compare makes heavy use of the Imager module, although it's not neccessary to know anything about it in order to make use of the compare functions. However, Imager must be installed in order to use this module, and file import types will be limited to those supported by your installed Imager library.In general, to do a comparison, you need to provide 3 pieces of information: the first image to compare, the second image to compare, and a comparison method. Some comparison methods also require extra arguments -- in some cases a boolean value, some a number and some require a hash reference with structured data. See the documentation below for information on how to use each comparison method.Image::Compare provides 3 different ways to invoke its comparison functionality -- you can construct an Image::Compare object and call set_* methods on it to give it the information, then call compare() on that object, or you can construct the Image::Compare with all of the appropriate data right off the bat, or you can simply call compare() with all of the information. In this third case, you can call compare() as a class method, or you can simply invoke the method directly from the Image::Compare namespace. If you'd like, you can also pass the word compare to the module when you use it and the method will be imported to your local namespace. Requirements: · Perl


Image::Compare Related Software