cloudinary / ssimulacra2

SSIMULACRA 2. Perceptual metric.
BSD 3-Clause "New" or "Revised" License
161 stars 5 forks source link

ssimulacra2 gives these errors #7

Closed Boipisigre closed 1 year ago

Boipisigre commented 1 year ago

Hi I build ssimulcra2 on debian 12 RC, without problem.

But when i try to execute ssimulacra2 give these errors.

~/src/ssimulacra2/build/ssimulacra2 IMG_8165.png IMG_8165.jxl /home/pierre/src/ssimulacra2/src/lib/extras/dec/apng.cc:193: JXL_FAILURE: Failed to parse decimal /home/pierre/src/ssimulacra2/src/lib/extras/dec/apng.cc:232: JXL_RETURN_IF_ERROR code=1: DecodeDecimal(&pos, encoded_end, &bytes_to_decode) /home/pierre/src/ssimulacra2/src/lib/extras/dec/apng.cc:128: Couldn't parse 'Raw format type' text chunk /home/pierre/src/ssimulacra2/src/lib/extras/dec/decode.cc:120: JXL_FAILURE: Codecs failed to decode /home/pierre/src/ssimulacra2/src/lib/extras/codec.cc:49: JXL_FAILURE: Codecs failed to decode /home/pierre/src/ssimulacra2/src/lib/extras/codec.cc:57: JXL_RETURN_IF_ERROR code=1: SetFromBytes(Span(encoded), color_hints, io, pool, orig_codec) /home/pierre/src/ssimulacra2/src/ssimulacra2_main.cc:53: JXL_CHECK: SetFromFile(argv[2], jxl::extras::ColorHints(), &io2) Instruction non permise

I send you the picture in png , avif or jxl . regards

tamaracloudinary commented 1 year ago

Hi @Boipisigre, Thanks for reaching out. Would you please share which steps you have taken and what error did you get? Thanks, Tamara

Boipisigre commented 1 year ago

Hi I would like calculate the ssimulacra score between the same picture in png ( original ) with the jxl picture.

Here is a file with the same image in png jxl and avif Scrcpy.tar.gz

when i try to execute ssimulacra2 with this image i have this message.

~/src/ssimulacra2/build/ssimulacra2 Scrcpy.png Scrcpy.jxl /home/pboizot/src/ssimulacra2/src/lib/extras/dec/color_hints.cc:54: No color_space/icc_pathname given, assuming sRGB /home/pboizot/src/ssimulacra2/src/lib/extras/dec/decode.cc:120: JXL_FAILURE: Codecs failed to decode /home/pboizot/src/ssimulacra2/src/lib/extras/codec.cc:49: JXL_FAILURE: Codecs failed to decode /home/pboizot/src/ssimulacra2/src/lib/extras/codec.cc:57: JXL_RETURN_IF_ERROR code=1: SetFromBytes(Span(encoded), color_hints, io, pool, orig_codec) /home/pboizot/src/ssimulacra2/src/ssimulacra2_main.cc:53: JXL_CHECK: SetFromFile(argv[2], jxl::extras::ColorHints(), &io2) Instruction non permise

Boipisigre commented 1 year ago

Hummm I just understand that the SSimulacra score is calculated between two PNG pictures.

So I converted jxl picture to PNG ;-)

I have my score 👍🏿 I do not read that in readme a small explanation will be good.

Boipisigre commented 1 year ago

Good work

Boipisigre commented 1 year ago

Hi Could you give us the list of codecs we can use?

webp, avif , gif, jxl seem do not work.

Thank

jonsneyers commented 1 year ago

Currently it should work for png, jpeg, ppm (assumed to be sRGB), and pgx. In the future (once https://github.com/libjxl/libjxl/pull/2444 is merged) it will also work for jxl input.

homm commented 1 year ago

I have the same errors with png

/opt # dssim ./input/parrots.png ./output/parrots.s8.q44.png 
0.00865207  ./output/parrots.s8.q44.png

/opt # ssimulacra2 ./input/parrots.png ./output/parrots.s8.q44.png
/opt/ssimulacra2/src/lib/extras/dec/decode.cc:120: JXL_FAILURE: Codecs failed to decode
/opt/ssimulacra2/src/lib/extras/codec.cc:49: JXL_FAILURE: Codecs failed to decode
/opt/ssimulacra2/src/lib/extras/codec.cc:57: JXL_RETURN_IF_ERROR code=1: SetFromBytes(Span<const uint8_t>(encoded), color_hints, io, pool, orig_codec)
Could not load original image: ./input/parrots.png
homm commented 1 year ago

It turns out I didn't have libpng-dev installed. Sorry. Error message is not intuitive.