Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.
/ image Public archive
forked from brendan-duncan/image

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

License

Notifications You must be signed in to change notification settings

toridori-inc/image

This branch is 2 commits ahead of, 611 commits behind brendan-duncan/image:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3a559e7 · Aug 19, 2020
Dec 30, 2019
Aug 19, 2020
May 21, 2020
Dec 30, 2019
Jun 14, 2018
Jan 27, 2019
Jun 14, 2020
Jun 5, 2019
Oct 30, 2019
May 11, 2019
Jul 6, 2020

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:

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

Write Only:

  • ICO
  • CUR

Samples

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

import 'dart: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(File('test.webp').readAsBytesSync());

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

  // Save the thumbnail as a PNG.
  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 99.0%
  • Other 1.0%