Investigate why PIL and LibJPEG pixel values don't match for CMYK images
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 7.3k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 13
Description
Loading a CMYK image using libJpeg seems to yield different results than loading it with PIL.
More specifically the pixel values of img_ljpeg == 255 - img_pil:
https://github.com/pytorch/vision/blob/ada56a2442282752ccb83c935e10cb4fbbc0c8d5/test/test_image.py#L55-L69
We should investigate if that discrepancy is a bug on the way we use libjpeg.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test/test_image.py lines 55-69 and compare the CMYK pixel values produced by PIL and libjpeg. Investigate whether the inversion discrepancy comes from how libjpeg is used; the work is done when the cause is identified and any resulting bug is addressed or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100