[gdal-dev] gdalwarp creates a bloated file

Craig Leat craig.leat at gmail.com
Sat Dec 22 03:20:57 EST 2007


On Dec 21, 2007 4:52 PM, Cicconetti, Bob <BCicconetti at dnr.state.md.us> wrote:

> You'll need either an old version of gdal, or one based on the 1.5.0RC2
> binary; the version distributed with QGIS 0.9 works for me.
>
> Adding the following two options to your gdalwarp call should result in
> a much smaller TIFF file, but if you are using bilinear or better
> resampling, you may want to consider using 2 bits and LZW compression.
>
> -co NBITS=1 -co COMPRESSION=CCITTFAX4
>
> R C
>
>
> > -----Original Message-----
> > From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-
> > bounces at lists.osgeo.org] On Behalf Of Craig Leat
> >
> > Hi
> >
> > I have a series of georeferenced Tiff images and I need to warp these
> > to a north-up orientation. The images are scans of some old sepia
> > plans. The files created by gdalwarp are in the order of 200 times
> > larger than the original files. Is there anything I can do to limit
> > the file size? Maybe limit the colour table to black and white only?
> [...]
>
> > Image Structure Metadata:
> >   COMPRESSION=CCITTFAX4
>
>
>
> > Band 1 Block=13628x512 Type=Byte, ColorInterp=Palette
> >   Metadata:
> >     NBITS=1
>

Thanks for the info Robert. I checked the GeoTiff documentation
(http://www.gdal.org/frmt_gtiff.html) and found the option:
COMPRESS=[JPEG/LZW/PACKBITS/DEFLATE/CCITTRLE/CCITTFAX3/CCITTFAX4/NONE]
However, using COMPRESS I get the following on my build of gdal 1.4.4.0:
Warning 5: COMPRESS=CCITTFAX4 value not recognised, ignoring.
COMPRESSION appears to work. Is this an error in the documentation?

I tried: gdalwarp -co "NBITS=1" -co "COMPRESSION=CCITTFAX4"
sheet10.tif sheet10_nu5.tif, but it makes no difference to the file
size and gdalinfo does not show the presence of NBITS or COMPRESSION
in the warped file.

Any ideas on what I am doing wrong?

Craig


More information about the gdal-dev mailing list