Skip to content
/ image Public
forked from DiegoCatalano/image

Dart library for decoding/encoding image formats, and image processing.

License

Notifications You must be signed in to change notification settings

poberube/image

This branch is up to date with DiegoCatalano/image:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

29c2e38 · Aug 19, 2018
Jun 7, 2018
Aug 19, 2018
Jun 2, 2018
May 23, 2018
May 23, 2018
Jun 14, 2018
May 25, 2018
Jun 7, 2018
Sep 26, 2014
Apr 17, 2017
Sep 15, 2017
Jun 14, 2018

Repository files navigation

image

Build Status

Overview

A Dart library providing the ability to load, save and manipulate images in a variety of different file formats.

The library has no reliance on dart:io, so it can be used for both server and web applications.

Supported Image Formats:

Read/Write:

  • PNG / Animated APNG
  • JPEG
  • Targa
  • GIF / Animated GIF
  • PVR(PVRTC)

Read Only:

  • WebP / Animated WebP
  • TIFF
  • Photoshop PSD
  • OpenEXR

Samples

Load an image, resize it, and save it as a png:

import 'dart:io' as Io;
import 'package:image/image.dart';
void main() {
  // Read an image from file (webp in this case).
  // decodeImage will identify the format of the image and use the appropriate
  // decoder.
  Image image = decodeImage(new Io.File('test.webp').readAsBytesSync());

  // Resize the image to a 120x? thumbnail (maintaining the aspect ratio).
  Image thumbnail = copyResize(image, 120);

  // Save the thumbnail as a PNG.
  new Io.File('thumbnail.png')
        ..writeAsBytesSync(encodePng(thumbnail));
}

About

Dart library for decoding/encoding image formats, and image processing.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 98.8%
  • Other 1.2%