Skip to main content

libvips_ffi

High-performance image processing for Flutter and Dart.

Disclaimer

This is a third-party language binding for libvips, not an official libvips project. It is maintained independently by FlutterCandies. The libvips team does not provide support for this package. For issues and questions, please use GitHub Issues.

Powered by libvips.

Why libvips_ffi?

  • High Performance: libvips is one of the fastest image processing libraries, using streaming and caching to minimize memory usage
  • Rich Features: Supports resize, crop, rotate, blur, sharpen, color conversion, and 300+ other operations
  • Cross-Platform: Works on Android, iOS, macOS, Windows, and Linux
  • Easy to Use: Pipeline-style chainable API for intuitive image processing
  • Pure Dart FFI: No platform channels, direct native library calls

Quick Start

Installation

Add the dependency to your pubspec.yaml:

dependencies:
libvips_ffi: ^0.1.0

Basic Usage

import 'package:libvips_ffi/libvips_ffi.dart';

void main() {
// Initialize libvips
initVips();

// Process an image using Pipeline
final result = VipsPipeline.fromFile('input.jpg')
.resize(0.5) // Scale factor: 0.5 = half size
.blur(1.5) // Gaussian blur sigma
.rotate(90) // Degrees
.toJpeg(quality: 85);

// Save to file
File('output.jpg').writeAsBytesSync(result);

// Cleanup
shutdownVips();
}

Package Family

libvips_ffi is organized as a monorepo with multiple packages:

PackageDescription
libvips_ffiMain Flutter plugin (Android/iOS)
libvips_ffi_apiHigh-level Pipeline API
libvips_ffi_corePure Dart FFI bindings
libvips_ffi_desktopDesktop meta-package
libvips_ffi_macosmacOS precompiled library
libvips_ffi_windowsWindows precompiled library
libvips_ffi_linuxLinux precompiled library

Next Steps