Remove non-GRAY ICC profiles from grayscale JPG files #176

Merged
josch merged 1 commit from leoleozhu/img2pdf:main into main 2023-10-18 06:32:02 +00:00
Contributor

I have found additional cases for josch/img2pdf#175.

In this pull request, the non-GRAY ICC profiles will be removed for Grayscale JPG files.

You can find more information and references to support this change:

• The Pillow CmsProfile documentation [https://pillow.readthedocs.io/en/stable/reference/ImageCms.html#PIL.ImageCms.CmsProfile.xcolor_space]
• The ICC.1:2010 specification, specifically section 7.2.6 Data colour space field (bytes 16 to 20) [https://www.color.org/specification/icc1v43_2010-12.pdf]

While I’m not an expert on color profiles, it seems that the only possible ICC profile for grayscale jpg files is ‘GRAY’.

I have found additional cases for josch/img2pdf#175. In this pull request, the non-GRAY ICC profiles will be removed for Grayscale JPG files. You can find more information and references to support this change: • The Pillow CmsProfile documentation [https://pillow.readthedocs.io/en/stable/reference/ImageCms.html#PIL.ImageCms.CmsProfile.xcolor_space] • The ICC.1:2010 specification, specifically section 7.2.6 Data colour space field (bytes 16 to 20) [https://www.color.org/specification/icc1v43_2010-12.pdf] While I’m not an expert on color profiles, it seems that the only possible ICC profile for grayscale jpg files is ‘GRAY’.
leoleozhu added 1 commit 2023-10-18 06:14:47 +00:00
josch merged commit 5cd0918d50 into main 2023-10-18 06:32:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#176
No description provided.