Image::Magick::Square

Image::Magick::Square is a Perl module that takes an image and crops it to a square.
Download

Image::Magick::Square Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Leo Charre
  • Publisher web site:
  • http://search.cpan.org/~leocharre/

Image::Magick::Square Tags


Image::Magick::Square Description

Image::Magick::Square is a Perl module that takes an image and crops it to a square. Image::Magick::Square is a Perl module that takes an image and crops it to a square.SYNOPSIS use Image::Magick::Square; # Load your source image my $src = new Image::Magick; $src->Read('source.jpg'); # crop to square image my $square_thumb = Image::Magick::Square::create($thumb); # Save it $square_thumb->Write('square.jpg');EXAMPLETo make a square thumbnail: use Image::Magick::Square; # Load your source image my $src = new Image::Magick; $src->Read('source.jpg'); # make into a thumbnail my ($thumb,$x,$y) = Image::Magick::Thumbnail::create($src,50); # crop to biggest square that will fit inside image. my ($square_thumb,$side) = Image::Magick::Square::create($thumb); # Save it $square_thumb->Write('square_thumb.jpg');The subroutine create takes as argument an ImageMagick image object.It returns an ImageMagick image object (the thumbnail), as well as the number of pixels of the side of the image.It does not take dimension arguments, because if your image is cropped according to the dimensions it already posseses.This module is useful if you want to make square thumbnails. You should first make the thumbnail, and then call create, so as to use less of the computer's resources.You can run this conversion on any image magick object. Requirements: · Perl · Image::Magick


Image::Magick::Square Related Software