Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document JPEG 2000 support for writing YCbCr and reading subsampled color #7636

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

bgilbert
Copy link
Contributor

Read support for subsampled RGB and YCbCr color channels was added in 4f4c3b3 and not documented at the time. Write support for YCbCr appears to date to 61fb89e, the original commit.

Retain the existing language about YCbCr input conversion to RGB, even though it's not completely correct. OpenJPEG through 2.5.0 doesn't set color_space in opj_read_header(), so we end up in our OPJ_CLRSPC_UNSPECIFIED fallback path, which guesses sRGB if there's no component subsampling. This means we currently can't round-trip YCbCr via JPEG 2000. The next OpenJPEG release will fix this (uclouvain/openjpeg#1463) so leave the docs as is.

Also fix typo: .j2p -> .jp2.

@radarhere
Copy link
Member

@nulano since you wrote 4f4c3b3, did you have any thoughts on this?

…olor

Read support for subsampled RGB and YCbCr color channels was added in
4f4c3b3 and not documented at the time.  Write support for YCbCr
appears to date to 61fb89e, the original commit.

Retain the existing language about YCbCr input conversion to RGB, even
though it's not completely correct.  OpenJPEG through 2.5.0 doesn't set
color_space in opj_read_header(), so we end up in our
OPJ_CLRSPC_UNSPECIFIED fallback path, which guesses sRGB if there's no
component subsampling.  This means we currently can't round-trip YCbCr via
JPEG 2000.  The next OpenJPEG release will fix this, so leave the docs as
is.

Also fix typo: .j2p -> .jp2.
@radarhere radarhere merged commit ca9b49f into python-pillow:main Dec 27, 2023
7 of 8 checks passed
@bgilbert bgilbert deleted the jp2-docs branch December 27, 2023 16:23
@radarhere
Copy link
Member

Thanks for your thoughts @nulano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants