jimp-dev/jimp

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

Open

#819 ouverte le 21 nov. 2019

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (785 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (13 218 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur