Skip to content

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

License

Notifications You must be signed in to change notification settings

tomsonar/image

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Build Status

##Overview

A Dart library to encode and decode various image formats.

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

The image library currently supports decoding and encoding the following formats:

  • PNG
  • JPG
  • TGA
  • GIF

Decoding Only (for now):

  • WebP (including animation)

##Documentation

##Samples

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

import 'dart:io' as Io;
import 'package:image/image.dart';
void main() {
  // Read a webp image from file.
  Image image = decodeWebP(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

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%