0

I have some satellite imagery data from Himawari 8 - one image is a mono image which is 500 metres per pixel image resolution and the other image is a visible RGB image which is 1km per pixel resolution - both are GeoTIFF files. I've tried using gdal_pansharpen to merge both images however it has a horrible dark output and there is no real way to get a nice image, so been looking at ImageMagick to do it instead. To do that, first the RGB image needs to be scaled up to 200% to match the resolution of the mono image, plus adjust the contrast. This step works fine:

IDE00435.202307240340.tif is the colour GeoTIFF image, 1km/pixel resolution IDE00409.202307240340.tif is the mono GeoTIFF image, 500m/pixel resolution

convert -level 20%,100%,2.0 -resize 200% IDE00435.202307240340.tif rgb-corrected.tif

Next step which I am not sure how do to do is to use the -colorize option for the convert command to overlay the resized RGB image onto the mono image using color and preserve luminance of the RGB image.

I have tried a few different commands to attempt this but not having much luck:

convert IDE00409.202307240340.tif rgb-corrected.tif -colorize 100% -composite pansharpen.tif convert IDE00409.202307240340.tif rgb-corrected.tif -colorize 100% pansharpen.tif convert -colorize 100% IDE00409.202307240340.tif rgb-corrected.tif pansharpen.tif convert IDE00409.202307240340.tif rgb-corrected.tif -colorize 100% -composite pansharpen.tif

I could be going at this totally the wrong way - but happy for pointers :)

Cheers, Mike

1

1 Answer 1

1

Without seeing your images, I would suggest you take the high-res mono image and sharpen it and contrast-stretch it and use that as your L (Lightness) channel.

Then take your colour image and convert it to Lab mode and discard the resulting L channel, retaining the a and b channels.

Then combine the sharpened L from the mono image with the a and b from RGB image.

This is a type of "pansharpening" (panchromatic) called "component substitution" where images of different spatial resolutions are converted to a new colourspace and the resulting channels are mixed/replaced to achieve something hopefully better than the sum of the parts. In this case we hope to combine the spatial resolution of your mono channel with the colour information from your RGB image.

Note that I am using Lab colourspace here, but you can also try:

  • HSI colourspace - putting your mono image in the I channel and deriving H and S from your RGB image, or

  • YCbCr colourspace - putting your mono image in the Ychannel and deriving Cb and Cr from your RGB image.

The ImageMagick commands are almost identical whichever you choose.

Something like:

# Sharpen and contrast-stretch mono image to make L
magick YOUR_MONO -level ... -unsharp ... L.tif

# Enlarge RGB, convert to Lab and extract 'a'
magick YOUR_RGB -resize ... -colorspace Lab -separate -delete 0,2 a.tif

# Enlarge RGB, convert to Lab and extract 'b'
magick YOUR_RGB -resize ... -colorspace Lab -separate -delete 0,1 b.tif

# Combine L, a and b into result.tif
magick L.tif a.tif b.tif -set colorspace Lab -combine result.tif

Note that the above steps can be optimised, but let's get them intelligible and working first.

Sign up to request clarification or add additional context in comments.

1 Comment

Any luck with my answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.