jimp-dev/jimp

Make resize() not remove rgb data when alpha = 0

Open

#819 geöffnet am 21. Nov. 2019

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (785 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (13.218 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Is your feature request related to a problem? Please describe. For my project, I'm editing textures for self illumination in a game, and I'm using jimp to resize the images for downloading speed. However, with self illumination, the shader in the game will use the alpha to determine the brightness of an object, not whether it shows or not.

Describe the solution you'd like I'd like resize() to by default, or to have an option to not remove the color data when alpha is 0, or treat the rgb channels and alpha channels seperately.

Describe alternatives you've considered I've considered doing this myself, by seperating the rgba data to rgb and a channels, and processing them twice in jimp and finally combining them back, however this seems to be something that should be supported in jimp natively.

Additional context I'm retrieving the rgba8888 data from vtflib.js and providing it to jimp via raw buffer. if you'd like an example rgba8888 buffer to test this on, I can provide.

Contributor Guide