Hi Nico,
Thanks for the thorough testing, this is very helpful! Looks like the
encoder settings can be improved to get results similar to VIPS.
And it seems JpegXL is the way to go in the longer term.
Kind regards,
Joost Nieuwenhuijse
www.ptgui.com
On 17-03-2024 17:51, Nico Höllerich wrote:
> *TL;DR*
>
> * Only use 4x and 1x (lossless) compression
> * Don't use color spaces besides sRGB
>
> *Background*
> I was very excited to directly output to a lossy image format with
> 16-bit depth. So I picked one of the recent panoramas (200 Megapixel;
> Details 1)
> From a lossy JP2 file, I expect to preserve the full dynamic range at a
> reasonable file size (~ 150 MB).
>
> *Analysis*
> So I exported it at *10x compression* (120 MB) with sRGB color profile.
> Then, I increased exposure by 9EV to check for compression artifacts.
> The result is rather disappointing:
> 2024-01-07-0041_jp2_sRGB_c10_+8EV.png
> For comparison, this is the *lossless *compressed file (693 MB):
> 2024-01-07-0041_jp2_sRGB_lossless_+8EV.png
>
> The compressed result is barely better than a *8-bit jpg* (73.5 MB):
> 2024-01-07-0041_jpg_sRGB_q98_+8EV.png
>
> Selecting the *ProPhoto color space with 10x* compression has the same
> issues:
> 2024-01-07-0041_jp2_ProPhoto_c10_+8EV.png
>
> *Workarounds*
> Go down *to 4x compression* (300 MB) to achieve just a slightly blurred
> result:
> 2024-01-07-0041_jp2_sRGB_c04_+8EV.png
>
> Pick a custom color space with perceptual quantization (here:
> *RGB_D65_202_Per_PeQ*), then *10x compression* is a bit better:
> 2024-01-07-0041_jp2_Rec20PeQ_c10_+8EV.png
> However, ICC different from sRGB are not correctly interpreted by
> external applications (e.g. Gimp, XnView, IrfanView). See Details 4
>
>
> Alternative lossy compression with no visual loss even at 200% crop:
>
> * EXR with DWAB (compression=30): 138 MB
> * JXL (Details 2): 65.2 MB
> * JP2 converted with vips
> <
https://github.com/libvips/libvips/releases> and quality 65: 126 MB
>
> It seems other codecs and encoders achieve a better result by allocating
> more accuracy to darker regions. Looking at the vips encoder, this
> should be achievable by the JP2 encoder with the correct settings
> (Details 3).
>
>
> ---------
> *Details*
>
> 1. The panorama consists of 5 images, taken with the full frame fisheye
> AstrHori 12 mm on a Nikon Z7 II at f/8, 1/40, ISO64. Images are shot
> as RAW with 14-bit, lossless compression
> 2. JXL: Encoding pipeline: TIFF -> PNM -> Jpeg XL
> <
https://jpegxl.info/>using cjxl
> <
https://github.com/libjxl/libjxl/releases>v0.10.2 with encoder
> settings d=0.4 e=6 target_intensity=8192
> 3. JP2 encoder settings of
> vips:
https://github.com/libvips/libvips/blob/master/libvips/foreign/jp2ksave.c
> 4.
> Running exiftool 2024-01-07-0041_c10_Rec2020_PQ.jp2 gives:
>
>
> Color Space : sRGB
> Color Space Data : RGB
> Profile Connection Space : XYZ
> Profile Description : RGB_D65_202_Per_PeQ
>
> It seems color space attributes are not correctly set.
>
> --
> You received this message because you are subscribed to the Google
> Groups "PTGui Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
ptgui+un...@googlegroups.com
> <mailto:
ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ptgui/a7287b4b-e807-407e-8cae-4e087116c91fn%40googlegroups.com <
https://groups.google.com/d/msgid/ptgui/a7287b4b-e807-407e-8cae-4e087116c91fn%40googlegroups.com?utm_medium=email&utm_source=footer>.