Page 1 of 2
Strange results with clip-path in tif-image
Posted: 2007-04-03T01:31:30-07:00
by DjTimmiDee
Hi.
I have a tif-image with a path inside which ist created in Photoshop.
If i tell convert to use the path as clippingpath with:
Code: Select all
convert -clip -negate path.tif path.png
The resulting image has no negated area.
I have uploaded the Images:
Source-TIF with Path:
http://demo.flyer-ex.de/imagemagick/path.tif
Target-PNG with unexpected interpretation of the Clipping-Path:
http://demo.flyer-ex.de/imagemagick/path.png
Expected target-PNG:
http://demo.flyer-ex.de/imagemagick/path_expected.png
I'm using Windows XP with following Version of Imagemagick:
Code: Select all
Version: ImageMagick 6.3.3 03/30/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
Imagemagick-Identify tells me that the tif has the following path inside:
Code: Select all
Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="800" height="800">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 406,88
C 468.327,114.997 530.673,142.003 593,169
C 587.001,236.327 580.999,303.673 575,371
C 508.673,385.998 442.327,401.001 376,416
C 341.337,358.006 306.663,299.994 272,242
C 316.662,190.672 361.338,139.328 406,88 Z
"/>
</g>
</svg>
Is it a Bug or a Feature ?
Or have i misunderstood the meaning of the Parameter -clip ?
Greetings
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T01:38:55-07:00
by DjTimmiDee
Much more strange.
If i write the image into a gif it is entirely black.
gif:
http://demo.flyer-ex.de/imagemagick/path.gif
Regards
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T06:55:42-07:00
by magick
We tried your commands and they work as expected including a reasonable GIF image. We're using ImageMagick 6.3.3-5, the latest release.
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T10:50:07-07:00
by DjTimmiDee
Hi.
This is the same Version i'm using. I have it downloaded and installed yesterday.
Does IM need special Versions of some systemlibraries on Windows ?
Greetings
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T11:24:13-07:00
by magick
We can reproduce the problem. It appears to be specific to Windows. We will have a fix in the next point release due in about a week. Thanks.
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T11:44:10-07:00
by DjTimmiDee
Hi.
I have downloaded an compiled IM 6.3.3-5 on my linux (SuSE 10.1) with gcc version 4.1.0.
Converting my image gives me the same results as on windows.
Maybe it is not a platformspecific problem.
Regards
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-04-03T11:54:15-07:00
by magick
Here's the problem. There is no official standard for 4 byte hex color values. The Internet community so far is leaning toward a opacity byte of 00 as fully transparent and FF as fully opaque. Adobe is using a 4 byte hex color value of #000000 so it is interpretted as fully transparent black. Can you track down the Adobe standard for 4 byte hex color values? It seems the byte is ignored or its intended to be opaque. The rsvg program ignores the first byte so #01020304 produces RGB(2,3,4). In the mean-time if you change the fill and stroke of your clip path to #000000 or #000000ff, the image renders as expected.
Re: Strange results with clip-path in tif-image
Posted: 2007-04-04T04:28:09-07:00
by DjTimmiDee
Hi.
Is there a way to modify these colors using IM ?
Regards
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-04-04T07:11:21-07:00
by magick
The right way to solve the problem is to determine why Adobe is producing 4 byte color hex values when the SVG standard does not seem to define them. We could put a hack in ImageMagick to solve the problem but it may cause problems for us in the future. In the mean-time you can extract the clipping path like this:
- identify -format '%[8BIM:1999,2998:#1]' path.tif
Re: Strange results with clip-path in tif-image
Posted: 2007-06-04T04:05:20-07:00
by jcostian
I have the same problem with images with clipping path, that are created by Photoshop.
Has anyone got any information about the values that Adobe is using?
Is there any workaround for this issue?
Could you put the hack into ImageMagick to solve the problem?
-janne
Re: Strange results with clip-path in tif-image
Posted: 2007-06-04T04:14:10-07:00
by DjTimmiDee
Hi.
Since i needed the mask as a tif-file with one bit depth i extract the SVG with the identifycommand und manipulate the Colors inside the SVG. Then i convert the SVG to get my tif.
I suppose you should be able to use the manipulated SVG as the Path for your operations.
Greeting
Thimo
Re: Strange results with clip-path in tif-image
Posted: 2007-06-05T00:14:23-07:00
by jcostian
Hi.
I think it's not possible for me to extract and modify the SVG in the current process. I would like to use the clipping path that PS generated straight in ImageMagick. Is there any way to fix this problem or create some workaround? (Not extracting and modifying the SVG "by hand".) Magick wrote that they could put a hack in ImageMagick for this, would that be possible?
Thanks,
-janne
Re: Strange results with clip-path in tif-image
Posted: 2007-06-05T04:46:17-07:00
by magick
The hack is in the current ImageMagick release, 6.3.4-6. Try it and if you have further problems let us know.
Re: Strange results with clip-path in tif-image
Posted: 2007-10-08T06:26:58-07:00
by masterbp
Hi
I have the exact problem as described in the first post. I'm using the latest ImageMagick version (ImageMagick-6.3.6) on windows XP. Any news on when -clip will work flawlessly on windows?
regards,
Benny
Re: Strange results with clip-path in tif-image
Posted: 2007-10-08T06:35:11-07:00
by magick
Post a URL to your image and the command you are using. Clipping appears to be working for us so we need to see if the problem you are having is specific to your image/command.