Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 3.2.1

### Performance

- Resizing is 2-4 times faster for opaque images with bilinear and area resizing (halving a 1920×1080 photo: 15 instead
of 49 ms), and 20-40% faster otherwise: the arithmetic is integer, the vertical pass runs first, and for opaque
images two channels share a multiplication. Results differ from 3.2.0 by at most 1 per channel (more only in the
invisible color of pixels that are almost fully transparent).
- `clone()` is about 50% faster.

### Fixes

- Enlarging with `RESIZE_AREA` left transparent rows and columns where a pixel's center fell right on the edge of the
filter.

## 3.2.0

### New
Expand Down
7 changes: 5 additions & 2 deletions src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,11 @@ export class Image {
* Clones the current image
*/
clone(): Image {
const image = new Image(this.width, this.height);
image.bitmap.set(this.bitmap);
// copying in the constructor of the array saves zeroing the memory first
const image = new Image(1, 1);
image.__width__ = this.width;
image.__height__ = this.height;
image.__set_bitmap__(new Uint8ClampedArray(this.bitmap));
return image;
}

Expand Down
Loading
Loading