Prima::Image::Magick - Juggle images between Prima and Image::Magick
use Prima::Image::Magick; my $i = Prima::Image-> new( ... ); # native prima images $i-> MedianFilter( radius => 5); # can call Image::Magick methods
Allows transformations between Prima images and Image::Magick images. Exports all methods found on Image::Magick into Prima::Image space, thus opening the possibilities of ImageMagick for Prima images.
Image::Magick
Prima::Image
The mutator methods found on Image::Magick namespace are wrapped and imported into Prima::Image space, so that an image is implictly converted to Image::Magick and back, so that for example
$prima_image-> Edge( radius => 5);
is actually the same as
my $m = prima_to_magick( $prima_image); $m-> Edge( radius => 5); $prima_image = magick_to_prima( $m);
except that $prima_image internally remains the same perl object.
$prima_image
This approach is obviusly ineffective when more than one call to ImageMagick code is required. To avoid the ineffeciency, wrappers BeginMagick and EndMagick are declared, so
BeginMagick
EndMagick
$prima_image-> BeginMagick; $prima_image-> Edge( radius => 5); $prima_image-> Enhance; $prima_image-> EndMagick;
is same as
my $m = prima_to_magick( $prima_image); $m-> Edge( radius => 5); $m-> Enhance; $prima_image = magick_to_prima( $m);
Returns a deep copy of $magick_image stored in a new instance of Prima::Image object. $magick_image must contain exactly one ImageMagick bitmap. This means that empty objects and objects f.ex. after Read('file1', 'file2') cannot be used here. Use Image::Magick::Deconstruct to break image sequence into constituent parts.
$magick_image
Read('file1', 'file2')
Image::Magick::Deconstruct
Exported either by explicit request or as a part of use Prima::Image::Magick ':all' call.
use Prima::Image::Magick ':all'
Returns a deep copy of $prima_image stored in a new instance of Image::Magick object.
Copies content of $prima_image to $magick_image. Not to be called directy unless really necessary; the method is not exported, and its syntax may change in future.
Copies content of $magick_image to $prima_image. Not to be called directy unless really necessary; the method is not exported, and its syntax may change in future.
Prima, Image::Magick, "example.pl" in examples.
Dmitry Karasik, <dmitry@karasik.eu.org>
Copyright (C) 2007 by Dmitry Karasik
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 Prima::Image::Magick, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima::Image::Magick
CPAN shell
perl -MCPAN -e shell install Prima::Image::Magick
For more information on module installation, please visit the detailed CPAN module installation guide.