Skip to content

React Native Image Compression Kit

Smaller images.
Before they upload.

Compress, resize, and convert local images on Android and iOS. Set a byte target, choose a metadata policy, and keep native work bounded.

npm install react-native-image-compression-kit
  • Android 23+
  • iOS 13.4+
  • Expo development builds

MIT licensed · TypeScript API · Native codecs

One recorded example

See the file size change.

A local JPEG, resized and compressed on Android.

Original JPEG1.72 MB4000 × 3000 px
Android output227 kB1600 × 1200 px

86.8% smaller filein this sample, including resizing

JPEG quality up to 90 · target 500 kB · metadata stripped

Recorded with a synthetic test image on native runtimes. Results vary by image and device. This page does not upload or compress your files.

Captured from the 0.4.1 source candidate. Published npm latest is 0.4.0.

Release status

npm latest: 0.4.0 · source candidate: 0.4.1. The published iOS renderer can vertically invert output pixels. The candidate fixes orientation and adds package-owned output cleanup. The example above is a recorded source-tree result, not a claim that those fixes are in npm. Review the release notes.

One request, a local output ​

ts
import { compressImage } from 'react-native-image-compression-kit';

async function compressLocalImage(localImageUri: string) {
  return compressImage({
    source: { uri: localImageUri },
    resize: { maxWidth: 1600, maxHeight: 1600, mode: 'contain' },
    output: { format: 'jpeg', quality: 82 },
    metadata: 'safe',
  });
}

Get back a cache URI, dimensions, and byte counts. Your source image stays unchanged. Install, rebuild, and handle the result.

Control the parts your app depends on ​

01 / Upload policy

Work toward a byte budget

Set a JPEG or WebP target with maxBytes. Check the returned size before upload; an unreachable target returns the smallest candidate.

02 / Native behavior

Ask the runtime first

Discover codecs and limits on the device. Decode downsampling, two-operation scheduling, and cancellation keep native work bounded.

03 / File lifecycle

Keep ownership explicit

Choose a metadata policy. Upload or preserve the new cache file, then remove the temporary output. Gallery sources are never deleted.

Find your next step ​

Your taskStart here
Add compression to an appQuick start
Compare native output or generate request codeInteractive demo
Decide whether this fits your pipelinePipeline selection guide
Estimate your own transfer and storage scenarioByte economics calculator
Check supported formats and framework versionsCapabilities · Compatibility

Open source, with a clear scope ​

MIT licensed and built around a small TypeScript API. The package processes local images on Android and iOS; it does not provide a picker, upload client, or browser codec. Expo requires a development build; Expo Go is unsupported.

Explore the architecture and roadmap, ask an integration question in Discussions, or follow the contribution guide to report a reproducible bug or improve the docs.

Native output claims are capability-driven and evidence-backed.