Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,25 @@ const path = await image.saveToTemporaryFileAsync('jpg', 50) // 50% compre
const compressed = await image.toEncodedImageData('jpg', 50) // 50% compression
```

#### HEIC/HEIF
#### Supported Formats

NitroImage supports `HEIC`/`HEIF` format if the host OS natively supports it.
NitroImage uses the host OS for decoding, so loading supports any format the platform does. Writing is limited to `jpg`, `png` and `heic`.

| | iOS | Android |
|--------------|----------------|----------------|
| Loading HEIC | ✅ | ✅ (>= SDK 28) |
| Writing HEIC | ✅ (>= iOS 17) | ❌ |
| | Loading (iOS) | Loading (Android) | Writing (iOS) | Writing (Android) |
|-------|---------------|-------------------|----------------|-------------------|
| JPEG | ✅ | ✅ | ✅ | ✅ |
| PNG | ✅ | ✅ | ✅ | ✅ |
| HEIC | ✅ | ✅ (>= SDK 28) | ✅ (>= iOS 17) | ❌ |
| WebP | ✅ | ✅ | ❌ | ❌ |
| GIF | ✅ | ✅ | ❌ | ❌ |
| BMP | ✅ | ✅ | ❌ | ❌ |
| TIFF | ✅ | ❌ | ❌ | ❌ |

Animated formats (GIF, WebP, APNG) decode to a single frame - `<NitroImage />` does not play animations.

For loading remote images, [react-native-nitro-web-image](https://www.npmjs.com/package/react-native-nitro-web-image) additionally supports AVIF via SDWebImage (iOS) and Coil (Android).

##### HEIC/HEIF

You can check whether your OS supports `HEIC` via NitroImage:

Expand Down