Skip to content
pubscout

jpeg_encode

1.0.1, released 4 years ago by tramontana.co.hu

A minimalistic JPEG encoder for Dart and Flutter.

WASM-ready
$ flutter pub add jpeg_encode
Source repository

What it does

It encodes raw RGBA image data into JPEG format. It is designed to be lightweight and purely focused on JPEG conversion without offering full image manipulation capabilities.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to convert a dart:ui Image into a JPEG byte array.
  • You want a minimal encoder without heavy image processing dependencies.

Skip it when

  • You need advanced image editing, cropping, or filtering.
  • You require the highest level of image compression and optimization.

Strengths

  • Minimalistic and lightweight.
  • Direct Dart port for simple JPEG creation.

Weaknesses

  • Does not offer extra image manipulation functionality.
  • Not necessarily the most optimized or best compressed JPEG output.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

not documented

import "dart:ui" as ui;

final data = await image.toByteData(format: skia.ImageByteFormat.rawRgba);
final jpg = JpegEncoder().compress(data!.buffer.asUint8List(), image.width, image.height, 90);

Alternatives

Packages that do the same job and could replace jpeg_encode.

  • image

    Choose this if you need full image manipulation, decoding, and encoding support for multiple formats.