jimp-dev/jimp

Slightly faster version of resize2.js available

Open

#758 aperta il 6 lug 2019

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (785 fork)batch import
enhancementhelp wantedsolution in issue

Metriche repository

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

Descrizione

Rescaling with bilinear, bicubic, bezier and hermite interpolation is a bit slow. I'm using a copy of resize2.js in my own icon generator and refactored it. I inlined all functions which sometimes got called for every single pixel. This speeds up rescaling a bit. Feel free to use this version resize3.js which is otherwise identical to the original resize2.js (apart from the removal of the options parameter which was never used).

There is also resize4.js with an alternative bicubic implementation that is much faster. The limitation of this version is that source and target image must have the same width/height ratio.

Guida contributor