GenerateMe icon indicating copy to clipboard operation
GenerateMe copied to clipboard

Alpha Channels

Open micahalhadeff opened this issue 2 years ago • 9 comments

Hello,

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

micahalhadeff avatar Aug 20 '22 04:08 micahalhadeff

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

genmeblog avatar Aug 23 '22 08:08 genmeblog

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.

micahalhadeff avatar Aug 23 '22 20:08 micahalhadeff

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.

genmeblog avatar Aug 23 '22 22:08 genmeblog

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

micahalhadeff avatar Aug 24 '22 00:08 micahalhadeff

Ah, I see. Remove the line which sets black background, here: https://github.com/tsulej/GenerateMe/blob/29d60da0f3638515752333079277276e7bc2aa6d/pngglitch/pngglitch.pde#L63

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

genmeblog avatar Aug 24 '22 08:08 genmeblog

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?

micahalhadeff avatar Aug 24 '22 17:08 micahalhadeff

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

genmeblog avatar Aug 24 '22 17:08 genmeblog

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

micahalhadeff avatar Aug 24 '22 17:08 micahalhadeff

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.

On Tue, Aug 23, 2022 at 4:47 AM genmeblog @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/tsulej/GenerateMe/issues/16#issuecomment-1223756024, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATRUJIBNMUELMXXSOAUGOZ3V2SFZHANCNFSM57CR4HFA . You are receiving this because you authored the thread.Message ID: @.***>

micahalhadeff avatar Oct 11 '22 08:10 micahalhadeff