# imagescript

> Pure TypeScript image processing that runs everywhere

Latest version **3.13.1** (published 2026-10-31) · (AGPL-3.0-or-later OR MIT) license · 0 weekly downloads

## Install

```sh
npm install imagescript
pnpm add imagescript
yarn add imagescript
bun add imagescript
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.13.1 |
| Published | 2026-10-31 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | (AGPL-3.0-or-later OR MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.13.0 |
| Dependencies | 0 |
| Unpacked size | 2.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 680 |
| Author | Mathis Mensing |
| Maintainers | matmen |
| Keywords | image, image processing, image manipulation, typescript, zero-dependency, browser, deno, bun, edge, cloudflare-workers, serverless, png, jpeg, jpg, scale, resize, crop, svg, bitmap, gif, picture, thumbnail, webp, avif, av1, jxl, jpeg xl, apng, tiff, tga, bmp, ico, cur, qoi, netpbm, ppm, pgm, pbm, pam, pfm, hdr, radiance, animation, text rendering, font |

## Links

- npm: https://www.npmjs.com/package/imagescript
- Repository: https://github.com/imagescript/ImageScript
- Homepage: https://imagescript.dev/
- Issues: https://github.com/imagescript/ImageScript/issues
- npm.io page: https://npm.io/package/imagescript

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 3.13.1 (latest) — 2026-10-31
- 3.13.0 — 2026-10-31
- 3.12.2 — 2026-10-31
- 3.12.1 — 2026-10-30
- 3.12.0 — 2026-10-30
- 3.11.0 — 2026-10-30
- 3.10.0 — 2026-10-30
- 3.9.0 — 2026-10-29
- 3.8.1 — 2026-10-28
- 3.8.0 — 2026-10-28
- 3.7.0 — 2026-10-26
- 3.6.0 — 2026-10-25
- 3.5.0 — 2026-10-25
- 3.4.0 — 2026-10-25
- 3.3.0 — 2026-10-17
- … 49 more at https://npm.io/package/imagescript/versions

## README

<h1 align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/imagescript/ImageScript/master/media/wordmark-tagline-dark.svg">
    <img alt="ImageScript: Pure TypeScript image processing that runs everywhere" src="https://raw.githubusercontent.com/imagescript/ImageScript/master/media/wordmark-tagline.svg" width="640">
  </picture>
</h1>

[![Discord Server](https://img.shields.io/discord/691713541262147687.svg?label=Discord&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=for-the-badge)](https://discord.gg/8hPrwAH)
[![Documentation](https://img.shields.io/badge/Documentation-informational?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJJbWFnZVNjcmlwdCI+PHRpdGxlPkltYWdlU2NyaXB0PC90aXRsZT48cGF0aCBkPSJNMTMyIDk2aC0xNGEzNCAzNCAwIDAgMC0zNCAzNHY3NGEzMCAzMCAwIDAgMS0zMCAzMGgtNnY0NGg2YTMwIDMwIDAgMCAxIDMwIDMwdjc0YTM0IDM0IDAgMCAwIDM0IDM0aDE0IE0zODAgOTZoMTRhMzQgMzQgMCAwIDEgMzQgMzR2NzRhMzAgMzAgMCAwIDAgMzAgMzBoNnY0NGgtNmEzMCAzMCAwIDAgMC0zMCAzMHY3NGEzNCAzN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![NPM](https://nodei.co/npm/imagescript.png)](https://www.npmjs.com/package/imagescript)

---

**ImageScript** decodes, edits and encodes images in pure TypeScript: no WebAssembly, no native binaries, no
dependencies. It runs in Node.js 22.13+, Deno, Bun, browsers and edge runtimes (Cloudflare Workers, Vercel's Edge
Runtime, Deno Deploy), works with both `import` and `require()`, and ships with type definitions. Large images are
encoded and decoded on several threads wherever the runtime supports workers.

```sh
npm install imagescript              # Node.js, Bun and bundlers
deno add jsr:@matmen/imagescript     # Deno
```

---

### Example

```js
import { Image } from 'imagescript';
import { readFile, writeFile } from 'node:fs/promises';

const image = await Image.decode(await readFile('input.jpg'));
image.resize(256, Image.RESIZE_AUTO).roundCorners(16);
await writeFile('output.png', await image.encode());
```

Coordinates start at `(0, 0)`, the top left pixel. For a bigger example, see the
[script that generates this image](https://github.com/imagescript/ImageScript/blob/master/tests/readme.js):

[![Example](https://github.com/imagescript/ImageScript/raw/master/tests/targets/readme.png)](https://github.com/imagescript/ImageScript/blob/master/tests/readme.js)

---

### Features

| Format | Decode | Encode |
|---|---|---|
| PNG | ✓ | ✓ |
| JPEG | ✓ | ✓ |
| WebP | ✓ | ✓ (lossless and lossy) |
| AVIF | ✓ | ✓ (lossless and lossy) |
| JPEG XL | ✓ | ✓ (lossless and lossy) |
| GIF, APNG (animations) | ✓ | ✓ |
| BMP, QOI, TGA, Netpbm | ✓ | ✓ |
| TIFF, ICO/CUR, Radiance HDR | ✓ | |

[Animations](https://imagescript.dev/classes/Animation.html) can be decoded from GIF, APNG, WebP and JPEG XL,
and encoded as GIF, APNG or WebP, all at once or
[frame by frame](https://imagescript.dev/classes/Animation.html#webpencoder). Embedded color profiles (Display
P3, Adobe RGB, ...) are converted to sRGB when decoding, so images look the way browsers show them.

- [Text rendering](https://imagescript.dev/classes/Image.html#rendertext) with TrueType, OpenType and WOFF fonts:
  all scripts, color emoji, variable fonts
- [SVG rendering](https://imagescript.dev/classes/Image.html#rendersvg), including text (with fonts you pass
  or fonts embedded in the SVG)
- [Resizing](https://imagescript.dev/classes/Image.html#resize),
  [cropping](https://imagescript.dev/classes/Image.html#crop),
  [rotating](https://imagescript.dev/classes/Image.html#rotate),
  [trimming](https://imagescript.dev/classes/Image.html#trim),
  [rounded corners](https://imagescript.dev/classes/Image.html#roundcorners), ...
- [Compositing](https://imagescript.dev/classes/Image.html#composite) with opacity and blend modes
- Filters and color adjustments: [blur](https://imagescript.dev/classes/Image.html#blur),
  [sharpen](https://imagescript.dev/classes/Image.html#sharpen),
  [brightness](https://imagescript.dev/classes/Image.html#brightness),
  [hueShift](https://imagescript.dev/classes/Image.html#hueshift), ...

The [documentation](https://imagescript.dev/) covers the full API. When upgrading from an older major version,
see the [changelog](https://github.com/imagescript/ImageScript/blob/master/CHANGELOG.md). [bench/](bench/README.md)
compares ImageScript's speed and file sizes with Jimp, sharp and other libraries.

---

### Credits

ImageScript builds on [fflate](https://github.com/101arrowz/fflate), libjpeg, [pdf.js](https://github.com/mozilla/pdf.js),
[font-rs](https://github.com/raphlinus/font-rs), [libwebp](https://chromium.googlesource.com/webm/libwebp),
[HarfBuzz](https://github.com/harfbuzz/harfbuzz), [dav1d](https://code.videolan.org/videolan/dav1d),
[libavif](https://github.com/AOMediaCodec/libavif), libaom, [jxl-oxide](https://github.com/tirr-c/jxl-oxide) and
[libjxl](https://github.com/libjxl/libjxl). The TrueType hinting follows [FreeType](https://freetype.org): portions of
this software are copyright © 2026 The FreeType Project (www.freetype.org). All rights reserved. See
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the licenses.

---

Questions? Join the [Discord server](https://discord.gg/8hPrwAH).

---
_Source: https://npm.io/package/imagescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
