IIIF::Magick - transform image with IIIF Image API Request using Image Magick
use IIIF::Magick qw(info convert); my $info = info($file, profile => "level0", id => "...") ; convert( $request, $file, "target.png" );
This module maps IIIF ImageAPI request parameters to ImageMagick command line arguments. See i3f (command line) and IIIF::ImageAPI (web service) for applications that make use of it.
Function info and convert require ImageMagick to be installed. Converting to PDF and/or WebP may not be enabled by default. For instance at Ubuntu Linux remove the line
info
convert
<policy domain="coder" rights="none" pattern="PDF" />
fro /etc/ImageMagick*/policy.xml and install WebP support via:
/etc/ImageMagick*/policy.xml
sudo apt-get install webp libwebp-dev
Returns whether ImageMagick is available.
Returns image information object with fields @context, type, profile, width, and height. Fields id and profile must be added for full IIIF compliance.
@context
type
profile
width
height
id
Convert an image file as specified with a IIIF::Request into an output file. Returns true on success. Additional arguments are prepended to the call of ImageMagick's convert.
Requires at least ImageMagick 6.9.
Get a shell-quoted command to convert an image with a IIIF::Request.
Get the list of command line arguments to convert to transform an image file as specified via a IIIF::Request.
The upscale option of size parameter is ignored: size ^max will not upscale the image as the resulting size depends on additional variables maxWidth, maxHeight, maxArea.
^max
maxWidth
maxHeight
maxArea
The IIIF Image API Request is not validated before processing. Sizes larger than the selected region will therefore always result in an upscaled image. Use method canonical of IIIF::Request to filter out such invalid requests.
canonical
To install IIIF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IIIF
CPAN shell
perl -MCPAN -e shell install IIIF
For more information on module installation, please visit the detailed CPAN module installation guide.