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

Cannot convert an image from greyscale+alpha #35

Open
mfiano opened this issue Jul 8, 2020 · 4 comments
Open

Cannot convert an image from greyscale+alpha #35

mfiano opened this issue Jul 8, 2020 · 4 comments

Comments

@mfiano
Copy link

mfiano commented Jul 8, 2020

This case form needs a greyscale+alpha case:

(etypecase image

@mfiano
Copy link
Author

mfiano commented Feb 3, 2021

@slyrus I think this was fixed by you correct? But before it's closed, I just realized you cannot do the inverse: convert an RGBA image to grayscale+alpha though. I just had to hack in some ugly code to handle this. There should be a way to do what (coerce-image image '8-bit-grayscale-image) does, except a method specialized on 8-bit-grayscale-alpha-image that copies in the alpha channel from the source image.

@slyrus
Copy link
Owner

slyrus commented Nov 21, 2021

Hmm... Ok, in theory I have this now. One problem is that the writing routines (tiff, jpg, etc...) don't seem to support grayscale-alpha yet (but that's a separate problem). The other issue is what to make the default alpha value if we're coercing from something that doesn't have an alpha channel?

@mfiano
Copy link
Author

mfiano commented Nov 22, 2021

I would signal a condition if it's not possible. I mostly only work with PNG, but for a portable image format library, I don't think you can do anything but signal and have the user handle the condition to their needs.

@slyrus
Copy link
Owner

slyrus commented Nov 22, 2021

Hmm... yes, that's probably a good idea. I added support for tiff, and jpeg just silently ignores the alpha channel - as it does for RGB. Could probably be improved.

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

No branches or pull requests

2 participants