expo-image-decoder
v1.0.0
Published
A fast Expo module for decoding images to raw pixel data on iOS, useful for face recognition, ML preprocessing, and custom image analysis.
Maintainers
Readme
Expo Image Decoder Module
A native Expo module for decoding images to raw pixel data. This module provides efficient image decoding capabilities for React Native applications.
Installation
npm install expo-image-decoderAPI
decodeImageFromUri(uri: string): Promise<DecodedImage>
Decodes an image directly from a URI into raw RGBA pixel data.
Parameters:
uri(string): The URI of the image to decode (can be a file:// URI or https:// URL)
Returns:
Promise<DecodedImage>: A promise that resolves to an object containing:data(Uint8ClampedArray): Raw pixel data in RGBA format (4 bytes per pixel)width(number): The width of the image in pixelsheight(number): The height of the image in pixels
Example:
import { decodeImageFromUri } from "expo-image-decoder";
const result = await decodeImageFromUri("file:///path/to/image.jpg");
console.log(result.width, result.height, result.data);