Hi, thanks for the reply. Here's some runnable code (it's the closest I can get to how I need my image to look):

use Image::Magick; use strict; my $mask = Image::Magick->new(magick=>'png'); my $background = Image::Magick->new(magick=>'png'); my $foreground = Image::Magick->new(magick=>'png'); $mask->Read("png:mask.png"); $background->Set(size=>'500x500'); $background->Read("xc:white"); $background->Set(magick=>'png'); $foreground->Read("foreground.jpg"); $foreground->Set(magick=>'png'); $background->Composite(compose=>'Dissolve', opacity => '87.8%', image= +>$foreground); $background->Composite(image=>$mask); $background->Write("output.png"); exit;

I've had to go round adding 'png' all over the place in attempt to get it working. The mask can be any png with transparency (any kind of watermark), and foreground any 500x500 image.


In reply to Re^2: Setting opacity with dissolve in perlmagick by shohn
in thread Setting opacity with dissolve in perlmagick by shohn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.