Issues converting a PSD generated by IM 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
Sam Granger
Posts: 4
Joined: 2012-07-24T05:14:15-07:00
Authentication code: 15

Issues converting a PSD generated by IM to JPG

Post by Sam Granger »

What I'm trying to accomplish: I want to use ImageMagick to add a layer on top of an image, with a color blend (an image, not 1 fixed color). ImageMagick only has colorburn but not color, so I created the color blend layer in photoshop and saved it. Then, with ImageMagick, I combine the jpg I want to use with the psd, using the following command:

convert 1.jpg 1.jpg color.psd[2] -background white -alpha set test.psd

The file opens/displays perfectly in Photoshop. However, if I want to convert it to JPG via ImageMagick, it messes up.

convert test.psd[0] test.jpg - output:

Image

convert -flatten test.psd test.jpg - output:

Image

If I open the psd created by ImageMagick in Photoshop, and save it, and try converting again with "convert test.psd[0] test.jpg" I get the correct output.

Image

I don't want to have to open the file in photoshop however.

What could I be missing? :?

I assume I don't have to add 1.jpg twice in the psd creation command, but otherwise it messes up a little.

Thanks in advance for any pointers!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues converting a PSD generated by IM to JPG

Post by fmw42 »

convert test.psd[0] test.jpg - output:
This is not proper IM syntax to convert your psd to jpg. There is - output:

Just do

convert test.psd[0] test.jpg

see
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/basics/#cmdline
Sam Granger
Posts: 4
Joined: 2012-07-24T05:14:15-07:00
Authentication code: 15

Re: Issues converting a PSD generated by IM to JPG

Post by Sam Granger »

Sorry, what I meant with "- output:" wasn't part of the command, but what the actual output image was of that command :)
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: Issues converting a PSD generated by IM to JPG

Post by indiego »

Have you already tried

convert test.psd[0] -background white -alpha remove test.jpg
Sam Granger
Posts: 4
Joined: 2012-07-24T05:14:15-07:00
Authentication code: 15

Re: Issues converting a PSD generated by IM to JPG

Post by Sam Granger »

Hey indiego!

Thanks for your response. Just tried your command, but unfortunately I get the same output. :(

See here: http://samgranger.com/remove.jpg

Ps. I'm running on ImageMagick 6.7.7-7
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: Issues converting a PSD generated by IM to JPG

Post by indiego »

I see. What happens if you directly convert to JPG or use PNG as intermediate format?
Maybe the problem is related to PSD (no experience with it).

convert 1.jpg 1.jpg color.psd[2] -background white -alpha remove test.jpg

convert 1.jpg 1.jpg color.psd[2] -background white -alpha set test.png
convert test.png -background white -alpha remove test.jpg

Also: isn't this what you want?

http://www.imagemagick.org/Usage/compose/#colorize
Sam Granger
Posts: 4
Joined: 2012-07-24T05:14:15-07:00
Authentication code: 15

Re: Issues converting a PSD generated by IM to JPG

Post by Sam Granger »

Same problem unfortunately. Colorize is not an option, since colorize only works with one solid color if I'm not mistaken. The layer I need to be "colorizing" is a "complex" image. :(
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: Issues converting a PSD generated by IM to JPG

Post by indiego »

Bad luck then. As I understand it 'colorize' uses the hue and saturation information of color.psd and adds it to the luminace information of the other graphic. So this should do the job...

convert color.jpg 1.jpg -compose Colorize -composite test.jpg

Maybe some of the gurus here can confirm that (haven't tested myself).
Post Reply