---
description: Capacitor plugin for headless image transforms — crop, resize, rotate, flip and format conversion, including HEIC to JPEG. Supports Android, iOS, and the web.
title: Capacitor Photo Manipulator Plugin - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/photo-manipulator.png
---

<!doctype html> 

[Skip to content ](#capacitor-photo-manipulator-plugin) 

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* Photo Manipulator [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ iOS ](#ios)
* [ Web ](#web)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Format Support ](#format-support)
* [ Memory ](#memory)
* [ Metadata ](#metadata)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ iOS ](#ios)
* [ Web ](#web)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Enums ](#enums)
* [ Format Support ](#format-support)
* [ Memory ](#memory)
* [ Metadata ](#metadata)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)

# Capacitor Photo Manipulator Plugin[¶](#capacitor-photo-manipulator-plugin "Permanent link")

Capacitor plugin for headless image transforms like crop, resize, rotate, flip and format conversion, including HEIC to JPEG.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

* 🖼️ **Headless Transforms**: Crop, resize, rotate and flip images from code, without any UI.
* 🔄 **HEIC to JPEG**: Convert HEIC and AVIF photos to JPEG, PNG or WebP with the native platform decoders. No WASM blobs, no WebView memory spikes.
* 📐 **Upright Output**: The EXIF orientation is applied during decoding so the output is always upright.
* 🧠 **Memory Efficient**: Bounds-aware downsampled decoding, so full-resolution bitmaps are never loaded when resizing.
* 🕵️ **Privacy Friendly**: All metadata (e.g. EXIF, GPS) is stripped from the output by re-encoding.
* 📂 **File Output**: Results are written to files, so even large images don't exhaust memory.
* ℹ️ **Image Info**: Read the dimensions and format of an image without decoding the pixel data.
* 🤝 **Compatibility**: Works alongside the [Photo Editor](https://capawesome.io/docs/sdks/capacitor/photo-editor/), [Exif](https://capawesome.io/docs/sdks/capacitor/exif/) and [File Compressor](https://capawesome.io/docs/sdks/capacitor/file-compressor/) plugins.
* 🔒 **App Store safe**: Uses only official platform APIs.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Use Cases[¶](#use-cases "Permanent link")

The Photo Manipulator plugin is typically used whenever an app needs to process images from code, without any UI, for example:

* **HEIC to JPEG conversion**: Convert photos taken on an iPhone to JPEG before uploading them, so servers and browsers can display them.
* **Thumbnail generation**: Crop and resize images to small previews with memory-efficient downsampled decoding.
* **Upload size reduction**: Resize images and re-encode them with a lower `quality` before uploading them to a server.
* **Privacy-safe sharing**: Share images without metadata, since all metadata (e.g. EXIF, GPS) is stripped from the output by re-encoding.
* **Orientation fixes**: Produce upright images, since the EXIF orientation is applied during decoding.

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 0.x.x          | \>=8.x.x          | Active support |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-photo-manipulator` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-photo-manipulator
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

This plugin will use the following project variables (defined in your app's `variables.gradle` file):

* `$androidxExifInterfaceVersion` version of `androidx.exifinterface:exifinterface` (default: `1.4.1`)

### iOS[¶](#ios "Permanent link")

On iOS, this plugin uses the [Image I/O](https://developer.apple.com/documentation/imageio) and [Core Graphics](https://developer.apple.com/documentation/coregraphics) frameworks. No additional configuration is required.

### Web[¶](#web "Permanent link")

This plugin provides a partial web implementation based on the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas%5FAPI). HEIC and AVIF images can not be decoded by most browsers, which is exactly why the native implementations exist (see [Format Support](#format-support)).

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

The following examples show how to convert an image to another format, create a thumbnail, and read the dimensions and format of an image.

The transformed image is written to a new file in the cache directory and deleted on the next app launch. Move it to a permanent location if you want to keep it, for example with the `rename(...)` method of the [Filesystem](https://capacitorjs.com/docs/apis/filesystem) plugin.

### Convert a HEIC image to JPEG[¶](#convert-a-heic-image-to-jpeg "Permanent link")

Use the `format` option of the `transform(...)` method to convert an image to another format, for example a HEIC photo taken on an iPhone to JPEG. The `quality` option controls the compression of the output file:

`[](#%5F%5Fcodelineno-3-1)import { PhotoManipulator, ImageFormat } from '@capawesome/capacitor-photo-manipulator';
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const convertHeicToJpeg = async () => {
[](#%5F%5Fcodelineno-3-4)  // Convert an HEIC photo (e.g. taken on an iPhone) to JPEG
[](#%5F%5Fcodelineno-3-5)  const { path } = await PhotoManipulator.transform({
[](#%5F%5Fcodelineno-3-6)    path: 'file:///var/mobile/.../photo.heic',
[](#%5F%5Fcodelineno-3-7)    format: ImageFormat.Jpeg,
[](#%5F%5Fcodelineno-3-8)    quality: 0.9,
[](#%5F%5Fcodelineno-3-9)  });
[](#%5F%5Fcodelineno-3-10)  return path;
[](#%5F%5Fcodelineno-3-11)};
`

### Create a thumbnail[¶](#create-a-thumbnail "Permanent link")

Combine the `crop`, `resize`, `rotate` and flip options in a single call. The operations are always applied in the fixed order crop → resize → rotate → flip:

`[](#%5F%5Fcodelineno-4-1)import { PhotoManipulator } from '@capawesome/capacitor-photo-manipulator';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const createThumbnail = async () => {
[](#%5F%5Fcodelineno-4-4)  // Crop, resize, rotate and flip in one call
[](#%5F%5Fcodelineno-4-5)  const { path, width, height } = await PhotoManipulator.transform({
[](#%5F%5Fcodelineno-4-6)    path: 'file:///var/mobile/.../photo.jpeg',
[](#%5F%5Fcodelineno-4-7)    crop: { x: 100, y: 100, width: 1080, height: 1080 },
[](#%5F%5Fcodelineno-4-8)    resize: { width: 256 },
[](#%5F%5Fcodelineno-4-9)    rotate: 90,
[](#%5F%5Fcodelineno-4-10)    flipHorizontal: true,
[](#%5F%5Fcodelineno-4-11)  });
[](#%5F%5Fcodelineno-4-12)  return { path, width, height };
[](#%5F%5Fcodelineno-4-13)};
`

### Read the dimensions and format of an image[¶](#read-the-dimensions-and-format-of-an-image "Permanent link")

Use the `getInfo(...)` method to read the dimensions and format of an image without decoding the pixel data where possible:

`[](#%5F%5Fcodelineno-5-1)import { PhotoManipulator } from '@capawesome/capacitor-photo-manipulator';
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)const getInfo = async () => {
[](#%5F%5Fcodelineno-5-4)  const { width, height, format } = await PhotoManipulator.getInfo({
[](#%5F%5Fcodelineno-5-5)    path: 'file:///var/mobile/.../photo.heic',
[](#%5F%5Fcodelineno-5-6)  });
[](#%5F%5Fcodelineno-5-7)  return { width, height, format };
[](#%5F%5Fcodelineno-5-8)};
`

## API[¶](#api "Permanent link")

* [getInfo(...)](#getinfo)
* [transform(...)](#transform)
* [Interfaces](#interfaces)
* [Enums](#enums)

### getInfo(...)[¶](#getinfo "Permanent link")

`[](#%5F%5Fcodelineno-6-1)getInfo(options: GetInfoOptions) => Promise<GetInfoResult>
`

Get the dimensions and format of an image without decoding the pixel data where possible.

| Param       | Type                              |
| ----------- | --------------------------------- |
| **options** | [GetInfoOptions](#getinfooptions) |

**Returns:** `Promise<[GetInfoResult](#getinforesult)>`

**Since:** 0.1.0

---

### transform(...)[¶](#transform "Permanent link")

`[](#%5F%5Fcodelineno-7-1)transform(options: TransformOptions) => Promise<TransformResult>
`

Apply one or more transformations to an image and write the result to a new file.

The operations are always applied in the following fixed order: crop → resize → rotate → flip. Chain multiple calls if you need a different order.

The EXIF orientation of the source image is applied during decoding so that the output is always upright. All other metadata (e.g. EXIF, GPS) is stripped by re-encoding.

| Param       | Type                                  |
| ----------- | ------------------------------------- |
| **options** | [TransformOptions](#transformoptions) |

**Returns:** `Promise<[TransformResult](#transformresult)>`

**Since:** 0.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### GetInfoResult[¶](#getinforesult "Permanent link")

| Prop       | Type           | Description                                                                                                                                                                                                                          | Since |
| ---------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| **format** | string \| null | The format of the image or null if the format could not be determined. The value is provided by the platform decoder and may differ slightly between platforms for the same file (e.g. heic on iOS and the web but heif on Android). | 0.1.0 |
| **height** | number         | The height of the image in pixels after the EXIF orientation has been applied.                                                                                                                                                       | 0.1.0 |
| **width**  | number         | The width of the image in pixels after the EXIF orientation has been applied.                                                                                                                                                        | 0.1.0 |

#### GetInfoOptions[¶](#getinfooptions "Permanent link")

| Prop     | Type   | Description                                                                                                                                                                     | Since |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **path** | string | The path of the image file. On Android and iOS, only local file paths and file:// URIs are supported. On the web, any fetchable URL (e.g. https://, blob:, data:) is supported. | 0.1.0 |

#### TransformResult[¶](#transformresult "Permanent link")

| Prop       | Type   | Description                                                                                                                                                                                                                              | Since |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **height** | number | The height of the transformed image in pixels.                                                                                                                                                                                           | 0.1.0 |
| **path**   | string | The path of the transformed image file. On Android and iOS, the file is stored in the cache directory and deleted on the next app launch. Move it to a permanent location if you want to keep it. On the web, the path is an object URL. | 0.1.0 |
| **width**  | number | The width of the transformed image in pixels.                                                                                                                                                                                            | 0.1.0 |

#### TransformOptions[¶](#transformoptions "Permanent link")

| Prop               | Type                            | Description                                                                                                                                                                                  | Default          | Since |
| ------------------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----- |
| **crop**           | [CropOptions](#cropoptions)     | The region of the source image to crop to, in source pixels. The region must be within the bounds of the source image.                                                                       |                  | 0.1.0 |
| **flipHorizontal** | boolean                         | Whether or not to flip the image horizontally.                                                                                                                                               | false            | 0.1.0 |
| **flipVertical**   | boolean                         | Whether or not to flip the image vertically.                                                                                                                                                 | false            | 0.1.0 |
| **format**         | [ImageFormat](#imageformat)     | The format of the output file. On iOS, [ImageFormat.Webp](#imageformat) is not supported and rejects with the UNSUPPORTED\_FORMAT error code.                                                | ImageFormat.Jpeg | 0.1.0 |
| **path**           | string                          | The path of the image file to transform. On Android and iOS, only local file paths and file:// URIs are supported. On the web, any fetchable URL (e.g. https://, blob:, data:) is supported. |                  | 0.1.0 |
| **quality**        | number                          | The quality of the output file between 0 and 1. Only applied when format is [ImageFormat.Jpeg](#imageformat) or [ImageFormat.Webp](#imageformat).                                            | 0.9              | 0.1.0 |
| **resize**         | [ResizeOptions](#resizeoptions) | The target size to resize the image to, in pixels. If only one of width and height is provided, the aspect ratio is preserved. The resize is applied after the crop.                         |                  | 0.1.0 |
| **rotate**         | number                          | The clockwise angle to rotate the image by, in degrees. Must be 90, 180 or 270.                                                                                                              | 0                | 0.1.0 |

#### CropOptions[¶](#cropoptions "Permanent link")

| Prop       | Type   | Description                                                                                          | Since |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------- | ----- |
| **height** | number | The height of the crop region in pixels.                                                             | 0.1.0 |
| **width**  | number | The width of the crop region in pixels.                                                              | 0.1.0 |
| **x**      | number | The horizontal offset of the crop region in pixels, measured from the left edge of the source image. | 0.1.0 |
| **y**      | number | The vertical offset of the crop region in pixels, measured from the top edge of the source image.    | 0.1.0 |

#### ResizeOptions[¶](#resizeoptions "Permanent link")

| Prop       | Type   | Description                                                                                              | Since |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------- | ----- |
| **height** | number | The target height in pixels. If only one of width and height is provided, the aspect ratio is preserved. | 0.1.0 |
| **width**  | number | The target width in pixels. If only one of width and height is provided, the aspect ratio is preserved.  | 0.1.0 |

### Enums[¶](#enums "Permanent link")

#### ImageFormat[¶](#imageformat "Permanent link")

| Members  | Value  | Description                                           | Since |
| -------- | ------ | ----------------------------------------------------- | ----- |
| **Jpeg** | 'JPEG' | JPEG (image/jpeg).                                    | 0.1.0 |
| **Png**  | 'PNG'  | PNG (image/png).                                      | 0.1.0 |
| **Webp** | 'WEBP' | WebP (image/webp). Only available on Android and Web. | 0.1.0 |

## Format Support[¶](#format-support "Permanent link")

The formats an image can be decoded from and encoded to depend on the platform:

### Input (Decode)[¶](#input-decode "Permanent link")

| Format    | Android         | iOS         | Web               |
| --------- | --------------- | ----------- | ----------------- |
| JPEG      | ✅               | ✅           | ✅                 |
| PNG       | ✅               | ✅           | ✅                 |
| WebP      | ✅               | ✅           | ✅                 |
| GIF       | ✅               | ✅           | ✅                 |
| BMP       | ✅               | ✅           | ✅                 |
| HEIC/HEIF | ✅ (Android 9+)  | ✅           | ❌                 |
| AVIF      | ✅ (Android 12+) | ✅ (iOS 16+) | Browser-dependent |

### Output (Encode)[¶](#output-encode "Permanent link")

| Format | Android | iOS | Web               |
| ------ | ------- | --- | ----------------- |
| JPEG   | ✅       | ✅   | ✅                 |
| PNG    | ✅       | ✅   | ✅                 |
| WebP   | ✅       | ❌   | Browser-dependent |

If an image can not be decoded or encoded on the current platform, the call is rejected with the `UNSUPPORTED_FORMAT` error code so you can fall back gracefully.

## Memory[¶](#memory "Permanent link")

This plugin is designed to keep the memory footprint low, even for very large images:

* When a `resize` target is provided, the image is decoded downsampled (using `inSampleSize` on Android and `kCGImageSourceThumbnailMaxPixelSize` on iOS) so the full-resolution bitmap is never loaded into memory.
* Transforms are processed one at a time on a background queue.
* The result is written to a file instead of being returned as base64 data.

For the smallest possible memory footprint, always provide a `resize` target if you don't need the full resolution.

## Metadata[¶](#metadata "Permanent link")

The EXIF orientation of the source image is applied during decoding so that the output is always upright. All other metadata (e.g. EXIF, GPS) is stripped by re-encoding. Use the [Exif](https://capawesome.io/docs/sdks/capacitor/exif/) plugin if you want to read the metadata of the source image and write it back to the transformed image.

## FAQ[¶](#faq "Permanent link")

### How is this plugin different from other similar plugins?[¶](#how-is-this-plugin-different-from-other-similar-plugins "Permanent link")

It performs headless image transforms — crop, resize, rotate, flip and format conversion, including HEIC and AVIF to JPEG, PNG or WebP — using the native platform decoders, with no UI and no WebView memory spikes. It decodes bounds-aware and downsampled so full-resolution bitmaps are never loaded when resizing, applies the EXIF orientation for always-upright output, writes results to files, and strips metadata on re-encode for privacy-safe sharing. It works on Android, iOS and the Web, uses only official platform APIs, and is fully typed and kept current with the latest Capacitor version.

### In which order are the transformations applied?[¶](#in-which-order-are-the-transformations-applied "Permanent link")

The operations are always applied in the following fixed order: crop → resize → rotate → flip. If you need a different order, chain multiple `transform(...)` calls, passing the output path of one call as the input path of the next.

### Why does the transformed image disappear after an app restart?[¶](#why-does-the-transformed-image-disappear-after-an-app-restart "Permanent link")

On Android and iOS, the transformed image is written to a new file in the cache directory and deleted on the next app launch. Move it to a permanent location if you want to keep it, for example with the `rename(...)` method of the official [Filesystem](https://capacitorjs.com/docs/apis/filesystem) plugin.

### Does the plugin preserve the EXIF metadata of the source image?[¶](#does-the-plugin-preserve-the-exif-metadata-of-the-source-image "Permanent link")

No, the EXIF orientation is applied during decoding so that the output is always upright, and all other metadata (e.g. EXIF, GPS) is stripped from the output by re-encoding. This is privacy-friendly by default. If you want to keep the metadata, use the [Exif](https://capawesome.io/docs/sdks/capacitor/exif/) plugin to read it from the source image and write it back to the transformed image.

### Why does converting to WebP fail on iOS?[¶](#why-does-converting-to-webp-fail-on-ios "Permanent link")

On iOS, `ImageFormat.Webp` is not supported as an output format and the call rejects with the `UNSUPPORTED_FORMAT` error code. WebP output is only available on Android and the Web. Use `ImageFormat.Jpeg` or `ImageFormat.Png` as a cross-platform alternative.

### Why can't I convert HEIC or AVIF images on the Web?[¶](#why-cant-i-convert-heic-or-avif-images-on-the-web "Permanent link")

The web implementation is based on the Canvas API, and most browsers cannot decode HEIC and AVIF images. This is exactly why the native implementations exist: on Android (9+ for HEIC/HEIF, 12+ for AVIF) and iOS (16+ for AVIF), the plugin uses the native platform decoders. See the [Format Support](#format-support) section for the complete overview.

### How does the plugin handle very large images?[¶](#how-does-the-plugin-handle-very-large-images "Permanent link")

The plugin is designed to keep the memory footprint low. When a `resize` target is provided, the image is decoded downsampled so the full-resolution bitmap is never loaded into memory, transforms are processed one at a time on a background queue, and the result is written to a file instead of being returned as base64 data. For the smallest possible memory footprint, always provide a `resize` target if you don't need the full resolution.

## Related Plugins[¶](#related-plugins "Permanent link")

* [Photo Editor](https://capawesome.io/docs/sdks/capacitor/photo-editor/): Let the user edit a photo in an installed photo editing app.
* [Exif](https://capawesome.io/docs/sdks/capacitor/exif/): Read, write and remove EXIF metadata from image files.
* [File Compressor](https://capawesome.io/docs/sdks/capacitor/file-compressor/): Compress files with support for image formats like PNG, JPEG, and WebP.
* [File Picker](https://capawesome.io/docs/sdks/capacitor/file-picker/): Let the user select the images to transform from the gallery or file system.

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/photo-manipulator/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/photo-manipulator/LICENSE).

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/#article", "headline": "Capacitor Photo Manipulator Plugin", "name": "Capacitor Photo Manipulator Plugin", "description": "Capacitor plugin for headless image transforms — crop, resize, rotate, flip and format conversion, including HEIC to JPEG. Supports Android, iOS, and the web.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/#software", "name": "Capacitor Photo Manipulator Plugin", "description": "Capacitor plugin for headless image transforms — crop, resize, rotate, flip and format conversion, including HEIC to JPEG. Supports Android, iOS, and the web.", "url": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "How is this plugin different from other similar plugins?", "acceptedAnswer": {"@type": "Answer", "text": "It performs headless image transforms — crop, resize, rotate, flip and format conversion, including HEIC and AVIF to JPEG, PNG or WebP — using the native platform decoders, with no UI and no WebView memory spikes. It decodes bounds-aware and downsampled so full-resolution bitmaps are never loaded when resizing, applies the EXIF orientation for always-upright output, writes results to files, and strips metadata on re-encode for privacy-safe sharing. It works on Android, iOS and the Web, uses only official platform APIs, and is fully typed and kept current with the latest Capacitor version."}}, {"@type": "Question", "name": "In which order are the transformations applied?", "acceptedAnswer": {"@type": "Answer", "text": "The operations are always applied in the following fixed order: crop → resize → rotate → flip. If you need a different order, chain multiple transform(...) calls, passing the output path of one call as the input path of the next."}}, {"@type": "Question", "name": "Why does the transformed image disappear after an app restart?", "acceptedAnswer": {"@type": "Answer", "text": "On Android and iOS, the transformed image is written to a new file in the cache directory and deleted on the next app launch. Move it to a permanent location if you want to keep it, for example with the rename(...) method of the official Filesystem plugin."}}, {"@type": "Question", "name": "Does the plugin preserve the EXIF metadata of the source image?", "acceptedAnswer": {"@type": "Answer", "text": "No, the EXIF orientation is applied during decoding so that the output is always upright, and all other metadata (e.g. EXIF, GPS) is stripped from the output by re-encoding. This is privacy-friendly by default. If you want to keep the metadata, use the Exif plugin to read it from the source image and write it back to the transformed image."}}, {"@type": "Question", "name": "Why does converting to WebP fail on iOS?", "acceptedAnswer": {"@type": "Answer", "text": "On iOS, ImageFormat.Webp is not supported as an output format and the call rejects with the UNSUPPORTED_FORMAT error code. WebP output is only available on Android and the Web. Use ImageFormat.Jpeg or ImageFormat.Png as a cross-platform alternative."}}, {"@type": "Question", "name": "Why can't I convert HEIC or AVIF images on the Web?", "acceptedAnswer": {"@type": "Answer", "text": "The web implementation is based on the Canvas API, and most browsers cannot decode HEIC and AVIF images. This is exactly why the native implementations exist: on Android (9+ for HEIC/HEIF, 12+ for AVIF) and iOS (16+ for AVIF), the plugin uses the native platform decoders. See the Format Support section for the complete overview."}}, {"@type": "Question", "name": "How does the plugin handle very large images?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin is designed to keep the memory footprint low. When a resize target is provided, the image is decoded downsampled so the full-resolution bitmap is never loaded into memory, transforms are processed one at a time on a background queue, and the result is written to a file instead of being returned as base64 data. For the smallest possible memory footprint, always provide a resize target if you don't need the full resolution."}}], "url": "https://capawesome.io/docs/sdks/capacitor/photo-manipulator/"}
```
