LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ImageMagick - how to convert green pixels to red? (https://www.linuxquestions.org/questions/linux-general-1/imagemagick-how-to-convert-green-pixels-to-red-428216/)

BrianK 03-24-2006 09:20 PM

ImageMagick - how to convert green pixels to red?
 
Does anyone know how to move all the green pixels in an image to red pixels?

I don't want to just change the hue, I want to make the green channel red.

BrianK 03-24-2006 09:26 PM

figures... as soon as I post it, I find a solution... For those who are curious:

convert some_image.jpg \( +clone -channel G -fx R \) +swap -channel R -fx v.G swapped.jpg

mideal 03-13-2017 06:52 AM

convert some_image.jpg \( +clone -channel G -fx R \) +swap -channel R -fx v.G swapped.jpg[/QUOTE]

Hail Brian,

I'll take that as a sign (with your holy sandal :-) praising you as the Hero of the Day! - even years gone after posting that.

(To complete the example: Choose R, G and B for red, green, blue color channel.)

THANKS A LOT!

mideal 03-13-2017 07:39 AM

After using it on a bunch of files (working on a Cinnamon theme) I realized that this is not the perfect solution.
A lot of - even greenish - colors already consist partly of red and blue. If you only replace the green RGB part by blue, the result is a bit violet because the red part play a bigger role now.
I'll try a more "rotating" mode to change that...


All times are GMT -5. The time now is 04:56 PM.