# @uppy/compressor

> Uppy plugin that compresses images before upload, saving up to 60% in size

Latest version **4.0.0** (published 2026-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @uppy/compressor
pnpm add @uppy/compressor
yarn add @uppy/compressor
bun add @uppy/compressor
```

## Health

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

Positive: esm support; no vulnerabilities; recently updated; high maintenance score; popular repo.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-08-26 |
| First published | 2022-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 3 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30991 |
| Maintainers | kvz, tim-kos, mifi, uppydev |
| Keywords | file uploader, uppy, uppy-plugin, compress, image compression |

## Links

- npm: https://www.npmjs.com/package/@uppy/compressor
- Repository: https://github.com/transloadit/uppy
- Homepage: https://uppy.io
- Issues: https://github.com/transloadit/uppy/issues
- npm.io page: https://npm.io/package/@uppy/compressor

## Dependencies (3)

- [preact](https://npm.io/package/preact.md) ^10.29.2
- [compressorjs](https://npm.io/package/compressorjs.md) ^1.3.0
- [@transloadit/prettier-bytes](https://npm.io/package/@transloadit/prettier-bytes.md) ^2.0.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-08-26
- 2.0.0-beta.8 (next) — 2024-05-22
- 3.1.0 — 2025-12-02
- 3.0.2 — 2025-10-17
- 3.0.1 — 2025-09-16
- 3.0.0 — 2025-08-22
- 2.3.2 — 2025-08-01
- 2.3.1 — 2025-07-29
- 2.3.0 — 2025-07-29
- 2.2.1 — 2025-01-09
- 2.2.0 — 2025-01-06
- 2.1.1 — 2024-12-05
- 2.1.0 — 2024-08-29
- 2.0.1 — 2024-07-30
- 2.0.0 — 2024-07-10
- … 30 more at https://npm.io/package/@uppy/compressor/versions

## README

# @uppy/compressor

<img src="https://uppy.io/img/logo.svg" width="120" alt="Uppy logo: a smiling puppy above a pink upwards arrow" align="right">

<a href="https://www.npmjs.com/package/@uppy/compressor"><img src="https://img.shields.io/npm/v/@uppy/compressor.svg?style=flat-square"></a>
<img src="https://github.com/transloadit/uppy/workflows/Tests/badge.svg" alt="CI status for Uppy tests">
<img src="https://github.com/transloadit/uppy/workflows/Companion/badge.svg" alt="CI status for Companion tests">
<img src="https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg" alt="CI status for browser tests">

The Compressor plugin for Uppy optimizes images (JPEG, PNG, WEBP), saving on
average up to 60% in size (roughly 18 MB for 10 images). It uses
[Compressor.js](https://github.com/fengyuanchen/compressorjs).

Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
a versatile file encoding service.

## Example

```js
import Uppy from '@uppy/core'
import Compressor from '@uppy/compressor'

const uppy = new Uppy()
uppy.use(Compressor)
```

## Installation

```bash
npm install @uppy/compressor
```

We recommend installing from yarn or npm, and then using a module bundler such
as [Parcel](https://parceljs.org/), [Vite](https://vitejs.dev/) or
[Webpack](https://webpack.js.org/).

Alternatively, you can also use this plugin in a pre-built bundle from
Transloadit’s CDN: Smart CDN. In that case `Uppy` will attach itself to the
global `window.Uppy` object. See the
[main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.

## Documentation

Documentation for this plugin can be found on the
[Uppy website](https://uppy.io/docs/compressor).

## License

[The MIT License](./LICENSE).

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