composite -gravity southwest -dissolve 50 /esp/data/watermark.png preview.jpg test.jpg

Using the following code in Perl I get a jagged white edge: -
#!/usr/bin/perl
use Image::Magick;
my $wmarkimg = Image::Magick->new;
my $obj = Image::Magick->new;
$wmarkimg->ReadImage('png:watermark.png');
$obj->ReadImage('preview.jpg');
$obj->Composite(image=>$wmarkimg,compose=>'Dissolve',gravity=>'SouthWest',opacity=>'50%');
$obj->write('test2.jpg');
1;

I've spent the whole morning changing a whole range of the options on Composite and searching for anyone with a similar issue but have got no where.