thorfdbg / libjpeg

A complete implementation of 10918-1 (JPEG) coming from jpeg.org (the ISO group) with extensions for HDR, lossless and alpha channel coding standardized as ISO/IEC 18477 (JPEG XT).
327 stars 81 forks source link

Compatibility of jpeg(XT) 8bit photos with jpeg-turbo #65

Closed Jamaika1 closed 2 years ago

Jamaika1 commented 2 years ago

Compatibility of jpeg(XT) 8bit photos, i.e. all types of jpeg lossless, progressice, sequetial, baseline (RGB and YCbCr). Oddly enough, these pictures seem to be reading the jpeg-turbo codec (assembler) these days. Jpeg(XT) lossless and variations can still be problematic. Code:

Unsupported marker type 0xf7
Unsupported marker type 0xc3

I tested aom, libavif, libwebp2 and libjxl. Code:

JPEG XL encoder v0.7.0 0.7.0-4bba562 [Scalar] with JPEG lossy transcode
jpg.cc:202: JXL_FAILURE: arithmetic code JPEGs are not supported

JPEG XL encoder v0.7.0 0.7.0-4bba562 [Scalar] without JPEG lossy transcode
enc_jpeg_data_reader.cc:170: Invalid comps_in_scan: 3
enc_jpeg_data.cc:305: JXL_FAILURE: Error reading JPEG

Independent JPEG Group's CJPEG, version 9e 16-Jan-2022 Copyright (C) 2022, Thomas G. Lane, Guido Vollbeding cjpeg_08bit.exe -quality 100 -rgb -progressive -arithmetic -bgycc -verbose image_21447_24bit.ppm image_21448_24bit(ps)_RGB.jpg cjpeg_08bit.exe -quality 100 -progressive -arithmetic -bgycc -verbose image_21447_24bit.ppm image_21448_24bit(ps)_YCbCr.jpg cjpeg_08bit.exe -quality 100 -rgb -arithmetic -bgycc -verbose image_21447_24bit.ppm image_21448_24bit(ss)_RGB.jpg cjpeg_08bit.exe -quality 100 -arithmetic -bgycc -verbose image_21447_24bit.ppm image_21448_24bit(ss)_YCbCr.jpg

Failed progressive to create temporary file

jpegXT Copyright (C) 2012-2022 Thomas Richter, University of Stuttgart and Accusoft jpegLS.exe -encodepnm image_21447_24bit.ppm image_21448_24bit(l)_YCbCr.jls jpegXT.exe -q 100 -l -c -a -r -qt 3 -s 1x1,1x1,1x1 image_21447_24bit.ppm image_21448_24bit(l)_RGB.jxt jpegXT.exe -q 100 -v -c -a -r -qt 3 -s 1x1,1x1,1x1 image_21447_24bit.ppm image_21448_24bit(p)_RGB.jxt jpegXT.exe -q 100 -v -a -r -qt 3 -s 1x1,1x1,1x1 image_21447_24bit.ppm image_21448_24bit(p)_YCbCr.jxt jpegXT.exe -q 100 -c -a -r -qt 3 -s 1x1,1x1,1x1 image_21447_24bit.ppm image_21448_24bit(s)_RGB.jxt jpegXT.exe -q 100 -a -r -qt 3 -s 1x1,1x1,1x1 image_21447_24bit.ppm image_21448_24bit(s)_YCbCr.jxt

av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(l)_YCbCr.jls -d image_21447_24bit(1).av1 av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(l)_RGB.jxt -d image_21447_24bit(2).av1 av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(p)_RGB.jxt -d image_21447_24bit(3).av1 av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(p)_YCbCr.jxt -d image_21447_24bit(4).av1 av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(s)_RGB.jxt -d image_21447_24bit(5).av1 av1enc.exe -q 100 -444 -size 1563x1558 -effort 5 -tune butteraugli -thread 4 image_21448_24bit(s)_YCbCr.jxt -d image_21447_24bit(6).av1

cjxl.exe image_21448_24bit(l)_RGB.jxt image_21447_24bit(2).jxl -e 5 -m -v -q 100 -s 5 -C 1 --num_threads=4 cjxl.exe image_21448_24bit(p)_RGB.jxt image_21447_24bit(3).jxl -e 5 -p -v -j -q 100 -s 5 -C 1 --num_threads=4 cjxl.exe image_21448_24bit(p)_YCbCr.jxt image_21447_24bit(4).jxl -e 5 -p -v -j -q 100 -s 5 -C 1 --num_threads=4 cjxl.exe image_21448_24bit(s)_RGB.jxt image_21447_24bit(5).jxl -e 5 -v -j -q 100 -s 5 -C 1 --num_threads=4 cjxl.exe image_21448_24bit(s)_YCbCr.jxt image_21447_24bit(6).jxl -e 5 -v -j -q 100 -s 5 -C 1 --num_threads=4

cwp2.exe image_21448_24bit(l)_RGB.jxt -info -q 100 -nometadata -mt -effort 5 -uv_mode 2 -csp 0 -o image_21448_24bit(2).wp2 cwp2.exe image_21448_24bit(p)_RGB.jxt -info -q 100 -nometadata -mt -effort 5 -uv_mode 2 -csp 0 -o image_21448_24bit(3).wp2 cwp2.exe image_21448_24bit(p)_YCbCr.jxt -info -q 100 -nometadata -mt -effort 5 -uv_mode 2 -csp 0 -o image_21448_24bit(4).wp2 cwp2.exe image_21448_24bit(s)_RGB.jxt -info -q 100 -nometadata -mt -effort 5 -uv_mode 2 -csp 0 -o image_21448_24bit(5).wp2 cwp2.exe image_21448_24bit(s)_YCbCr.jxt -info -q 100 -nometadata -mt -effort 5 -uv_mode 2 -csp 0 -o image_21448_24bit(6).wp2

htj2k-cgrok_ojph.exe -v -i image_21448_24bit(l)_RGB.jxt -o image_21447_24bit-grok(2).j2k -H 1 -M 32 -r 1 -mct 1 htj2k-cgrok_ojph.exe -v -i image_21448_24bit(p)_RGB.jxt -o image_21447_24bit-grok(3).j2k -H 1 -M 32 -r 1 -mct 1 htj2k-cgrok_ojph.exe -v -i image_21448_24bit(p)_YCbCr.jxt -o image_21447_24bit-grok(4).j2k -H 1 -M 32 -r 1 -mct 1 htj2k-cgrok_ojph.exe -v -i image_21448_24bit(s)_RGB.jxt -o image_21447_24bit-grok(5).j2k -H 1 -M 32 -r 1 -mct 1 htj2k-cgrok_ojph.exe -v -i image_21448_24bit(s)_YCbCr.jxt -o image_21447_24bit-grok(6).j2k -H 1 -M 32 -r 1 -mct 1 https://www.sendspace.com/file/mjx988

thorfdbg commented 2 years ago

Am 12.02.22 um 15:24 schrieb Jamaika1:

Compatibility of jpeg(XT) 8bit photos, i.e. all types of jpeg lossless, progressice, sequetial, baseline (RGB and YCbCr). Oddly enough, these pictures seem to be reading the jpeg-turbo codec (assembler) these days. Jpeg(XT) lossless and variations can still be problematic.

I'm sorry, I have no idea what you are talking about. What about providing a minimally not-working example, with all the options you are using and all the commands you are using.

Template:

*) I use the following command for encoding:

......

*) I use the following command for decodign

......

*) I'm expecting but I'm seeing .

BTW, arithmetic coding is part of the JPEG standard, but not widely supported, and it is NOT part of JPEG XT.

HTHH, Thomas

Jamaika1 commented 2 years ago

I understand that the codec files with the examples above in sendspace zip are insufficient. Meam you about opensource?

BTW, arithmetic coding is part of the JPEG standard, but not widely
supported, and it is *NOT* part of JPEG XT.

The latest JPEG 9e 2022 codec features http://www.ijg.org/files/ usage: cjpeg_08bit.exe [switches] inputfile outputfile

Switches (names may be abbreviated): -quality N[,...] Compression quality (0..100; 5-95 is useful range) -grayscale Create monochrome JPEG file -rgb Create RGB JPEG file -optimize Optimize Huffman table (smaller file, but slow compression) -progressive Create progressive JPEG file -scale M/N Scale image by fraction M/N, eg, 1/2 Switches for advanced users: -arithmetic Use arithmetic coding -block N DCT block size (1..16; default is 8) -rgb1 Create RGB JPEG file with reversible color transform -bgycc Create big gamut YCC JPEG file -dct int Use integer DCT method (default) -dct fast Use fast integer DCT (less accurate) -dct float Use floating-point DCT method -nosmooth Don't use high-quality downsampling -restart N Set restart interval in rows, or in blocks with B -smooth N Smooth dithered input (N=1..100 is strength) -maxmemory N Maximum memory to use (in kbytes) -outfile name Specify name for output file -verbose or -debug Emit debug output Switches for wizards: -baseline Force baseline quantization tables -qtables file Use quantization tables given in file -qslots N[,...] Set component quantization tables -sample HxV[,...] Set component sampling factors -scans file Create multi-scan JPEG per script file

thorfdbg commented 2 years ago

Am 12.02.22 um 19:57 schrieb Jamaika1:

I understand that the codec files with the examples above in zip are insufficient. Opensource you mean.

Which part of the instructions I provided did you not understand? I need a minimal example with instructions how to reproduce.

|BTW, arithmetic coding is part of the JPEG standard, but not widely supported, and it is NOT part of JPEG XT. |

The latest JPEG 9e 2022 codec features

I couldn't care less what Guido does in his codec, which is not a JPEG implementation. The JPEG committee, as part of ISO and ITU, provides and maintains the standard documents and the reference software.

Greetings, Thomas

thorfdbg commented 2 years ago

Closing, as it is apparently caused by Guido creating non-JPEG files and selling them as JPEG (which they are not). Just avoid IJG these days, sorry.