Openjpeg 2.3.1 changes color matrix.
Openjpeg 2.3.1 changes color matrix. In my opinion codec should not do this. copenjpeg_j2k.exe -i Stationery.yuv -o Stationery_openjpeg.j2k -F 4000,3000,3,8,u@1x1:2x2:2x2 -mct 1 -b 64,64 -c [128,128],[256,256] -p CPRL -r 150 https://imgsli.com/MTIzOTc Unable to convert colorspace unknown to rgb.
Can you bisect it to one commit that causes the issue? What matrix you are talking about?
Matrix unknown. For HTJPEG2000 the same settings are correct. cjpegHTJ2K_j2c.exe -i Stationery.yuv -o Stationery_openjph.j2c -dims {4000,3000} -num_comps 3 -signed false -bit_depth 8 -downsamp {1,1},{2,2},{2,2} -block_size {64,64} -precincts {128,128},{256,256} -prog_order CPRL -qstep 0.048 https://imgsli.com/MTIzOTg
Please give Stationery.yuv, Stationery_openjpeg.j2k, Stationery_openjph.j2c in zip archive (you can drag and drop it here). That imgsli converted everything to png.
https://www.sendspace.com/file/tna3t1
The difference in https://imgsli.com/MTIzOTg is that left picture does not have any Gamma metadata while picture on the right does have Gamma 2.2 (in PNG gAMA).
You are using command cjpegHTJ2K_j2c.exe -i Stationery.yuv -o Stationery_openjph.j2c -dims {4000,3000} -num_comps 3 -signed false -bit_depth 8 -downsamp {1,1},{2,2},{2,2} -block_size {64,64} -precincts {128,128},{256,256} -prog_order CPRL -qstep 0.048 that looks like is adding gAMA chunk of 2.2. sRGB is not 2.2! It is also not 2.4, but uses much more complex formula. See https://en.wikipedia.org/wiki/Gamma_correction#Mathematics
I would also say that we are not supporting https://www.itu.int/rec/T-REC-T.814/en -- High-throughput JPEG 2000, nor we support cjpegHTJ2K... Your issue #1112 should be reopened though. D:)
It turned out my mistake. I wanted to use RGB-YCoCg {mct} color conversion, which is forbidden for yuv '-F'. Is it possible to import yuv rgb24 or rgba photos. Reportedly an alpha channel is possible for jpeg2000 part16 and is fully compatible with heif/avif. I have not tested if the matrix colors are correct for mct zero