Convert PSD to TIFF and apply clipping-path

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Luca
Posts: 8
Joined: 2011-01-13T07:42:40-07:00
Authentication code: 8675308

Convert PSD to TIFF and apply clipping-path

Post by Luca »

Hello again.

I try to convert a PSD file to TIFF and remove the background by using a cliping-path. This works fine with this command:

Code: Select all

convert source.psd -background white -fill white -draw "color 0 0 reset" 
-transparent white -clip -draw "Image Copy 0,0 0,0 source.psd" -strip out.tiff
But the cliping-path-informations are gone after the conversion.

I expected that this command:

Code: Select all

 identify -verbose source.psd -> out.tiff 
would apply the image-informations to the TIFF-file. Maybe I am wrong with that but I get a exception:

Code: Select all

Magick: no decode delegate for this image format 'C:/Users/Luca/AppData/Local/Temp/magick-0nt3IZnI' @ error/constitute.c/ReadImage/532
I realy need help with that.. could anybody give me a hint? Should I instal GohstScript? Is the conversion-command wrong? Where can I find help in the documentary?
Sorry for my bad english skills.

Code: Select all

DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
FEATURES OpenMP
HOST Windows
LIB_VERSION 0x667
VERSION 6.6.7
Last edited by Luca on 2011-01-20T06:53:13-07:00, edited 1 time in total.
Luca
Posts: 8
Joined: 2011-01-13T07:42:40-07:00
Authentication code: 8675308

Re: Convert PSD to TIFF and apply cliping-path

Post by Luca »

Ok I found out, that -strip removes the clipping-path. So if I dont use -strip and convert a PSD to a PSD with the command (see above) I get the right result.
But I want to convert the PSD to a TIFF. And if I try that I get a file where the image has been clipped with white but not with transparency.
Still nobody how can help me please?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PSD to TIFF and apply clipping-path

Post by fmw42 »

Luca
Posts: 8
Joined: 2011-01-13T07:42:40-07:00
Authentication code: 8675308

Re: Convert PSD to TIFF and apply clipping-path

Post by Luca »

Ok thank you.. this command also does it right:

Code: Select all

convert gmw.psd -profile "C:\Program Files\ImageMagick-6.6.7-Q16\config\sRGB.icm" -alpha transparent -clip -alpha opaque out.tiff
I finaly found out what the problem is:
TIFF-files use the alpha-channel for transparency. It depends on a program whether to use the aplha channel or not. QuarkExpress, Photoshop CS 5, Paint, Paint.net, Word and Microsoft Image-Preview are using it but Photoshop CS 4 and Irfan View are not. So if you open a transparent TIFF with Photoshop CS 4 you will still see the background.

There is still one undissolved mystery...
I convert a PSD to a PSD with the command seen above. The background is gone. Now I convert the result-PSD to a TIFF:

Code: Select all

convert out.psd out.tiff
And the background is back again. Where does this information come from? I cant find the background anywhere in the out.psd. I realy dont understand that.. but it does not matter.
Thank you.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PSD to TIFF and apply clipping-path

Post by fmw42 »

Tiff and PSD have both background transparency and alpha transparency. IM can only use one or the other and for the most part right now, IM is using the background transparency (and no ability to choose otherwise). This has been an ongoing discussion and an enhancement request. I think there may still be one case where IM uses the alpha left. But for the most part it has been made consistent so that the IM image looks like what one sees when opening PSD or TIFF with Photoshop -- that is the default display. There are still some bugs in converting PSD for grayscale images in IM as well. This is all from my own experience and not as a developer.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Convert PSD to TIFF and apply clipping-path

Post by anthony »

Luca wrote:Ok thank you.. this command also does it right:

Code: Select all

convert gmw.psd -profile "C:\Program Files\ImageMagick-6.6.7-Q16\config\sRGB.icm" -alpha transparent -clip -alpha opaque out.tiff
Niffy solution. Though only works if your original image was fully-opaque.

Have you tried...

Code: Select all

  convert image_clip.tif  -clip   image_masked.png
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply