Page 1 of 1

How to set the same value to the color channels

Posted: 2015-04-07T03:08:02-07:00
by darkxiv
Hello! Can someone help me, please? I try to set R channel to B and G channels in my PNG image. It woks good if I change only one channel, but if I change both - all channels get modified (it seems they raised to the power 2.2). How to exclude such behavior?

I try to use:

Code: Select all

sudo convert input.png -channel GB -fx 'R' output.png

Code: Select all

sudo convert input.png -channel RGB -fx 'R' output.png

Code: Select all

sudo convert input.png -channel G -fx 'R' output-step1.png
sudo convert output-step1.png -channel B -fx 'R' output-step2.png
All these commands (and the chain of commands) generate the same png with modified color.
Commands like '-negate' and '-separate' also raising color to the power 2.2.

For example, the next line works fine:

Code: Select all

sudo convert input.png -channel G -fx 'R' output-step1.png
It produce the PNG file with the same R and G channels and do not raised to the power 2.2.

How to get G and B channels equal to the R channel without raising to the power? (or without raising all image to the power 1/2.2).

Re: How to set the same value to the color channels

Posted: 2015-04-07T03:50:16-07:00
by snibgo
I suspect you are running an old version of IM. If it is older than 6.8.5, I suggest you upgrade.

Re: How to set the same value to the color channels

Posted: 2015-04-07T05:55:29-07:00
by darkxiv
Oh, it helped. Thank you so much!