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

Alpha Channels #16

Open
micahalhadeff opened this issue Aug 20, 2022 · 9 comments
Open

Alpha Channels #16

micahalhadeff opened this issue Aug 20, 2022 · 9 comments

Comments

@micahalhadeff
Copy link

Hello,

I was wondering if any of the scripts can include images with alpha channels? Amazing scripts!

@genmeblog
Copy link
Collaborator

Hi! Thanks! Definitely some of the can include processing an alpha channel with some code change. Any specific script?

@micahalhadeff
Copy link
Author

I would love to be able to use the png glitch script with images that contain an alpha channel :) but I don't want the whole image to have a 90% opacity for example, I am looking for an option that basically retains the original alpha channel areas if that makes sense.

@genmeblog
Copy link
Collaborator

I haven't verified it yet but you can try to replace this line:

https://github.com/tsulej/GenerateMe/blob/master/pngglitch/pngglitch.pde#L107

with

         color c = ImageLineHelper.getPixelARGB8(line,y);

It should retain (not affected by glitches) alpha channel.

@micahalhadeff
Copy link
Author

I replaced it, but it still saves with a black opaque background.

@genmeblog
Copy link
Collaborator

Ah, I see. Remove the line which sets black background, here:

buffer.background(0);

(Currently I have no access to pc to verify this).

@micahalhadeff
Copy link
Author

Fantastic it works!! Although it does produce some noise around the alpha area in some places, Is there a way to get rid of that?

@genmeblog
Copy link
Collaborator

Good! Regarding noise, all glitches are on the codec side, so I don't know what to do to get rid of them.

@micahalhadeff
Copy link
Author

All good, if I decrease the file size it gets rid of the noise. Thank you so much for your help!!

@micahalhadeff
Copy link
Author

micahalhadeff commented Oct 11, 2022 via email

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