Skip to content

PSD: add support for 'cmyk', 'multichannel', and 'grayscale' color modes #1641

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

Merged
merged 1 commit into from
Mar 23, 2017

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Mar 19, 2017

Fixes #1603

With this patch to the PSD (Photoshop) reader, I believe we now correctly read grayscale, CMYK, and "multichannel" color modes (in addition to RGB, indexed, and bitmap, as we did before). We still don't support Lab, or duotone color modes (does anybody care?).

Note that we don't correctly read 32 bit images in any of these modes (even the ones we THOUGHT we did correctly before -- they were wrong). I'll tackle that as a separate PR, or perhaps amend this one if I really find the problem immediately, we'll see. It seems to be a byte swapping issue.

@lgritz
Copy link
Collaborator Author

lgritz commented Mar 19, 2017

Amended to fix 32 bit mode, mostly. Turns out 32 bit pixel channels are not uint32, they are actually float values (after endian swapping)!

I say "mostly" because there is some color space stuff to contemplate cleaning up. Seems that PhotoShop saves uint8 and uint16 images in sRGB (-ish?), whereas float images appeared to be saved as linear. I'm still looking into this matter, though. Nevertheless, what we do now (with this patch) is a whole lot less wrong than before.

@lgritz
Copy link
Collaborator Author

lgritz commented Mar 19, 2017

Fixes #1603

@lgritz lgritz force-pushed the lg-psdmultichan branch 2 times, most recently from c4c59ca to 0123a4e Compare March 21, 2017 18:08
…des.

Also support 32 bit RGB and grayscale. We thought we had 32 bit working
before, but we were wrong -- PhotoShop stores linear float for "32 bit",
not uint8 as we assumed.
@lgritz
Copy link
Collaborator Author

lgritz commented Mar 23, 2017

Another user waiting for this gave it a thorough testing and gives it a 👍

@lgritz lgritz merged commit 6da5107 into AcademySoftwareFoundation:master Mar 23, 2017
@lgritz lgritz deleted the lg-psdmultichan branch March 23, 2017 03:13
brechtvl added a commit to brechtvl/oiio that referenced this pull request Jan 9, 2023
Refactoring in AcademySoftwareFoundation#1641 caused this to be set on the last layer rather than the
composite image as before. Now set it on the composite image and every layer.
brechtvl added a commit to brechtvl/oiio that referenced this pull request Jan 9, 2023
Refactoring in AcademySoftwareFoundation#1641 incorrectly caused this to be set on the last layer
rather than the composite image as before. Now set it on the composite
image and every layer, as all of them use unassociated alpha.
brechtvl added a commit to brechtvl/oiio that referenced this pull request Jan 9, 2023
Refactoring in AcademySoftwareFoundation#1641 incorrectly caused this to be set on the last layer
rather than the composite image as before. Now set it on the composite
image and every layer, as all of them use unassociated alpha.
lgritz pushed a commit that referenced this pull request Jan 9, 2023
Refactoring in #1641 incorrectly caused this to be set on the last layer
rather than the composite image as before. Now set it on the composite
image and every layer, as all of them use unassociated alpha.
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Jan 12, 2023
…oundation#3750)

Refactoring in AcademySoftwareFoundation#1641 incorrectly caused this to be set on the last layer
rather than the composite image as before. Now set it on the composite
image and every layer, as all of them use unassociated alpha.
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 this pull request may close these issues.

1 participant