lutgen-rs icon indicating copy to clipboard operation
lutgen-rs copied to clipboard

Ignoring fully transparent pixels

Open yavko opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'd like to use this to modify images to put in my wallpapers, that have transparent bgs

Describe the solution you'd like A clear and concise description of what you want to happen.

to not fill up transparent pixels, but to ignore them

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

maybe just a option for it

Additional context Add any other context or screenshots about the feature request here.

yavko avatar Jul 24 '23 17:07 yavko

Definitely agree, transparency should be handled properly, although I've been a bit undecided on how to handle it. I think the easiest way would be to always use an alpha layer when reading and writing images, and retain the previous alpha values when writing to the new image. The only issue with that, is that the output image sizes might inflate even more, especially for non-transparent images. Currently, lutgen just reads the image and converts it into an RGB type, not RGBA

ozwaldorf avatar Jul 24 '23 23:07 ozwaldorf

Check out https://github.com/ozwaldorf/lutgen-rs/tree/transparency

Or, to install the development branch:

cargo install lutgen --git https://github.com/ozwaldorf/lutgen-rs --branch transparency

ozwaldorf avatar Jul 31 '23 03:07 ozwaldorf

Transparency branch works great with icon themes, thanks. Would love to see it merged :+1:

donovanglover avatar Jan 03 '24 00:01 donovanglover

Transparency branch works great with icon themes, thanks. Would love to see it merged 👍

That's a great idea, what icon packs have you tried?

yavko avatar Jan 03 '24 06:01 yavko

https://github.com/vinceliuice/Fluent-icon-theme

Note: I converted svg to png first (svg panics as unsupported)

donovanglover avatar Jan 03 '24 15:01 donovanglover

How are you using lutgen to ignore transparent background? I ran the cargo install command stated above and ran

lutgen apply *.png -p catppuccin-mocha

But the transparent background gets replaced still.

Edit: Scratch that, found it:

lutgen apply *.png -p catppuccin-mocha --transparency

Jas-SinghFSU avatar Apr 13 '24 09:04 Jas-SinghFSU