Make all colors transparent except for specific colors

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
923882
Posts: 2
Joined: 2017-08-08T00:18:53-07:00
Authentication code: 1151

Make all colors transparent except for specific colors

Post by 923882 » 2017-08-08T01:01:09-07:00

Hello I'm trying to overlay a rain radar image onto a google map this is the image: http://imgur.com/a/Z2bLT
I'm trying to remove all of the colors that are not the colors that indicate rain. What I've previously being doing is finding the RGB values that don't indicate rain and using ImageMagick to make them transparent but there is hundreds of them which is annoying.

This is a list of RGB values that I want to keep and make every other RGB value transparent:

147,151,0
182,185,0
218,225,46
252,253,119
252,251,0
253,240,2
253,236,0
253,221,0
251,201,0
255,191,0
253,177,0
252,158,0
46,76,189
60,102,219
81,128,255
94,175,255
119,234,243
102,208,215
85,183,185
76,169,166
223,56,0
241,58,0
253,72,1
107,31,154
188,71,222
233,230,233
255,255,255
74,175,0
123,249,0
206,54,145
231,68,199
253,82,255

snibgo
Posts: 9383
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Make all colors transparent except for specific colors

Post by snibgo » 2017-08-08T05:34:21-07:00

You can make just those colours transparent, with "-transparent rgb(147,151,0)" etc. Then negate the alpha channel.
snibgo's IM pages: im.snibgo.com

923882
Posts: 2
Joined: 2017-08-08T00:18:53-07:00
Authentication code: 1151

Re: Make all colors transparent except for specific colors

Post by 923882 » 2017-08-10T09:27:02-07:00

snibgo wrote:
2017-08-08T05:34:21-07:00
You can make just those colours transparent, with "-transparent rgb(147,151,0)" etc. Then negate the alpha channel.
Thank you :)

Post Reply