Gray PSD to JPG

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
schille
Posts: 11
Joined: 2017-04-26T07:08:27-07:00
Authentication code: 1151

Gray PSD to JPG

Post by schille » 2018-04-17T02:58:50-07:00

I am trying to convert the psd file (pari.psd, Download URL given below) to a jpg.
The psd file has a transparent background, but no alpha channel (in Photoshop)!
I want the background to appear white in the jpg.

Image Magick Version: ImageMagick 7.0.4-6 Q16 x64 2017-01-27 http://www.imagemagick.org
OS: Windows 10 64 bit (x64)

My conversion command is:

Code: Select all

convert pari.psd[0] -flatten out.jpg
The output jpg is black and white without any details. I tried a few options like -colorspace and -profile without success.
I opened the pari.psd file in photoshop and converted it to RGB (pariRGB.psd).
The command:

Code: Select all

convert pariRGB.psd[0] -flatten out.jpg
produces a good result.
So I think the problem is the Gray colorspace of the image, or how Photoshop stores the gray colorspace.

I experimented a bit and the following command works for this particular image.

Code: Select all

convert pari.psd  -alpha remove -flatten -fuzz 0% -fill white -opaque black out.jpg
However the shadow of the second layer is missing!

Is there a particular command to convert Gray PSDs into jpgs?
Thanks in advance!

http://2app.ws/pari.psd
http://2app.ws/pariRGB.psd

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

Re: Gray PSD to JPG

Post by snibgo » 2018-04-17T08:06:34-07:00

This works fine for me, with IM v7.0.7-28:

Code: Select all

magick pari.psd[0] -background White -layers Flatten out.png
There is detail in the light object. However, I get no shadow because IM doesn't read Photoshop layers.

If you get no detail in the object, I suggest you try a newer version of IM.
snibgo's IM pages: im.snibgo.com

schille
Posts: 11
Joined: 2017-04-26T07:08:27-07:00
Authentication code: 1151

Re: Gray PSD to JPG

Post by schille » 2018-04-17T23:59:03-07:00

I upgraded to ImageMagick 7.0.7-28 Q16 x64 2018-03-25
and now your command works, thank you.

Post Reply