Skip to content

Do not open YCbCr colorspace images as RGB without libtiff#9779

Open
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:ycbcr
Open

Do not open YCbCr colorspace images as RGB without libtiff#9779
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:ycbcr

Conversation

@radarhere

@radarhere radarhere commented Jul 7, 2026

Copy link
Copy Markdown
Member

TIFF images in the YCbCr colorspace (6) are currently opened as RGB.

# JPEG compressed images handled by LibTiff and auto-converted to RGBX
# Minimal Baseline TIFF requires YCbCr images to have 3 SamplesPerPixel
(II, 6, (1,), 1, (8, 8, 8), ()): ("RGB", "RGBX"),
(MM, 6, (1,), 1, (8, 8, 8), ()): ("RGB", "RGBX"),

However, TiffImagePlugin does not always use libtiff. This PR only applies the RGB treatment when libtiff is used.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant