Page 1 of 1

Issues converting a PSD generated by IM to JPG

Posted: 2012-07-24T05:20:16-07:00
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!

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-24T10:34:26-07:00
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

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-25T00:43:48-07:00
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 :)

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-25T03:28:33-07:00
by indiego
Have you already tried

convert test.psd[0] -background white -alpha remove test.jpg

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-25T04:35:32-07:00
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

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-25T07:45:07-07:00
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

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-27T00:58:16-07:00
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. :(

Re: Issues converting a PSD generated by IM to JPG

Posted: 2012-07-27T05:21:37-07:00
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).