Converting PSD files to PNG

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Converting PSD files to PNG

Post by PMLaura »

Hi there, please see this thread for more details of what I've tried and what others have suggested:

viewtopic.php?f=1&t=23257

Basically I'm trying to convert Print optimised PSD files (with embedded colour profile) to PNGs (with a different embedded colour profile).

ImageMagick v6.8.0-7 (installed from MacPorts) is awesome and has done everything I need to optimise the images except the colour profile conversion
When opening the converted files in Photoshop (with all the profile warnings turned on so I better know what is happening) I get the following error:

The RGB document has a file format that does not support embedded color profiles

As a test I installed the latest (6.8.5-3) ImageMagick, built from source, on a 10.6.8 Snow Leopard computer with xcode 4.2. Configure/Make/Install went flawlessly and 'make check' reported no errors

However, any conversion (with v.6.8.5-3) from a PSD to any file format causes Photoshop (v5.5) to throw up errors. I have tried a couple of different PSDs with the same results.
e.g
JPG: "Could not complete your request because an unknown or invalid JPEG marker type is found."
PNG: "Could not complete your request because the file-format module cannot parse the file."
GIF: Edit: GIF Seems to work ok - just tested it

identify -verbose on these image show them still being photoshop files

Code: Select all

sydmac150:~ xxxxx $ identify -verbose /Users/xxxxx/Desktop/TRU819604.png 
Image: /Users/russ1173/Desktop/TRU819604.png
  Format: PSD (Adobe Photoshop bitmap)
Renaming these 'converted' files with PSD extension then allows Photoshop to open them.

So in summary:

v6.8.0-7 doesn't seem to be able to convert colour profiles from psd to png
v6.8.5-3 doesn't seem to want to convert any psd to any other format.

Thanks for any assistance - I hope I am correct in posting this here.

-- Laura
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PSD files to PNG

Post by snibgo »

Renaming these 'converted' files with PSD extension then allows Photoshop to open them.
Something is wrong. I've never seen IM create a .png file that was actually PSD format. (But I don't use Photoshop, so my experience is limited.) Exactly what command did you use to create the file?
snibgo's IM pages: im.snibgo.com
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Re: Converting PSD files to PNG

Post by PMLaura »

Hi there, thanks for your response

Literally just doing a basic convert

convert /Path/to/file.psd /Path/to/file.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD files to PNG

Post by fmw42 »

PNG does not support layers, so you would have to take the first layer of the psd (if saved with the first layer as the flattened layers) or flatten the psd first with the selected layers to get what you want in the png.
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Re: Converting PSD files to PNG

Post by PMLaura »

Hi there

That doesn't actually seem to be the case at least in version v6.8.0-7

If I do:

Code: Select all

convert file.psd file.png
and the psd has layers, I get one png for each layer - kinda nifty.

OR if I do

Code: Select all

convert file.psd[0] file.png
I get just the single png file from the combined layer - this is all fine. My issue is not with this functionality.

In v6.8.5-3 I can do either

Code: Select all

convert file.psd file.png
or

Code: Select all

convert file.psd[0] file.png
with the same result - a non valid png file

The issues I'm seeing with v6.8.5-3 are secondary to the main issue I wish to resolve, which is regarding the profiles not being embedded properly - or at least Photoshop not seeing them properly. I don't know if it's a problem with Photoshop or a problem with ImageMagick

The only reason I started playing with v6.8.5-3 is because I couldn't get the profiles working (which you very kindly helped me with fmw42 and suggested I post a bug about) but I can't test whether there's any change with v6.8.5-3 as I can't get a valid png file.

Catch 22 !
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PSD files to PNG

Post by snibgo »

I suggest you put your file.psd somewhere on the web, and put the URL here. Then someone who has Photoshop can try converting it and see what the problem is.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD files to PNG

Post by fmw42 »

and the psd has layers, I get one png for each layer - kinda nifty.
Yes, that is correct. I thought you wanted the PNG to have all the layers that the PSD did. That is what I meant my PNG not supporting layers. You get one image per layer, not one png image with all the layers as you would with gif or tiff.
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Re: Converting PSD files to PNG

Post by PMLaura »

Hi there, thanks for your response.

It doesn't matter which PSD I use, even one I generated myself, the results are the same.

v6.8.0-7 generates a perfect PNG file but no embedded profile (or perhaps an invalid profile) and v6.8.5-3 generates an invalid png.

Thanks
Laura
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PSD files to PNG

Post by fmw42 »

PMLaura wrote:Hi there, thanks for your response.

It doesn't matter which PSD I use, even one I generated myself, the results are the same.

v6.8.0-7 generates a perfect PNG file but no embedded profile (or perhaps an invalid profile) and v6.8.5-3 generates an invalid png.

Thanks
Laura
What error message does Photoshop produce? Any thing other than just invalid?

This works for me in IM 6.8.5.4 Q16 Mac OSX Snow Leopard

# add a profile to the rose: image, which has no profile and save to psd
convert rose: -profile /Users/fred/images/profiles/sRGB.icc rose.psd

# convert psd to png
convert rose.psd rose.png

The PNG opens fine in my old PS CS and IM shows that both it and psd got the sRGB.icc profile.

Have you set the Color Settings panel to prompt you for color management, profile mismatches and missing profiles?

It is probably set to just complain with an error rather than ask you how to manage the embedded profile which will be different in this case from the default Adobe RGB.
Post Reply