[Gdal-dev] B&W tiffs
Frank Warmerdam
fwarmerdam at gmail.com
Wed Mar 16 09:21:47 EST 2005
On Wed, 16 Mar 2005 08:08:22 -0500, Christoph Spoerri
<cspoerri at cavtel.net> wrote:
> Hi there,
> one of my peer developers at my office has the following question regarding
> GDAL:
>
> I have a 3-band color tiff file. Can I use the gdal library to convert it to
> one-bit 4 group b&w tiff? If yes, how can I implement it?
>
> The problem we are facing is to create png and b&w tiffs from ArcMap layout
> through code (VB). The only other solution (we know if currently) is getting
> a license for ArcPress, yet this would be fairly expensive and would require
> additional CPU/memory resources. Does anybody know of any other possible
> solutions?
Christoph,
I think Richard's suggestion of using ImageMagick (or a similar
application) is good. GDAL does not support output of 1 bit
images at this time, nor does it contain algorithms for going
from RGB to 1bit.
Alternatively, use GDAL to convert your image to greyscale,
and then use the libtiff utilty program "tiffdither" to convert to
a 1 bit compressed TIFF file.
Note, it will be hard to use gdal_translate to turn 1bit files
into 1bit geotiff files because it cannot output 1bit files. But
you could easily get a world file to associate with the final
.tif file if needed.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list