NAME

Image::Magick::PixelMosaic - generate pixelized mosaic on images.

SYNOPSIS

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]);

  

DESCRIPTION

This module generates pixelized mosaic on parts of images using Image::Magick.

METHODS

new [src => $obj]

Creates an Image::Magick::PixelMosaic object.

Optional src parameter expects Image::Magick object.

my $pix = Image::Magick::PixelMosaic->new(src => $img);

is equal to

my $pix = Image::Magick::PixelMosaic->new;
$pix->src($img);
set, set($obj)

Get or set Image::Magick object.

pixelize geometry => geometry, pixelsize => pixel width&height

Generates pixelized mosaic on specified geometry.

Geomerty must be specified as geometry form 'WxH+X+Y'.

pixel width&height 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 reduced.

If height/width of image are '20x30' and

$pix->pixelize('20x20+1+5', [4,6])

is called, pixelized area will be '16x24+1+5' effectively.

SEE ALSO

Image::Magick

AUTHOR

KATOU Akira (turugina) <turugina@floralcompany.jp>

COPYRIGHT AND LICENSE

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.