How does one batch substitute colors based on criteria?
Posted: 2015-05-08T15:19:33-07:00
I'm stumped on this one as I really hate doing a for loop in dos to check all 16 million colors on a image.
What I am trying to do is for example if I have the color 237,23,23 I want to have 255,0,0.
The common rule is that if the color is 127 or more set to 255 if not set to 0.
To end up with only the possible colors 0,0,0 0,0,255 0,255,0 0,255,255 255,0,0 255,0,255 255,255,0 255,255,255.
currently I could split the channels and re-merge them once I've done my color loop which would reduce this to 768 steps however as far as I know or I just missed the information in regarding saving under the same file name.
Any help would be greatly appreciated.
This is what I'm currently using but it's a pain
convert image.png -fill Rgb(0,0,0) -opaque rgb(15,16,12) imageout.png
What I am trying to do is for example if I have the color 237,23,23 I want to have 255,0,0.
The common rule is that if the color is 127 or more set to 255 if not set to 0.
To end up with only the possible colors 0,0,0 0,0,255 0,255,0 0,255,255 255,0,0 255,0,255 255,255,0 255,255,255.
currently I could split the channels and re-merge them once I've done my color loop which would reduce this to 768 steps however as far as I know or I just missed the information in regarding saving under the same file name.
Any help would be greatly appreciated.
This is what I'm currently using but it's a pain
convert image.png -fill Rgb(0,0,0) -opaque rgb(15,16,12) imageout.png