jimp-dev / jimp-dev/jimp

Slightly faster version of resize2.js available

Open
#758 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted solution in issue
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/idesis-gmbh/png2icons) 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`](https://github.com/idesis-gmbh/png2icons/blob/master/lib/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`](https://github.com/idesis-gmbh/png2icons/blob/master/lib/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.