I want to make all pixels of a certain #RGB white/black in an image or the inverse rendering all other pixels black. What is the best way to do that?
for example I want the image to only show pixels with RGB value of #22A906
Best regards
Filter for RGB color
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Filter for RGB color
To make all pixels other than #22a906 black:
See http://www.imagemagick.org/script/comma ... php#opaque
EDIT: Oops, I meant "+opaque" not "-opaque".
Code: Select all
convert in.png -fill black +opaque #22a906 out.png
EDIT: Oops, I meant "+opaque" not "-opaque".
Last edited by snibgo on 2013-12-04T15:41:28-07:00, edited 1 time in total.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Filter for RGB color
Code: Select all
convert in.png -fill white +opaque " #22a906" -fill black -opaque "#22a906" out.png
Re: Filter for RGB color
Thank you very much, exactly what I was looking for.