Image::Magick::PixelMosaic - Pixelized mosaic filter for Image::Magick.
use Image::Magick; use Image::Magick::PixelMosaic; my $img = Image::Magick->new; $img->Read('hoge.jpg'); my $pix = Image->Magick::PixelMosaic->new; $pix->src($img); # generates 4x4 pixelized mosaic on area (100,120)-(180,160) $pix->pixelize('80x40+100+120', [4,4]);
This module generates pixelized mosaic on parts of images using Image::Magick.
Creates an Image::Magick::PixelMosaic object.
Image::Magick::PixelMosaic
Optional src parameter expects Image::Magick object.
src
Image::Magick
my $pix = Image::Magick::PixelMosaic->new(src => $img);
is equal to
my $pix = Image::Magick::PixelMosaic->new; $pix->src($img);
Get or set Image::Magick object.
geometry
pixelsize
Generates pixelized mosaic on specified geometry.
geomerty must be specified as geometry form 'WxH+X+Y'.
geomerty
pixelsize must be specified as one of 'WxH', [W,H] or W (height==width).
All of W, H, X and Y must be non-negative integer.
If geometry exceeds area of source image, it will be automatically cropped.
When height/width of image are '20x30' and
$pix->pixelize('20x20+1+5', [4,6])
is called, efefctive pixelized area will be '16x24+1+5'.
accept width/heigh/x/y options.
more pixel color decision algorithm (currently use average of pixel area)
KATOU Akira (turugina) <turugina@cpan.org>
Copyright (C) 2008 by KATOU Akira (turugina)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Image::Magick::PixelMosaic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Magick::PixelMosaic
CPAN shell
perl -MCPAN -e shell install Image::Magick::PixelMosaic
For more information on module installation, please visit the detailed CPAN module installation guide.