Closed BeebBenjamin closed 5 months ago
You're right: iipsrv was setup to use lossy compression for WebP. However, I just pushed a commit (https://github.com/ruven/iipsrv/commit/5be79279160c772da958a1589a8fdf3d85fadbb3) that allows you to also specify lossless encoding!
Just set WEBP_QUALITY=-1 and tiles will be output with lossless compression. If you want to set this on a per-request basis, you can do this through the IIP API by setting the QLT query parameter to -1.
That seems to have fixed this, huge thanks for the quick response!
By the way, a highly efficient way of doing this, would be to encode the TIFF image containing the normal map data with lossless WebP-compressed tiles. You can generate a lossless WebP TIFF using vips like this:
vips tiffsave --tile-width 256 --tile-height 256 --pyramid --lossless --compression webp input.png output.tif
The latest github version of iipsrv has a new pass-through mode, which allows pre-encoded tiles within a TIFF to be directly sent to the user without re-encoding if no image processing is needed. As WebP encoding is relatively slow, this would give you a noticeable speed gain. This short-cut only works for requests that map exactly to an existing tile in the TIFF pyramid structure - which should be the case if your tile requests are being made by a pan and zoom viewer.
I am looking into different formats for the best choice to store normal map data for 3D IIIF. I managed to get
libwebp
compiled and built intoiipsrv
, and I can getwebp
format tiles, however, even withWEBP_QUALITY="100"
the tiles look lossy in thethree.js
shader; this makes me think that by defaultwebp
format is requested as lossy byiipsrv
.Does iipsrv support lossless WebP format?