You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0eb1662
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,10 @@ Upgrading from 3.x? Upgrade to the latest 3.x release first, fix the deprecation
128
128
129
129
### Fixes
130
130
131
+
-**Cut-off JPEG and lossy WebP files throw** like the other formats: a JPEG without any scan data, or whose scan ends before its last block, and a WebP whose partitions end early. They decoded without an error, as gray or smeared images. A JPEG that only lacks its end marker still decodes.
132
+
-`Image.pixels()` yields the pixels the image had when the iteration started, where resizing the image meanwhile threw an error from the inside or stopped early.
133
+
-`Animation.decode()` gives a still image (PNG, JPEG XL, WebP, JPEG, ...) a frame of 100 ms, the `Frame` default, not 0 ms.
134
+
-`JSON.stringify()` and `console.log()` of an `Image`, `Frame` or `Animation` show their size (and duration), not every pixel; `new Colors()` throws.
131
135
-`image.composite(image, { x, y })` onto itself (or an image sharing its pixels) read pixels it had already overwritten, and differed from compositing a copy.
132
136
-`dominantColor({ threshold })` outside 0-256, `GainMap.encodeJPEG({ quality: 0 })` and a `metadata` that is not an object throw instead of being clamped or ignored.
133
137
-`Animation.resize()` changes a frame once when the animation lists the same `Frame` (or two frames share one `Image`) more than once, as a hold or a ping-pong does; each listing resized or moved it again before (`new Animation([f, f, f]).resize(50, 50)` made 13x13 frames).
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
**ImageScript** decodes, edits and encodes images in pure TypeScript: no WebAssembly, no native binaries, and no
17
17
runtime dependencies. It runs in Node.js 22.13+, Deno, Bun, browsers and edge runtimes (Cloudflare Workers, Vercel's
18
18
Edge Runtime, Deno Deploy), works with `import` and, on supported Node.js versions, `require()`, and ships with type
19
-
definitions (TypeScript 5.7 or newer: with older versions and `skipLibCheck`, the encoders' return types become `any`). Large AVIF and JPEG XL operations, and lossless WebP encoding, can use multiple CPU cores when the runtime
19
+
definitions (TypeScript 5.7 or newer; CommonJS projects with`module: nodenext` need 5.8 or newer to `import` it. With older versions and `skipLibCheck`, the encoders' return types become `any`). Large AVIF and JPEG XL operations, and lossless WebP encoding, can use multiple CPU cores when the runtime
* Encodes the image into a PNG, with the smallest lossless color type (a palette for up to 256 colors,
2664
-
* grayscale or RGB, alpha only if needed). Uses the runtime's native zlib when available
2673
+
* grayscale or RGB, alpha only if needed). Uses the runtime's native zlib when available (the files differ between runtimes, whose zlibs compress differently: about a quarter larger on Deno than on Node and Bun)
0 commit comments