Page 1 of 1

Setting an image color curve for three channels individually?

Posted: 2019-06-15T02:10:41-07:00
by austech360
I have the following Curve that I would like to apply to an image by using ImageMagick. This curve removes the green by setting the slope of the Green to 0/0. Then the RED and BLUE follow the points,

0,0
254,0
255,255

Image

I was able to get the first part. Removing the green from the image was easy.

Code: Select all

convert Testme.png -channel G -evaluate set 0 +channel test.png
This was SUPER SIMPLE. So thank you devs for that!

However. I am having a seriously rough time getting the last part, which is setting the curve of the last two colors.

I'm sure there is a way to do it because I know that ImageMagick can do literally anything that Photoshop/paint can do. So what is it that I'm missing? I've only ever used ImageMagick for throwing together some mailpieces for my smart home. Again, Thanks devs! I know... Wrong place to give thanks but I am SUPER grateful for such an amazing program that allows such versatile manipulation of images!

Re: Setting an image color curve for three channels individually?

Posted: 2019-06-15T04:48:30-07:00
by snibgo

Re: Setting an image color curve for three channels individually?

Posted: 2019-06-15T08:24:50-07:00
by austech360
snibgo wrote:
2019-06-15T04:48:30-07:00
How about "-range-threshold" for those channels? See http://www.imagemagick.org/script/comma ... -threshold and https://imagemagick.org/discourse-serve ... =4&t=34604 .
Thanks for the prompt reply!

This seems to only do black and white as far as I can tell. Maybe I don't understand the syntax or how it's supposed to work.

*EDIT*

There is probably more than one way to skin a cat with this. So I'm gonna post what I have vs what I want.

Here's what I have

Image

VS

What I need

Image

Suggestions?

Re: Setting an image color curve for three channels individually?

Posted: 2019-06-15T09:20:16-07:00
by snibgo
I would do it like this:

Code: Select all

magick at8XHKF.png -channel RB -threshold 75% -channel G -evaluate set 0 +channel out.png

Re: Setting an image color curve for three channels individually?

Posted: 2019-06-15T09:28:16-07:00
by austech360
snibgo wrote:
2019-06-15T09:20:16-07:00
I would do it like this:

Code: Select all

magick at8XHKF.png -channel RB -threshold 75% -channel G -evaluate set 0 +channel out.png
Perfect! All I had to do is change 75 to 99 and I got exactly the result I wanted. THANK YOU SOOOO MUCH! You're a LIFE-SAVER!

Much love!