You are not logged in.

#1 2015-06-24 18:45:01

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 539

[Solved] ImageMagick RGB to Gray to Green colorspace

As the title hints, I simply which to do two colorspace conversions.

The step first is simple and works:

convert test.jpg -colorspace Gray gray_test.jpg

The second second step also seemed somewhat simple, but does not work.

convert gray_test.jpg -channel G -separate green_test.jpg

Obviously gray_test.jpg is not RGB, so it does make some sense, so I tried converting it to RGB, before applying step two.

convert gray_test.jpg -set colorspace RGB gray_rgb_test.jpg

However, this didn't solve the problem either. I've also tried a number of things that quite frankly didn't make sense, so I won't list those. In the end those, I'm still at a standstill and as I'm now sure to have the Google logo permanently imprinted on my retina, I thought I'd ask on my favorite forum.


Best regards.

Last edited by zacariaz (2015-06-24 22:38:30)


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

#2 2015-06-24 21:46:52

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [Solved] ImageMagick RGB to Gray to Green colorspace

What you want to do is equivalent to converting to greyscale and then coloring the image green (e.g. via overlay). This should do what you want, with the ability to convert to any color you like:

convert test.jpg -colorspace Gray +level-colors ,'#00ff00' green_test.jpg

More info: http://www.imagemagick.org/Usage/color_ … vel-colors

And please use code tags next time.


Moving to Multimedia & Games.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2015-06-24 22:37:40

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 539

Re: [Solved] ImageMagick RGB to Gray to Green colorspace

Xyne wrote:

What you want to do is equivalent to converting to greyscale and then coloring the image green (e.g. via overlay). This should do what you want, with the ability to convert to any color you like:

convert test.jpg -colorspace Gray +level-colors ,'#00ff00' green_test.jpg

More info: http://www.imagemagick.org/Usage/color_ … vel-colors

And please use code tags next time.


Moving to Multimedia & Games.

That's perfect, and even more so because it also solves a problem I haven't even mentioned, mainly converting to darker shade, if that's the right terminology.


Thanks!


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

Board footer

Powered by FluxBB