Page 1 of 1

Problem when converting PSD file

Posted: 2008-11-17T08:13:42-07:00
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

Re: Problem when converting PSD file

Posted: 2008-11-17T10:30:54-07:00
by magick
Try this command:
  • convert 'TestFile_PSD.psd[0]' TestFile_JPG.jpg
If that command fails for you, let us know.

Re: Problem when converting PSD file

Posted: 2008-11-17T14:32:12-07:00
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.

Re: Problem when converting PSD file

Posted: 2008-11-17T17:38:03-07:00
by magick
The matte channel inversion is fixed in the latest ImageMagick release, 6.4.5-8.

Re: Problem when converting PSD file

Posted: 2008-11-18T01:43:56-07:00
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

Re: Problem when converting PSD file

Posted: 2011-04-12T03:39:09-07:00
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