[gdal-dev] how to convert UInt16 Tiff
Even Rouault
even.rouault at mines-paris.org
Mon Apr 23 10:54:10 EDT 2012
Selon jr.morreale at enoreth.net:
> 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.
Did you try -co BITS=12 ? JPEG compression only supports 8 or 12 bits. (For 12
bit support, you must have a build of GDAL configured with its internal libtiff
and internal libjpeg compiled with 12 bit support)
>
> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
More information about the gdal-dev
mailing list