How to use composite with function "dissolve"

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
mateusmgm

Re: Bump - Same issue...

Post by mateusmgm »

kenholm3 wrote: Bringing this to the top of the list to see if anyone has had any luck. I am running into the same issue.

After looking extensively I have found no working example of getting dissolve to work with PerlMagick. Thus my post here.

ImageMagick Version: ImageMagick 6.2.8 06/17/06 Q16 http://www.imagemagick.org
C

PerlMagick Version: $VERSION = '6.2.4';

Code with which I am working:

Code: Select all

#!/usr/bin/perl

use warnings;
use strict;
use Image::Magick;

my $source = "Pic1.jpg";
my $destination = "Pic2.jpg";
my $workDir = "./tmp";
my $outFile = "$workDir/Pic50.jpg";

my $file1 = Image::Magick->new();
$file1->ReadImage($source);

my $file2 = Image::Magick->new();
$file2->ReadImage($destination);

$file1->Composite(compose=>'Dissolve',
                    opacity=>50,
                    gravity=>'Center',
                    image=>$file2);

$file1->Write($outFile);

exit;
All I get is the source pic. Per the postings I have read I believe I am on a good version of IM/PM.

Does anyone have a working example of using dissolve with PM?

Thank you for your help.

-Ken

Hey kenholm3... I too have this problem.

Substitute your code :

Code: Select all

$file1->Composite(compose=>'Dissolve',
                    opacity=>50,
                    gravity=>'Center',
                    image=>$file2);
for:

Code: Select all

my $opacity_fake = 50;
$file1->Composite(compose=>'Dissolve',
                    opacity=>655.35*$opacity_fake,
                    gravity=>'Center',
                    image=>$file2);
Post Reply