AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO
[BUG] PSD CMYK to RGB: colors are off
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 698
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 48
Description
**Describe the bug**
Converting a PSD file to e.g. PNG fails to convert CMYK to RGB correctly.
**To Reproduce**
Steps to reproduce the behavior:
1. Get the .PSD file from the attached archive:
[minimal.zip](https://github.com/OpenImageIO/oiio/files/5904496/minimal.zip)
2. Then simply run `iconvert minimal.psd minimal.png`
3. Then observe that the PNG colors mismatch the correct result of the PSD input
**Expected behavior**
Cyan becomes greenish when converting from CMYK to RGB
**Evidence**
These [lines of code](https://github.com/OpenImageIO/oiio/blob/3e74eae539bcd3662106009baa64ab23a3e48a75/src/psd.imageio/psdinput.cpp#L374) are rather suspicious. Maybe the PSD format is not consistently storing CMYK in a WTF way?
**Platform information:**
- OIIO branch/version: 2.2.10.1 home-brew edition
- OS: macOS
Contributor guide
Research direction
Start in src/psd.imageio/psdinput.cpp around line 374 and reproduce the issue with the attached minimal.zip archive by running `iconvert minimal.psd minimal.png`. Compare the output colors with the PSD input, focusing on the CMYK-to-RGB conversion. Done means cyan converts to the expected greenish RGB result rather than the mismatched PNG colors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100