[gdal-dev] gdalwarp and GTiff creation option NBITS

Frank Warmerdam warmerdam at pobox.com
Fri Jun 11 12:32:29 EDT 2010


Fischer, Andreas wrote:
> Dear list,
> 
> I try to convert a raster images (GTiff) with gdalwarp. The images only 
> have two colors (black/white) and the color table just have two entries. 
> Therefore the file size for each image is exactly as big as needed 
> (1bit/pixel). The result of gdalwarps transformation are images with 
> 8bits / pixel and 256 entries in the color table. The file size for each 
> image  is increased but in this case this is without benefit, because 
> the results are still black and white.
> 
> So I tried the creation option “-co NBITS=1”. Color Table und file size 
> are now exactly as I expected,  but I can’t display the result properly 
> with any program. For example IrfanView does fine, but unfortunately 
> MapInfo Professional doesn’t. MapInfo Professional just shows irregular 
> stripes. After opening the result file in IrfanView and saving it as a 
> copy, the copy is displayed in MapInfo fine as well. I do not understand 
> this behavior, because gdalinfo doesn’t show any differences.

Andreas,

It would be helpful if you could provide a tiffinfo report for each of
the three files.  It should reveal more of the low level tiff format
details which will be 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