Page 1 of 1

RGB Combine odd behaviour -

Posted: 2011-07-04T06:28:51-07:00
by markmarques
According to the docs If I tried separating an image channels and then combined them I should get the "original" image ...
So I tried something like :


convert image1-jpg -monitor -colorspace RGB
( -clone 0 -channel R -separate )
( -clone 0 -channel G -separate )
( -clone 0 -channel B -separate )
-delete 0 -combine image1_a.jpg

instead of the "original" image I get a strange result image ( similar to the original but wrong colors ) ( yellowish image)

tried with the "rose: example" with the same results ( strong yellow image) ...

using Windows 6.7.0-10 "Manual compiled" convert.exe Q32 and HDRI

What am I doing wrong ?

Re: RGB Combine odd behaviour -

Posted: 2011-07-04T10:34:04-07:00
by fmw42
Does your jpg have profiles?

Look at identify -verbose yourimage.jpg

If so, then they are probably lost when you do the separate and then combine.

can you post a link to your jpg file for others to review?

Re: RGB Combine odd behaviour -

Posted: 2011-07-05T02:05:24-07:00
by markmarques
To avoid the JPG profile issues I tried with the internal rose: ...
and I suppose the problem is related with this:
convert rose: ( -channel R -separate ) ( -channel G -separate ) ( -channel B -separate ) -combine rose3.png

after some more tests I realised that the combine operator is "adding" all images including the initial one !!

So my further question is how can I make the "combine" command ignore the initial file ?
Or do I have to call convert for each separated channel , save into a file ( MIFF ) and "combine" them at the end ?

Re: RGB Combine odd behaviour -

Posted: 2011-07-05T10:24:52-07:00
by fmw42
convert rose: -separate -combine rose1.png

compare -metric rmse rose: rose1.png null:
0 (0)


convert rose: -channel rgb \
\( -clone 0 -channel R -separate \) \
\( -clone 0 -channel G -separate \) \
\( -clone 0 -channel B -separate \) \
-delete 0 -channel rgb -combine rose2.png

compare -metric rmse rose: rose2.png null:
0 (0)


be sure the add -channel rgb in both places in the second form (or at least just before the -combine)