Page 1 of 1

composite merge two images: black turns to grey

Posted: 2009-09-24T12:55:49-07:00
by jom1
I have two images:
1. logo.png with solid black text and a solid red shape (the background is transparent),
2. a normal photo.

Why, when I use composite to put the logo on the photo, instead of a nice black and red logo which stands out, the black looks grey, and the red shape is "washed out"?

Shouldn't the logo simply be 'stuck' onto the photo, with only the transparent part showing through?

The command I used is:
composite -geometry +740+0 logo.png photo.psd photo2.jpg

I'm new to this, and haven't been able to find a solution, because there is a lot I don't understand. I'd be grateful for any help.

Re: composite merge two images: black turns to grey

Posted: 2009-09-24T14:40:58-07:00
by gsso
Yeah, just checked, it does act strange.
If you have more than one layer it kind of merges it with a difference blend mode?

the "logo":
Image

image inside the psd with one empty layer:
Image

the result:
Image


Well, what you can do for now is first save the photo.psd as photo.jpg and then put the logo on top of it:

convert photo.psd -flatten photo.jpg
composite logo.png photo.jpg photo2.jpg

Re: composite merge two images: black turns to grey

Posted: 2009-09-24T15:12:02-07:00
by fmw42
The command I used is:
composite -geometry +740+0 logo.png photo.psd photo2.jpg
Photoshop files have several layers. The first layer will be the flattened image. So if you do not specify the layer, you will get all layers and the flattened layer as well

try

photo.psd[0]

but this may lose the transparency. You may have to select the photoshop layers you need photo.psd[1-x] and skip the flattened layer.

Sorry not an expert on photoshop files.

Can you provide a link to each of your input images (and possibly your output) so we can see what is going on?

Re: composite merge two images: black turns to grey

Posted: 2009-09-25T07:27:45-07:00
by jom1
Thanks gsso - your example shows the problem well.

I tried first saving the psd as a jpg as suggested, and it worked!

It seems like this is a problem with psd files.

My psd file only has one layer.

Re: composite merge two images: black turns to grey

Posted: 2009-09-25T10:34:01-07:00
by fmw42
If it has an overlay, then it likely has more than one layer as IM would see it.

type

identify image.psd

and see how may lines it prints. each layer will be listed as image.psd[0], image.psd[1] etc. Perhaps everything has been flattened already into just the [0] layer, but then I would not have expected it to have transparency. But I am no expert on PSD files.

If you post links to your images, then others can look more carefully and make better recommendations

Re: composite merge two images: black turns to grey

Posted: 2009-09-27T21:16:18-07:00
by anthony
PSD images can also save the composition mode used to merge image layers.

You may need to set an appropriate -compose setting before using -composite to override any existing composition mode that may have been present.