[Gdal-dev] packbits compression no good for 16bit?

Matt Wilkie matt.wilkie at gov.yk.ca
Tue Feb 6 16:55:49 EST 2007


Hi GDAL,

I seem to be having a really bad stretch of gdal oddities this month :) 
Here is the next installment:

When compressing a 22mb 16bit geotiff using packbits compression I only 
get a 1% reduction in filesize. Is this expected? The source image is 
7/8ths nodata so I think I should easily get greater than 90% 
compression. I get the same results with fwtools 1.1.4 and 1.2.0 on two 
machines, both running WinXPsp2.

    for %a in (deflate lzw none packbits) do (
	gdal_translate -co compress=%a source.tif compress_%a.tif
	)

    dir *.tif

      4,810,097 source.tif
      1,225,395 compress_deflate.tif
      1,977,859 compress_lzw.tif
     23,073,871 compress_none.tif
     22,456,093 compress_packbits.tif

    gdalinfo source.tif

Driver: GTiff/GeoTIFF
Size is 4801, 2401
Coordinate System is `'
Origin = (-56.000416666666666,48.000416666666666)
Pixel Size = (0.000833333333333,-0.000833333333333)
Image Structure Metadata:
   COMPRESSION=LZW
Corner Coordinates:
Upper Left  ( -56.0004167,  48.0004167)
Lower Left  ( -56.0004167,  45.9995833)
Upper Right ( -51.9995833,  48.0004167)
Lower Right ( -51.9995833,  45.9995833)
Center      ( -54.0000000,  47.0000000)
Band 1 Block=4801x1 Type=Int16, ColorInterp=Gray
   NoData Value=-32767


Have I found another bug or am I not understanding the proper 
application of packbits compression?




-- 
matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------




More information about the Gdal-dev mailing list