[gdal-dev] How to use JPEGXL in TIFF right?
Rahkonen Jukka
jukka.rahkonen at maanmittauslaitos.fi
Thu Oct 24 06:53:14 PDT 2024
Thanks Thomas,
I will suggest an edit to the GeoTIFF driver page for adding that information.
If single row blocks are needed for some reason, it seems to be better to use the JPEGXL driver directly. It is fast and creates small output.
gdal_translate -of jpegxl -co lossless=yes p4433h.tif p4433h.jxl
File size: 143 446 039
Band 1 Block=12000x1
-Jukka Rahkonen-
Lähettäjä: thomas bonfort <thomas.bonfort at gmail.com>
Lähetetty: torstai 24. lokakuuta 2024 16.18
Vastaanottaja: Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: 'gdal-dev at lists.osgeo.org' (gdal-dev at lists.osgeo.org) <gdal-dev at lists.osgeo.org>
Aihe: Re: [gdal-dev] How to use JPEGXL in TIFF right?
Hi Jukka,
Yes, you should definitely be using tiled tiff with jxl. The actual tile size (256,512 or 1024) did not seem to make much difference in file size from what I have experienced, so you can choose that value depending on how you plan to use the tifs later on.
In production use here, we use "-co BIGTIFF=YES -co TILED=YES -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co COMPRESS=JXL -co JXL_EFFORT=3" . Setting the effort to 3 greatly reduces compression time while having very little effect on final image size on 16bit satellite imagery.
Regards,
TB
On Thu, Oct 24, 2024 at 1:00 PM Rahkonen Jukka via gdal-dev <gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>> wrote:
Hi,
I made some tests about using JPEGXL (JXL) compression in GeoTIFF. I am interested in lossless compression. So far I have learned that stripes are not good, but results from tiled TIFFs are promising.
The GeoTIFF driver manual has a warning about WEBP compression: “There is a significant time penalty for each tile/strip with lossless WebP compression, so you may want to increase the BLOCKYSIZE value for strip layout.” I wonder if the same applies to JPEG XL compression as well. Without tiles this command was very slow
gdal_translate -of gtiff -co compress=jxl p4433h.tif p4433h_jxl.tif
This one was faster.
gdal_translate -of gtiff -co tiled=yes -co compress=jxl p4433h.tif p4433h_jxl_tiled.tif
Not only being slow but the compression with stripes does not really compress much. See the file sizes:
With stripes: 359 211 087 p4433h_jxl.tif
With 256x256 tiles: 142 188 540 p4433h_jxl_tiled.tif
Referense (LZW): 283 864 896 p4433h_lzw.tif
What might be the optimal block size for JXL-in-GeoTIFF when the aim is a good compression ratio and reasonable processing time?
-Jukka Rahkonen-
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241024/6c319adc/attachment-0001.htm>
More information about the gdal-dev
mailing list