Using GDAL to merge 3 bands to form a multispectral image?

by s.k   Last Updated January 14, 2018 00:22 AM

I have 3 separate *.tif image files as grayscale. They are representing data acquired with a scanner. Each of them is a separate band of the scanner; red, green, and blue. I would like to reassemble them in a single RGB *.tif image file.

Using -o RGB.tif -co PHOTOMETRIC=RGB red.tif green.tif blue.tif

doesn't work; I end up with a single grayscale image which size is the sum of all individual images. How to achieve this simple operation?

(They are not geotiff, just simple tif files; there is no tfw)

Tags : gdal

Answers 1

Per user30184's comment, you can use gdal_merge like so: -separate  -o new_rgb.tif -co PHOTOMETRIC=MINISBLACK C:\input_r.tif C:\input_g.tif C:\input_b.tif
January 14, 2018 00:12 AM

Related Questions

When should I use gdal_merge?

Updated February 22, 2018 16:22 PM

Mosaic Imagery using GDAL Edited

Updated November 29, 2017 20:22 PM

Can I change the pixel sizes in a world file?

Updated July 03, 2018 02:22 AM