Hello,
I've a layered PSD in sRGB and a RGB image. I'm using Imagick to place this image over a given PSD's layer, simulating the Photoshop's compositing effects. The problem is that the resulting image is darker than the one I see on Photoshop. After some research, I've discovered that setting the colorspace to RGB at the end of the command produces the expected result. The problem is that the image that is in RGB becomes opaque.
sRGB x RGB Result
Expected result:
PSD:
http://www.filedropper.com/teste3602
Image:
Does anyone know how can I solve it?
Composing a sRGB image with a RGB one
-
- Posts: 13
- Joined: 2014-09-26T08:23:47-07:00
- Authentication code: 6789
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Composing a sRGB image with a RGB one
Please tell us what commands you used.
Please say what version of IM you used, on what platform.
Please say what version of IM you used, on what platform.
snibgo's IM pages: im.snibgo.com
-
- Posts: 13
- Joined: 2014-09-26T08:23:47-07:00
- Authentication code: 6789
Re: Composing a sRGB image with a RGB one
Code: Select all
composite -gravity center image.png Global\ Illumination.png output_1.png
composite -compose Multiply Ambient\ Occlusion.png output_1.png output_2.png
composite -compose LinearDodge Reflection.png output_2.png output_3.png
Used files:
http://ge.tt/4rmQ8r52/v/0?c?c
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Composing a sRGB image with a RGB one
This works for me on IM 6.9.0.0 Q16 Mac OSX. You just need to add an sRGB profile to the png image. It matches your "expected" results, but does not have any of the lighting, reflections, etc. I am not sure which result you want.
unix syntax:
unix syntax:
Code: Select all
convert \( teste_3602.psd[0] -alpha off \) \
\( eATzcc3.png -profile /Users/fred/images/profiles/sRGB.icc \) \
-gravity center -geometry -5+0 compose over -composite result.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Composing a sRGB image with a RGB one
Your "expected result" doesn't show the reflection, even though this is marked as "correct color" on your first image.
I would use a single "convert" instead of multiple "composites".
IM will happily composite images that are in different colorspaces. It is better to convert them as required to the same colorspace before the composite. I make them RGB, then convert to sRGB at the end.
"-gravity center" isn't quite correct, so I shift the image slightly.
The result seems to be what you want, but with the reflection. Windows BAT syntax; adjust for your system.
I would use a single "convert" instead of multiple "composites".
IM will happily composite images that are in different colorspaces. It is better to convert them as required to the same colorspace before the composite. I make them RGB, then convert to sRGB at the end.
"-gravity center" isn't quite correct, so I shift the image slightly.
The result seems to be what you want, but with the reflection. Windows BAT syntax; adjust for your system.
Code: Select all
convert ^
( "mug\Global Illumination.png" -strip -set colorspace RGB ) ^
mug\image.png -colorspace RGB ^
-gravity Center -geometry -5+5 ^
-compose SrcOver -composite ^
( "mug\Ambient Occlusion.png " -strip -set colorspace RGB ) ^
-compose Multiply -composite ^
( mug\Reflection.png -strip -set colorspace RGB ) ^
-compose LinearDodge -composite ^
-colorspace sRGB ^
c.png
snibgo's IM pages: im.snibgo.com