jimp-dev/jimp

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

オープン

#819 opened on 2019/11/21

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (785 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (13,218 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド