Take the 2-minute tour ×

I wanted to reduce the number of bands of a tif file from 3 to 1...

I used this command

rgb2pct.py -n 256 fnp_braunschweig.tif fnp_bs.tif

and it increased the size from 31mb to 778mb

I actually want to decrease the size of the file.

can anyone tell me why this is happening?



share|improve this question

1 Answer 1

up vote 5 down vote accepted

The output Tiff is likely not using compression, hence the larger file size. Use the gdal_translate command, something along the lines of this:

gdal_translate -of GTiff -co "COMPRESS=DEFLATE" -b N fnp_braunschweig.tif fnp_bs.tif

where N is the band number you want to keep. The options for compression are NONE, LZW, PACKBITS, JPEG, CCITTRLE, CCITTFAX3, CCITTFAX4, DEFLATE.

share|improve this answer
Especially note the -co "COMPRESS=DEFLATE" and -co "PHOTOMETRIC=YCBCR" if appropriate. Use gdalinfo to determine what the compression settings of the original tiff were and use creation options from gdal.org/frmt_gtiff.html appropriately. –  Howard Butler Feb 23 '12 at 14:05
thanks. how can I compress three bands into one? I don´t want to pick either red,green, or blue, I just want to compress them into one. –  Robert Buckley Feb 23 '12 at 21:16

Your Answer


