Advice on Black and White to Color Composite

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
dholcomb9711
Posts: 16
Joined: 2018-06-08T03:45:59-07:00
Authentication code: 1152

Advice on Black and White to Color Composite

Post by dholcomb9711 »

I am working on satellite data and making color images from 3 black and white base images representing RGB. I am still very much a noob with IM, so it's a little tricky for me to do advanced things like this and end up with the result needed.

The weather satellite (GOES-16) has many channels of data, and I am working with 3 of them in the visible spectrum. (Visible Red Band, Visible Blue Band, and "Veggie" Band.) The "veggie" band is not a true green channel, but it is used as a green channel to produce an RGB color image when composited.

To understand my issue, it might be important for me to explain what I am doing. The satellite imagery from each channel comes in live, decoded, translated into GeoTIF, colorized with a tool called GDAL, saved as black and white, then ran through IM to combine the channels into a color image, then saved as GIF to be overlaid on a Mapbox map.(This process was a nightmare that took weeks) The Dropbox link below has the full resolution samples of the black and white products:

https://www.dropbox.com/sh/vfq1d2409pdr ... viAda?dl=0

I have successfully produced a color image using IM, but I have concerns about the quality. (Image below)


Image

This will be used by storm chasers as live data on the map. Features like the red circle should be a bit more... well there should be more detail after being colorized. The contrast in the original black and white images is great, it shows details in the cloud tops that signifies strengthening updrafts and other storm features. But after I colorized it, there is some detail loss. I need minimal detail loss and no matter what I do I seem to be losing it after colorizing. The image also seems unbalanced, maybe too green and even grainy in places.

After looking at some of the scripts for IM, it just looks so complicated. I am not the best learner in the world :) I am trying my best but I made sure before posting here that I am at the limit of what I am able to do without asking for help.


Are there some simple scripts to help with these issues? I noticed right off the bat that the green band image is not as bright as the red and blue channels, so I have had to alter that a bit with IM before running the script to combine them, so it might have something to do with it. I am not going to ask for someone to sit down and write a script for me, but if it's easy for someone here to post it would help me - and I can learn from the process. I keep coming across scripts that look like "4-38.23%/ + this -combine -that +45 -something" (at least that is how it seems to me) and I am at my wits end scavenging the forums and scripts online. I just am not great with this. Anyway, I will post the command prompt script I was able to make below. I really appreciate any help with this. It will be very cool once I nail it!

Code: Select all

magick convert -brightness-contrast 30X47 goes_full_green.tif goes_full_green2.tif // edit green and save as new image

magick convert goes_full_blue.tif -gamma 0.7,0,1,0.4 goes_full_blue2.tif  // adjusting -gamma on blue and saving as new image, I barely understand what I am doing

magick convert GOES_full_red.tif GOES_full_green2.tif GOES_full_blue2.tif -combine GOEScombined.tif // combining, this part seems easy as pie

magick convert GOEScombined.tif GOES16colorized.gif // save as GIF for display on the map, TIF is way too big to use on Mapbox


magick convert GOES16colorized.gif -modulate 90,48 GOES16colorized.gif  // attempting to modify final product to look better, probably making it worse
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Advice on Black and White to Color Composite

Post by snibgo »

"identify -verbose" tells me the red and blue channels span 0 to 100%, more or less, but green doesn't. In addition, the mean values of all three channels is around 25% of their maximum, which suggests they are encoded as linear RGB, not sRGB.

Windows BAT syntax. For bash, use \ for end-lines and escape the parentheses: \( \)

Code: Select all

magick ^
  ( GOES_full_red.tif ) ^
  ( GOES_full_green.tif -auto-level ) ^
  ( GOES_full_blue.tif ) ^
  -combine ^
  -set colorspace RGB ^
  -colorspace sRGB ^
  out.tif
The result has green land, dull blue water, and white-gray clouds. Good enough?
snibgo's IM pages: im.snibgo.com
dholcomb9711
Posts: 16
Joined: 2018-06-08T03:45:59-07:00
Authentication code: 1152

Re: Advice on Black and White to Color Composite

Post by dholcomb9711 »

Thank you! The -auto-level made a huge difference too.

IM is the best tool I have ever come across. I love this place.
dholcomb9711
Posts: 16
Joined: 2018-06-08T03:45:59-07:00
Authentication code: 1152

Re: Advice on Black and White to Color Composite

Post by dholcomb9711 »

Thanks again. Because of your guidance I was able to go back and put the finishing touches on this. I simply reduced the saturation for a more natural look. Before/After. You rock.

Image
Post Reply