ffi_jpeg_encode 1.0.0 copy "ffi_jpeg_encode: ^1.0.0" to clipboard
ffi_jpeg_encode: ^1.0.0 copied to clipboard

Fast JPEG encoding via FFI with SIMD optimizations for Android and iOS.

ffi_jpeg_encode #

Fast JPEG encoding via FFI with SIMD optimizations for Android and iOS.

Usage #

import 'package:ffi_jpeg_encode/ffi_jpeg_encode.dart';

final jpegBytes = encodeJpegToBytes(
  pixels,       // Uint8List of raw pixel data
  width,        // Image width
  height,       // Image height
  4,            // Components (1=grayscale, 3=RGB, 4=RGBA)
  quality: 95,
  subsampling: JpegSubsampling.auto_,
);

Subsampling Options #

  • JpegSubsampling.auto_ - 4:2:0 if quality <= 90, else 4:4:4
  • JpegSubsampling.yuv444 - No subsampling (higher quality)
  • JpegSubsampling.yuv420 - Subsampling (smaller files)

Credits #

Adapted from flutter_jpeg_encode_ffi.

Based on jo_jpeg - Public Domain JPEG writer.

0
likes
145
points
220
downloads

Publisher

unverified uploader

Weekly Downloads

Fast JPEG encoding via FFI with SIMD optimizations for Android and iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

code_assets, ffi, flutter, hooks, native_toolchain_c

More

Packages that depend on ffi_jpeg_encode