Flatten changes color

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
cs_rol
Posts: 22
Joined: 2007-01-16T04:40:08-07:00

Flatten changes color

Post by cs_rol »

Hi!

I have a psd file, which was created by photoshop, and it has a red text in it.
http://werk3at.net/rol/color.psd

when i convert it to jpg I set background color to white and flatten it to get rid of all transparency. afterwards the text color changes to green.

Code: Select all

convert color.psd -background white -flatten color.jpg

as you can see here:
http://werk3at.net/rol/color.jpg

command without flatten

Code: Select all

convert color.psd color.jpg

it produces three outputfile where the first one is correct and the other ones are parts of the image.

why does flattening change the color and how can i prevent it from doing so?

thanks in advance, richard
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Flatten changes color

Post by anthony »

The image is NOT RGB, so 'white' when flattened does not match the image.

Try, adding -colorspace RGB before the flatten.

See IM Examples, Basics, Colorspace
http://www.imagemagick.org/Usage/basics/#colorspace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
cs_rol
Posts: 22
Joined: 2007-01-16T04:40:08-07:00

Re: Flatten changes color

Post by cs_rol »

why do you think this image isn't RGB? Either Photoshop and identify say the image's colorspace is RGB.

the weird change of the texcolor is also done if i only do:

Code: Select all

convert color.psd -flatten color.jpg
why is this so?
cs_rol
Posts: 22
Joined: 2007-01-16T04:40:08-07:00

Re: Flatten changes color

Post by cs_rol »

ideas?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Flatten changes color

Post by anthony »

Sorry if the input image is RGB, then I am not certain. :?

Looking...
The image contains three layers. The first has red test
the second is the same as the first without any text, so text is removed.
the last has text in green which then overlays the red text.

If you want the first image only either delete the other two.
or reorder the images as appropriate.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply