help with coding Mogrify
Posted: 2014-09-02T10:30:41-07:00
Here is the command line, which works fine:
$ convert 1345.jpg -colorspace gray \( +clone -blur 0x20 \) -compose Divide_Src -composite 1345photocopy1.jpg
# ref http://www.imagemagick.org/Usage/compose/#divide
I am having trouble coding some PerlMagick to do the same. What I have so far is shakey:
This throws an error:
$ convert 1345.jpg -colorspace gray \( +clone -blur 0x20 \) -compose Divide_Src -composite 1345photocopy1.jpg
# ref http://www.imagemagick.org/Usage/compose/#divide
I am having trouble coding some PerlMagick to do the same. What I have so far is shakey:
Code: Select all
my $image = Image::Magick->new;
my $x = $image->read( $sourceFile);
if ("$x") { print LOGFILE "image read = $x \n"; }
$image->Quantize(colorspace=>'gray');
my $q = $image->Clone();
$q->Blur( radius=>16);
$x = $image->Mogrify( 'Composite', compose=>'Divide_Src', composite=>'t' );
if ("$x") { print LOGFILE "image modu = $x \n"; }
Code: Select all
Exception 410: composite image required `Image::Magick' @ error/Magick.xs/XS_Image__Magick_Mogrify/8255