[magick-users] IM6.2.9-8 : rounded corners in ImageMagick (why
won't masks work ?)
Anthony Thyssen
anthony at griffith.edu.au
Tue Oct 3 01:32:41 CDT 2006
Walter Higgins on wrote...
| Hi,
|
| I have a script that overlays rounded corners on any image.
| Problem is - it's broken in 6.2.9.x (actually it's broken since 6.2.5
| !).
|
The command line version in IM Examples has been working since it was
first put into place, and all examples get re-built just about every
working day.
See thumbnails -- Rounded Corners...
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/thumbnails/#rounded
| I've a feeling this is related to an earlier bug I reported with
| gradients and masks (which has been fixed in 6.2.9-8).
|
| Here is some sample code that creates a cut-out mask of a circle .
| The mask is created OK (mask.png) but it's completely ignored when
| compositing (see corners.png - this should have an empty inner circle
| but instead it's all blue).
|
| #!/usr/bin/perl
| use strict;
| use Image::Magick;
| my $radius = 100;
| my $color = "#0000ff";
| my $mask = Image::Magick->new;
| $mask->Set(size=>sprintf("%dx%d",($radius*2)+1,($radius*2)+1));
| $mask->ReadImage("xc:#FFFFFF");
| $mask->Draw(primitive=>"ellipse",
| points=>sprintf("%d,%d %d,%d 0,360",$radius,$radius,$radius,$radius),
| method=>"Floodfill",
| fill=>"#000000",
| stroke=>"none");
|
| my $corners = $mask->Clone;
| # im 6.0.7 doesn't do corners correctly
| # the mask doesn't seem to work !
| $corners->Colorize(fill=>$color);
| $corners->Composite(image=>$corners, mask=>$mask);
| $mask->Write(filename=>"mask.png");
| $corners->Write(filename=>"corners.png");
|
Note that 3 image composite was broken until the version you mentioned.
However it should now be working.
It maybe however that PerlMagick may be a little behind.
Unfortunatally while command line is working fine, my PerlMagick is
broken with a "undefined symbol: __stack_chk_" bug.
I have not figured out the fix for that, so I can't directly test the
above script.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
"Ye castle looks awfully like a home page to thy eyes! Castle bricks doth
not fit down ye old ethernet cable, though stupidity, apparently, does."
--- Dave Connors <dconnors at gil.ipswichcity.qld.gov.au>
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list