Path distorted when creating transparent PNG
Path distorted when creating transparent PNG
Hi!
I have a problem creating a PNG with transparency from a JPG containing a clipping path. The resulting PNG looks as if the path is somehow distorted, although the path looks correct in Photoshop.
This is one of the JPGs:
https://cloud.netgroup.de/public.php?se ... e14aaa789f
This is the command-line I used and which works on other images:
> convert 40993000_1.jpg -alpha transparent -clip -alpha opaque 40993000_1.png
The output is:
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
And this is the resulting PNG:
https://cloud.netgroup.de/public.php?se ... 8941804a1d
The problem is the same under Windows, OS X and Linux and with different versions of ImageMagick (tried different 6.8.x versions).
I checked the SVG-Info as mentioned in an earlier post (viewtopic.php?f=1&t=22322#p93710):
> identify -format '%[8BIM:1999,2998:#1]' 40993000_1.jpg >40993000_1.svg
> convert 40993000_1.svg info:
40993000_1.svg SVG 4926x2453 4926x2453+0+0 16-bit sRGB 2.79KB 1.980u 0:02.069
> identify 40993000_1.jpg
40993000_1.jpg JPEG 4926x2453 4926x2453+0+0 8-bit sRGB 3.415MB 0.000u 0:00.000
So the sizes of the path and the image seem to match. A "convert -version" gives the following:
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib djvu fftw fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff webp x xml zlib
Anything else I can check? Any help on this would be appreciated.
JD
I have a problem creating a PNG with transparency from a JPG containing a clipping path. The resulting PNG looks as if the path is somehow distorted, although the path looks correct in Photoshop.
This is one of the JPGs:
https://cloud.netgroup.de/public.php?se ... e14aaa789f
This is the command-line I used and which works on other images:
> convert 40993000_1.jpg -alpha transparent -clip -alpha opaque 40993000_1.png
The output is:
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
attribute not recognized: Y
And this is the resulting PNG:
https://cloud.netgroup.de/public.php?se ... 8941804a1d
The problem is the same under Windows, OS X and Linux and with different versions of ImageMagick (tried different 6.8.x versions).
I checked the SVG-Info as mentioned in an earlier post (viewtopic.php?f=1&t=22322#p93710):
> identify -format '%[8BIM:1999,2998:#1]' 40993000_1.jpg >40993000_1.svg
> convert 40993000_1.svg info:
40993000_1.svg SVG 4926x2453 4926x2453+0+0 16-bit sRGB 2.79KB 1.980u 0:02.069
> identify 40993000_1.jpg
40993000_1.jpg JPEG 4926x2453 4926x2453+0+0 8-bit sRGB 3.415MB 0.000u 0:00.000
So the sizes of the path and the image seem to match. A "convert -version" gives the following:
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib djvu fftw fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff webp x xml zlib
Anything else I can check? Any help on this would be appreciated.
JD
Re: Path distorted when creating transparent PNG
The conversion appears to work with ImageMagick-6.8.9-6, the Beta release. It might work with 6.8.9-5, the current release. 6.8.9-6 should be released sometime this week.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Path distorted when creating transparent PNG
It makes a bad result in v6.8.9-0. There have been recent bug fixes in paths, and the result in the current release (6.8.9-5) is improved but not perfect: the "holes" behind the handles are wrong, and there is a fault outside the left-side handle (which might be a problem with the image pah, not a bug in IM).
I think the developers are still working on the "holes" issue.
I think the developers are still working on the "holes" issue.
snibgo's IM pages: im.snibgo.com
Re: Path distorted when creating transparent PNG
Just going off topic for a moment - I wanted a jpg with a clipping path for my Imagemagick examples site and was under the impression it could be done in Photoshop but I can not get it to work. I have read it may be a problem with my version of Photoshop -CS6. Please can you explain to me how you do it.
Re: Path distorted when creating transparent PNG
I tried with 6.8.9-5 under Windows and can confirm this. The result is much better, but not perfect yetsnibgo wrote:It makes a bad result in v6.8.9-0. There have been recent bug fixes in paths, and the result in the current release (6.8.9-5) is improved but not perfect: the "holes" behind the handles are wrong, and there is a fault outside the left-side handle (which might be a problem with the image pah, not a bug in IM).
I think the developers are still working on the "holes" issue.
Re: Path distorted when creating transparent PNG
I am using Photoshop CS2, but the procedure should be the same:Bonzo wrote:Just going off topic for a moment - I wanted a jpg with a clipping path for my Imagemagick examples site and was under the impression it could be done in Photoshop but I can not get it to work. I have read it may be a problem with my version of Photoshop -CS6. Please can you explain to me how you do it.
1. Select the path
2. Click on the little round arrow-button in the upper right corner of the path palette
3. Choose "Beschneidungspfad" (I have a german version, maybee its "Cropping/Clipping path" in english?)
4. Confirm the dialog
The pathname is now written in bold, indicating that it is a clipping path.
Re: Path distorted when creating transparent PNG
Thanks for the instructions. I am not very proficient with Photosop but I believe I created jpg with a clip path but Imagemagick reports either "No clip path defined" for -clip-path and "image size differs" for -clip.
I seem to remember reading last year that 64bit version of CS6 will not create a clip path but the 32bit will - I only installed the 64bit version as I thought I would have no need for the 32bit one.
Anyway I will try your instructions if I can get a 32bit version or an older version and see what happens.
I seem to remember reading last year that 64bit version of CS6 will not create a clip path but the 32bit will - I only installed the 64bit version as I thought I would have no need for the 32bit one.
Anyway I will try your instructions if I can get a 32bit version or an older version and see what happens.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Path distorted when creating transparent PNG
It works fine for me without the stripes in IM 6.8.9.5 Q16 Mac OSX. Except that the holes in the handles are not transparent. This is likely due to the paths not being drawn in opposite directions.
There is another report about IM not recognizing non-alternating direction paths from PS. Check the Bugs and Developers forums.
There is another report about IM not recognizing non-alternating direction paths from PS. Check the Bugs and Developers forums.
Re: Path distorted when creating transparent PNG
Strange. I tried with the same version under Windows and there is the fault near the left handle.fmw42 wrote:It works fine for me without the stripes in IM 6.8.9.5 Q16 Mac OSX. Except that the holes in the handles are not transparent. This is likely due to the paths not being drawn in opposite directions.
Thanks for the hint. I will have a look at it.fmw42 wrote:There is another report about IM not recognizing non-alternating direction paths from PS. Check the Bugs forum.
JD
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Path distorted when creating transparent PNG
Yes, there was block of white outside the handle. Is that what you meant.Strange. I tried with the same version under Windows and there is the fault near the left handle.
Perhaps it is with your libpng? What version are you using?
Here is my result:
http://www.fmwconcepts.com/misc_tests/c ... 3000_1.png
Re: Path distorted when creating transparent PNG
Yes, that is exactly what i meantfmw42 wrote:Yes, there was block of white outside the handle. Is that what you meant.
Re: Path distorted when creating transparent PNG
How do I check that?fmw42 wrote:Perhaps it is with your libpng? What version are you using?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Path distorted when creating transparent PNG
convert -list format
look at the version on PNG
PNG* PNG rw- Portable Network Graphics (libpng 1.6.12)
Also see my results that I posted above.
look at the version on PNG
PNG* PNG rw- Portable Network Graphics (libpng 1.6.12)
Also see my results that I posted above.
Re: Path distorted when creating transparent PNG
> convert -list format
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (80)
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80)
...
PNG* PNG rw- Portable Network Graphics (libpng 1.6.10)
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (80)
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80)
...
PNG* PNG rw- Portable Network Graphics (libpng 1.6.10)