Repository navigation
ImageScript 4.2.1 makes a few decoders and encoders faster. There are no API changes, and every image and file comes out exactly as in 4.2.0.
Faster decoding
- TIFF: 8- and 16-bit gray and RGB images in strips decode up to twice as fast: each strip is converted to RGBA straight from its data, and uncompressed strips aren't copied at all (a 4000x3000 uncompressed RGB image: 70 to 37 ms).
- PNG: 8-bit RGBA images decode about 9% faster and need a copy of the pixels less at the peak (a 4000x3000 image: 228 to 207 ms, 48 MB less).
Faster encoding
- GIF: up to 20% faster, and animations of small frames several times faster: the encoder's 2 MB dictionary is made once instead of being cleared in full for every frame (101 frames of 300x300: 140 to 114 ms; 80 frames of 64x48: 26 to 5 ms).
- PNG and APNG: 8 to 9% faster for images of 2 MiB of data and more under Node.js, Bun and Deno: rows are filtered while the piece before is being compressed (a 2400x2400 photo: 170 to 156 ms).
- JPEG with transparency: about 5% faster for images with translucent pixels: the blend onto the background is worked out once per alpha value instead of once per pixel.
The changelog has the details.