On mercredi 23 septembre 2020 15:02:42 CEST APM wrote: > Dear all, > > > I like to compress a Geotiff rastermap with compress=jpeg. > > > gdalinfo for a .vrt which I like to compress: > > Coordinate System is: > PROJCRS["ETRS89 / UTM zone 32N", > BASEGEOGCRS["ETRS89", > DATUM["European Terrestrial Reference System 1989", > ELLIPSOID["GRS 1980",6378137,298.257222101, > LENGTHUNIT["metre",1]]], > > . > > . > > > Band 1 Block=128x128 Type=Byte, ColorInterp=Palette > Color Table (RGB with 256 entries) > 0: 255,255,255,255 > 1: 255,255,255,255 > 2: 255,255,255,255 > 3: 191,230,230,255 > 4: 153,255,179,255 > 5: 230,255,204,255 > 6: 191,242,128,255 > > . > > . > > gdal_translate dtk25.vrt -co COMPRESS=JPEG out.tiff > > Input file size is 201600, 198400 > > 0ERROR 1: JPEGSetupEncode:PhotometricInterpretation 3 not allowed for JPEG > ERROR 1: An error occurred while writing a dirty block from > GDALRasterBand::IRasterIO > ERROR 1: JPEGSetupEncode:PhotometricInterpretation 3 not allowed for JPEG > ERROR 1: JPEGSetupEncode:PhotometricInterpretation 3 not allowed for JPEG
Color table and JPEG compression don't go together. You may add "-expand rgb" to your gdal_translate command line to convert from the color palette into a RGB image. Or keep a paletted image but use a lossless compression scheme such as LZW or DEFLATE. Even -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
