jimp-dev/jimp

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

Open

#819 aperta il 21 nov 2019

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (785 fork)batch import
bughelp wanted

Metriche repository

Star
 (13.218 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor