This provides a Raku object-oriented NativeCall-based API for ImageMagick's MagickWand C API.
use v6;
use MagickWand;
# A new magic wand
my $wand = MagickWand.new;
# Read an image
$wand.read("examples/images/aero1.jpg");
# Lighten dark areas
$wand.auto-gamma;
# And then write a new image
$wand.write("output.png");
# And cleanup on exit
LEAVE {
$wand.cleanup if $wand.defined;
}
For more examples, please see the examples folder. For examples of available image effects, please click here.
Please follow the instructions below based on your platform:
$ sudo apt install libmagickwand-dev
$ brew update
$ brew install imagemagick
$ sudo port install ImageMagick
For Windows, most people will want the standard 64-bit DLL installer
.
If you need 32-bit or other special options, select the appropriate alternate
installer.
Also please remember to enable "Add to PATH" option.
$ zef install MagickWand
To process PDF files, please remember to install Ghostscript from here.
$ prove --ext .rakutest -ve "raku -I."
$ zef install Test::META
$ TEST_AUTHOR=1 prove --ext .rakutest -ve "raku -I."
Ahmad M. Zawawi, azawawi on #raku, https://github.com/azawawi/
MIT License