[gdal-dev] how to convert UInt16 Tiff

jr.morreale at enoreth.net jr.morreale at enoreth.net
Mon Apr 23 09:55:26 EDT 2012


Hi,

I've a few thousand aerial uncompressed tiff photography that I would 
like to convert to tiff with jpeg compression, unfortunatly I can't 
figure the right options to set to overcome the following error :

gdal_translate -of Gtiff -co "COMPRESS=JPEG" 
"D:\uncompressed_original.tif" "D:\tiff_jpeg_copy.tif"

ERROR 1: JPEGSetupEncode:BitsPerSample 16 not allowed for JPEG
ERROR 1: An error occured while writing a dirty block
ERROR 1: JPEGSetupEncode:BitsPerSample 16 not allowed for JPEG

I've tried to use -co NBITS without success (gdal 1.9), the output 
becomes a paletted file.

gdalinfo :

Driver: GTiff/GeoTIFF
Files: D:\uncompressed_original.tif
Size is 8159, 10092
[...]
Pixel Size = (0.250000000000000,-0.250000000000000)
Metadata:
   AREA_OR_POINT=Area
Image Structure Metadata:
   INTERLEAVE=BAND
[...]
Band 1 Block=8159x1 Type=UInt16, ColorInterp=Gray

Regards,

MORREALE Jean-Roc


More information about the gdal-dev mailing list