Image-Magick
view release on metacpan or search on metacpan
(often -R or -rpath) corresponding to the equivalent library search
path option so that the library can be located at run-time.
To create and install the dynamically-loaded version of PerlMagick
(the preferred way), execute
perl Makefile.PL
make
make install
To create and install a new 'perl' executable (replacing your existing
PERL interpreter!) with PerlMagick statically linked (but other libraries
linked statically or dynamically according to system linker default),
execute
perl Makefile.PL
make perl
make -f Makefile.aperl inst_perl
or to create and install a new PERL interpreter with a different name
than 'perl' (e.g. 'PerlMagick') and with PerlMagick statically linked
perl Makefile.PL MAP_TARGET=PerlMagick
make PerlMagick
make -f Makefile.aperl inst_perl
See the ExtUtils::MakeMaker(3) manual page for more information on
building PERL extensions (like PerlMagick).
For Windows systems, type
perl Makefile.nt
nmake install
For Unix, you typically need to be root to install the software.
There are ways around this. Consult the Perl manual pages for more
information. You are now ready to utilize the PerlMagick routines from
within your Perl scripts.
Installation - Win32 Strawberry perl
On Win32 Strawberry perl the prefered way of installing PerlMagick is the
following:
1) Download and install ImageMagick Windows binaries from
https://imagemagick.org/script/binary-releases.php#windows
2) You HAVE TO choose dynamic (DLL) ImageMagick binaries. Note: it is not
possible to mix 32/64bit binaries of perl and ImageMagick
3) During installation select that you want to install ImageMagick's
development files (libraries+headers)
4) You also need to have ImageMagick's directory in your PATH. We are
using the 'magick' tool to determine your actual configuration.
5) You might need Visual C++ Redistributable Package installed on your
system. See instructions on ImageMagick's Binary Release webpage.
6) If you have all prerequisites 1)...5) you can simply install
ImageMagick by running: cpan -i Image::Magick
Testing PerlMagick
Before PerlMagick is installed, you may want to execute
make test
to verify that PERL can load the PerlMagick extension ok. Chances are
some of the tests will fail if you do not have the proper delegates
installed for formats like JPEG, TIFF, etc.
To see a number of PerlMagick demonstration scripts, type
cd demo
make
Example Perl Magick Script
Here is an example script to get you started:
#!/usr/bin/perl
use Image::Magick;
$q = Image::Magick->new;
$x = $q->Read("model.gif", "logo.gif", "rose.gif");
warn "$x" if $x;
$x = $q->Crop(geom=>'100x100+100+100');
warn "$x" if $x;
$x = $q->Write("x.gif");
warn "$x" if $x;
The script reads three images, crops them, and writes a single image
as a GIF animation sequence.
( run in 1.232 second using v1.01-cache-2.11-cpan-fe3c2283af0 )