Problem when converting PSD file

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
niklas_ekman

Problem when converting PSD file

Post by niklas_ekman »

Hi,

I have a problem when I try to convert a PSD file. I have ImageMagick 6.4.5-Q16 and I run the following command:

Code: Select all

convert -flatten TestFile_PSD.psd TestFile_JPG.jpg
and the JPG file is all distorted. The PSD file contains some layers, so I thought that maybe flattening them would be a good idea. When I run:

Code: Select all

convert TestFile_PSD.psd TestFile_JPG.jpg
I get a couple of JPG files, and only the first one looks good, the other ones are all distorted, and on a closer look the first one is not correct either.

I also tried to do a re-save:

Code: Select all

convert -TestFile_PSD.psd test.psd
and that file was all corrupted when I tried it in Photoshop and also when I tried to convert the re-saved PSD to an JPG it was all corrupted.

My test file is here:

http://www.gigasize.com/get.php?d=xn4br523tnd

thanks,

Niklas Ekman
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem when converting PSD file

Post by magick »

Try this command:
  • convert 'TestFile_PSD.psd[0]' TestFile_JPG.jpg
If that command fails for you, let us know.
niklas_ekman

Re: Problem when converting PSD file

Post by niklas_ekman »

That one worked good. I tried to do the same but instead of JPG I chose PNG. That didn't work that great. I got an image, but it was all wrong, the transparency was "inverted", i.e. the area that should be transparent wasn't and the are that should be visible was transparent.

I also tried

Code: Select all

convert 'TestFile_PSD.psd[0]' test.psd
and that also resulted in a file which Photoshop says is invalid.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem when converting PSD file

Post by magick »

The matte channel inversion is fixed in the latest ImageMagick release, 6.4.5-8.
niklas_ekman

Re: Problem when converting PSD file

Post by niklas_ekman »

I ran a couple of conversions with the new 6.4.5-8 version.

Code: Select all

convert TestFile_PSD.psd[0] test.jpg
convert TestFile_PSD.psd[0] test.png
convert TestFile_PSD.psd[0] test.psd
The JPG looks good, the PNG is still wrong and the PSD is strange... It's still invalid in Photoshop, but in the Photoshop open file dialog, the small thumbnail preview shows the correct image.

I've zipped all my output files.

http://www.gigasize.com/get.php?d=ftt3gx60pmf
roberto.pierpaoli
Posts: 1
Joined: 2011-04-12T03:20:01-07:00
Authentication code: 8675308

Re: Problem when converting PSD file

Post by roberto.pierpaoli »

Hi Niklas,

your post is very old, but I post my reply for other people possibly facing the same problem.

I have met distortion issues many times while converting PSD files to PNG: the answer was quite always the same, that is color mode.

For example, I had a PSD with 16 layers: 5 of them were distorted during conversion, through Photoshop I found that all those 5 were recognized having a "bad" color mode, like "RGB/8#" instead of "RGB/8".

After adapting the PSD (so that all layers where straight RGB) conversion went flawless.
Hope this can help someone.


Roberto
Post Reply