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

Support CMYK conversion (for TIFFs) #2074

Closed
sophie-h opened this issue Dec 18, 2023 · 3 comments · Fixed by #2075
Closed

Support CMYK conversion (for TIFFs) #2074

sophie-h opened this issue Dec 18, 2023 · 3 comments · Fixed by #2075

Comments

@sophie-h
Copy link
Contributor

The following image

gives this error with image-rs

The decoder for Tiff does not support the color type `Unknown(32)`

I'm not sure if that's the exact same missing feature as image-rs/image-tiff#202 since instead of "palette", this image reports "separated."

=== TIFF directory 0 ===
TIFF Directory at offset 0x8 (8)
  Subfile Type: (0 = 0x0)
  Image Width: 8100 Image Length: 12021
  Resolution: 300, 300 pixels/inch
  Bits/Sample: 8
  Compression Scheme: LZW
  Photometric Interpretation: separated
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 4
  Rows/Strip: 8
  Planar Configuration: single image plane
  Software: Adobe Photoshop 22.0 (Windows)
@sophie-h
Copy link
Contributor Author

This section describes how to store separated (usually CMYK) image data in a
TIFF file.

Looks like we are dealing with "Section 16: CMYK Images" of TIFF 6.0

@fintelia
Copy link
Contributor

I think this error is actually coming from the main image crate which doesn't support all the color formats that image-tiff does. Specifically if I'm interpreting the output correctly, the tiff file is in CMYK format and while this crate is perfectly happy to extract the contents, we currently lack the ability to convert to RGB which would be needed to produce a DynamicImage.

You can see TiffDecoder:new for where the supported vs. unsupported determination is made

@sophie-h
Copy link
Contributor Author

Yeah, image-tiff is working as expected here. Can you move this to image-rs?

Converting CMYK to RGB sounds easy enough. (Famous last words.)

@sophie-h sophie-h changed the title Support "Photometric Interpretation: separated" Support CMYK conversion (for TIFFs) Dec 18, 2023
@fintelia fintelia transferred this issue from image-rs/image-tiff Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants