ClipPathImage and image format?
"Tim Chevalier" <[email protected]> Wed, 17 Oct 2007 00:10:20 -0700
| Newsgroups | gmane.comp.video.graphicsmagick.apis |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm trying to use the ClipPathImage API call to set a clip mask. Is
the image containing the clip mask required to be in a particular
format (like TIFF)? I have an SVG image containing a clip mask that I
created using InkScape, and when I load it and call ClipPathImage, the
clip mask seems to be ignored. The SVG file looks like (in part):
<clipPath
id="clipPath5247">
<path
d="M 129.74603,36.867724 L 106.04271,60.116807 L
111.75698,92.823295 L 82.321057,77.464462 L 52.981145,93.005913 L
58.492063,60.264548 L 34.644733,37.163206 L 67.486589,32.286763 L
82.088041,2.4678965 L 96.874506,32.195454 L 129.74603,36.867724 z "
transform="matrix(1.6107469,0,0,1.9312731,1.9105408,0.9195656)"
style="opacity:0.46330273;fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path5249" />
</clipPath>
and my code looks like (in part):
image_info=CloneImageInfo((ImageInfo *) NULL);
strcpy(image_info->filename, "/home/tjc/ImageLib/clip.svg");
image=ReadImage(image_info, &exception);
ClipPathImage(image, "clipPath5247", 1);
NegateImage(image, 0);
strcpy(image->filename, "/home/tjc/ImageLib/out.png");
WriteImage(image_info, image);
If I look at the return value of the ClipPathImage call, it returns
MagickFail, and when I look at out.png, the entire image is negated,
not just the part within the clip mask.
Any suggestions? If the image containing the clip mask has to be a
TIFF, is there a way to create such an image using a free program
available for GNU/Linux? InkScape can't seem to save as TIFF, and when
I use gm convert to convert my .svg image to a .tiff, it doesn't seem
to preserve the clipping path.
Thanks,
Tim
--
Tim Chevalier * catamorphism.org * Often in error, never in doubt
"Time flies like an arrow. Fruit flies like a banana. Syntax rules
like a macro." -- Albert Lai
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/