Tuesday 24 November 2015

qgis - Open and split a 4 channel RGB picture


How can I split an 4 channel rgb pic in qgis? With the value tool I can see 4 channel. I tried to use the RGB to PCT tool but I always get an error (File "C:\PROGRA~1\QGISBR~1\bin\pct2rgb.py", line 125, in ct_size = ct.GetCount() AttributeError: 'NoneType' object has no attribute 'GetCount' )



Answer




gdal_translate is able to extract single bands:


gdal_translate -b 1 in.tif out1.tif
gdal_translate -b 2 in.tif out2.tif
gdal_translate -b 3 in.tif out3.tif
gdal_translate -b 4 in.tif out4.tif

Raster -> Conversion -> Translate will create a gdal_translate command line, which you can edit to specify the band you want.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...