[gdal-dev] Installing GDAL on Win7

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Mar 24 01:57:49 PDT 2014


Mike Flannigan <mikeflan <at> att.net> writes:

> 
> 
>     
>     Thank you all.  I got it to work with the following 
>     command:
>     gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES"
>     C:\Copy\wp.pdf C:\Copy\wpt.tif --config GDAL_PDF_DPI 300
>     It works pretty good.  It converts a 11.1 MB PDF into a 
>     96MB Tiff file that zips up into a 57 MB file.  These files 
>     are about 15 times bigger than the ones I am used to, but 
>     they do have quite a bit of detail and don't have the 
>     blank white space that a 7.5 minute topo has.
>     These Tiffs are very well georeferenced.  I am pleased.

Hi,

You should not be pleased yet because you can get better. Start by reading
creation options - compress from http://www.gdal.org/frmt_gtiff.html.

Zipping tiff files is mostly not necessary because you can compress the
image data that is stored into a tiff. That reduces the file size and
removes the need for zipping-unzipping. Some hints about how and when to
compress.

Natural images like aeriel and satellite photos compress best with JPEG
compression. Use parameters 
-co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR For b/w images just
-co COMPRESS=JPEG

Your originals seem to be topo maps. For those JPEG compression may not be
optimal because JPEG compression is blurring sharp edges and topo maps are
full of those because of texts and line drawings. Adding -co JPEG_QUALITY=
with a higher value than the default value 75 makes better quality, test it
and look at the results. However, generally LZW and deflate compression
methods are better for topo maps. Both methods are lossless and keep texts
sharp. At the same time the compression ratio can be very good. The
parameters to use are 
-co COMPRESS=LZW of
-CO COMPRESS=DEFLATE
With deflate you can also use parameter 
-co ZLEVEL=
Big ZLEVEL value gives smaller files but compression is slower. Quality is
the same, lossless.

Scanned old maps are somehow in the middle of computer made topo maps and
aerial images. The old paper gives non-uniform colour to the whole
background and LZW of deflate compression may not give good compression
ratio. Make some tests and consider what suits you best.

There is still one drawback with compressed tiffs: all applications cannot
open all kind of compressed tiffs. If images are for your own use or your
users will use GDAL based applications then all compression alternatives
should be as usable. If you know that some other viewers will be used and
you know what they are then you can make a test and feel relaxed. If you
want the widest possible audience then zipping the uncompressed tiffs is an
option but perhaps I wouldn't go for that myself. Being forced to unzip
images before viewing them is not a pleasure.

-Jukka Rahkonen-







More information about the gdal-dev mailing list