Encoder converts bad color subsampling YCoCg
I don't know, does command add 'force-rgb' by decoding?
-F <width>,<height>,<number_channels_subsampling>,<bitdepth>,{s,u}@<dx1>x<dy1>:...:<dxn>x<dyn>
Characteristics of the raw input parameters image
If delete channels colors, first channel 1x1 is luminance gray
Example: ffmpeg.exe -i sample.tiff -f rawvideo -pix_fmt yuv444p sample.raw
copenjpeg2000.exe -i sample.raw -o YCoCg24(444)_lossless.j2k
-F 8736,5856,3,8,u@1x1:1x1:1x1 -mct 1 -r 1 -C ''
Example: ffmpeg.exe -i sample.tiff -f rawvideo -pix_fmt yuv420p sample.raw
copenjpeg2000.exe -i sample.raw -o YCoCg24(420)_lossy_50%size.j2k
-F 8736,5856,3,8,u@1x1:2x2:2x2 -mct 1 -r 6 -C ''
Required only if RAW or RAWL input file is provided. [Don't uses file RGB(A) and info subsampling {s}]
First of all it is YCgCo, not YCoCg. That is how it is named in standards, in particular in H.273. Second of all there are no occurrences of both variants in the source code. Third, https://www.itu.int/rec/T-REC-H.273/ defines more different bit depths, inluding for different bit depths for Y and Cx components, that part of Matrix Coefficients is not implemented anywhere, except for Display Port and HDMI 2.1 DSC 1.2, except it uses YCgCo-R.
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
You either use YCoCg matrix or one of 4 YUV matrixes (for full and narrow (a.k.a. low, a.k.a. studio range) and BT.709 or BT.601 standards). You are not ABLE to use both, it is a contructer of 3 parts (Color Primaries, Transfer Function and Matrix Coefficients). Both YUV and YCoCg are Matrix Coeff. You use either/or. There is no such thing as colour subsampling in YCoCg, because it is a lossless format, that is why it is used in HDMI and Display Port. I can theoretically create such a standard, but nobody needs that.
Also, color subsamling is broken in this codec in YUV, see issue https://github.com/uclouvain/openjpeg/issues/377.
It is fixed in ffmpeg, see how it is done: https://trac.ffmpeg.org/ticket/4827#comment:4
I am surprised that viewers for jpeg2000 expect rgb24 and not yuv444p. https://i.ibb.co/mJvq4g9/ucsnath.png ffmpeg -i import -f rawvideo -pix_fmt yuv444p yuv444p.yuv ffmpeg -i import -f rawvideo -pix_fmt rgb24 rgb24.yuv ffmpeg -i import -f rawvideo -pix_fmt rgba rgba.yuv Lossless rgb conversion to ycocg was supposed to reduce file size. What about HDR with heif/avif photos? https://github.com/aous72/OpenJPH/pull/53
rgb conversion to ycocg was supposed to reduce file size
It is not ycocg convertion that reduces the size, it is the lossy or lossless compression that is THEN done on top of it. Okay? It is just with YCgCo (just like with very different any subsampling of YCbCr) the channels are more decorrelated, so that you can do compression in a more obvious and faster way.
I am surprised that viewers for jpeg2000 expect rgb24 and not yuv444p.
Not surprised at all. Maybe you should use Photoshop? It will not open what it does not support at least. Gimp is outright crazy on this file, for example, http://www.fnordware.com/j2k/relax.jp2 with corrupted icc profile. It is just bgr24 though.
https://github.com/aous72/OpenJPH also does not have any YCGCo support.