You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Converting a PNG to a JXL with cjxl -d 0, and then comparing the original and converted images with ssimulacra2 results in a score < 100.
To Reproduce
Use cjxl -d 0 to convert a PNG to a JXL (e.g. cjxl house.png house.jxl -d 0)
Compare the original and converted image with ssimulacra2 (e.g. ssimulacra2 house.png house.jxl)
Observe that the SSIMULACRA2 score is less than 100
Convert back to PNG with djxl (e.g. djxl house.jxl house2.png)
Compare the original PNG and new PNG with ssimulacra2 (e.g. ssimulacra2 house.png house2.png)
Observe that the SSIMULACRA2 score is 100
Expected behavior
The SSIMULACRA2 score between the original PNG and converted JXL should be 100.
Looks like this is caused by slight differences in the way the conversion from int to float is implemented in dec_modular.cc (which is what is used when decoding a jxl) and in enc_external_image.cc (which is what is used when decoding a png).
The discrepancy is very small (rounding one way or the other in float32, which corresponds to an off-by-one and occasional off-by-two in 24-bit integer precision), but it is enough to cause the ssimulacra2 score to be below 100.
When decoding the jxl back to 8-bit png, the discrepancy disappears since the error is way too small to lead to different 8-bit values. But ssimulacra2 works in the full float32 precision so it notices the small discrepancy.
This problem will disappear if one or both of these things is done:
refactor the implementation of int-to-float to avoid the near-duplication, so both code paths do it in exactly the same way
avoid the conversion to float after modular decoding, producing a uint8 ppf that will then be treated the same way as the decoded png
Describe the bug
Converting a PNG to a JXL with
cjxl -d 0
, and then comparing the original and converted images withssimulacra2
results in a score < 100.To Reproduce
cjxl -d 0
to convert a PNG to a JXL (e.g.cjxl house.png house.jxl -d 0
)ssimulacra2
(e.g.ssimulacra2 house.png house.jxl
)djxl
(e.g.djxl house.jxl house2.png
)ssimulacra2
(e.g.ssimulacra2 house.png house2.png
)Expected behavior
The SSIMULACRA2 score between the original PNG and converted JXL should be 100.
Screenshots
Environment
Additional context
house.png
,house.jxl.png
, andhouse2.png
are the files used in the examples I've given in the steps to reproduce.cjxl
,djxl
, andssimulacra2
all came fromjxl-x64-windows-static
in release 0.10.2.The text was updated successfully, but these errors were encountered: