Viewing version 1.1.1. Open the latest package page.

image

1.1.1

Provides server and web apps the ability to load, manipulate, and save various image file formats. *previously called dart_image*

Download archive

Readme

image

##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 the following formats:

  • PNG
  • JPG
  • TGA

##Sample

Load a jpeg, resize it, and save it as a png:

import 'dart:io' as Io;
import 'package:image/image.dart';
void main() {
  // Read a jpeg image from file.
  Image image = readJpg(new Io.File('res/cat-eye04.jpg').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('out/thumbnail-cat-eye04.png')
        ..createSync(recursive: true)
        ..writeAsBytesSync(writePng(thumbnail));
}

##Image Functions

  • Image brightness(Image src, int brightness);
  • Image colorOffset(Image src, int red, int green, int blue, int alpha);
  • Image contrast(Image src, num contrast);
  • Image convolution(Image src, List filter, num filterDiv, num offset);
  • Image copyCrop(Image src, int x, int y, int w, int h);
  • Image copyGaussianBlur(Image src, int radius);
  • Image copyInto(Image dst, Image src, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h);
  • Image copyResize(Image src, int width, [int height = -1]);
  • Image drawChar(Image image, BitmapFont font, int x, int y, String string, {int color: 0xffffffff});
  • Image drawLine(Image image, int x1, int y1, int x2, int y2, int color, {bool antialias: false, num thickness: 1});
  • Image drawString(Image image, BitmapFont font, int x, int y, String string, {int color: 0xffffffff});
  • Image dropShadow(Image src, int hshadow, int vshadow, int blur, {int shadowColor: 0x000000a0});
  • Image edgeDetectQuick(Image src);
  • Image emboss(Image src);
  • Image fill(Image image, int color);
  • Image fillRect(Image src, int x, int y, int w, int h, int color);
  • Image flip(Image src, int mode);
  • Image grayscale(Image src);
  • Image invert(Image src);
  • Image meanRemoval(Image src);
  • Image pixelate(Image src, int blockSize, {int mode: PIXELATE_UPPERLEFT});
  • BitmapFont readFontZip(List bytes);
  • BitmapFont readFont(String fnt, Image page);
  • Image readJpg(List bytes);
  • Image readPng(List bytes);
  • Image readTga(List bytes);
  • Image remapColors(Image src, {int red: RED, int green: GREEN, int blue: BLUE, int alpha: ALPHA});
  • Image smooth(Image src, num w);
  • List writeJpg(Image image, {int quality: 100});
  • List writePng(Image image, {int level: 6});
  • List writeTga(Image image);
Changelog

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'image:1.1.1'
pubspec.yaml
name: image
author: Brendan Duncan <brendanduncan@gmail.com>
version: 1.1.1
homepage: http://bitbucket.org/brendan_duncan/image
description: Provides server and web apps the ability to load, manipulate, and save various image file formats.  *previously called dart_image*
dependencies:
  archive: '>=1.0.6'
  xml: any
dev_dependencies:
  unittest: any

Version history

VersionPublishedArchiveSHA-256
1.1.0Cached · Upstream SHA-256 matchedDownload6a9453d0…3cba67
1.1.1Cached · Upstream SHA-256 matchedDownload41ea21f7…fe769a
1.1.2Cached · Upstream SHA-256 matchedDownload3b7e6af3…c2bcb0
1.1.3Cached · Upstream SHA-256 matchedDownload79b7ccaf…6e068b
1.1.4Cached · Upstream SHA-256 matchedDownloadcecf2f2f…4b1b86
1.1.5Cached · Upstream SHA-256 matchedDownload7fbf7db7…195143
1.1.6Cached · Upstream SHA-256 matchedDownload86670f17…63466f
1.1.7Cached · Upstream SHA-256 matchedDownloadc8b8d0c8…9ea0b0
1.1.8Cached · Upstream SHA-256 matchedDownloadb8b6906c…457af8
1.1.9Cached · Upstream SHA-256 matchedDownload855c7cc8…b4f312
1.1.10Cached · Upstream SHA-256 matchedDownloada6b2c30c…c44076
1.1.12Cached · Upstream SHA-256 matchedDownload9bfd4b2a…62a0fd
1.1.13Cached · Upstream SHA-256 matchedDownloadbee596b4…bff69a
1.1.14Cached · Upstream SHA-256 matchedDownload9f3f828b…be84a3
1.1.15Cached · Upstream SHA-256 matchedDownload374d0533…e58bcd
1.1.16Cached · Upstream SHA-256 matchedDownload4dae3b07…8c8629
1.1.17Cached · Upstream SHA-256 matchedDownload8cf1ba07…84f04c
1.1.18Cached · Upstream SHA-256 matchedDownload80510851…e1e7f9
1.1.19Cached · Upstream SHA-256 matchedDownload3aeded01…859863
1.1.20Cached · Upstream SHA-256 matchedDownloadb3891f35…df4858
1.1.21Cached · Upstream SHA-256 matchedDownloadcd425220…28ec63
1.1.22Cached · Upstream SHA-256 matchedDownloadec99df4f…4b0ba6
1.1.23Cached · Upstream SHA-256 matchedDownload2f0b2488…832ec0
1.1.24Cached · Upstream SHA-256 matchedDownload80674a06…49c9df
1.1.25Cached · Upstream SHA-256 matchedDownload5f721224…570191
1.1.26Cached · Upstream SHA-256 matchedDownload0bf0abe6…5518da
1.1.27Cached · Upstream SHA-256 matchedDownload7b371ff9…a6fedd
1.1.28Cached · Upstream SHA-256 matchedDownloadd3b10f6a…863980
1.1.29Cached · Upstream SHA-256 matchedDownloadd8a18d7e…0af45e
1.1.30Cached · Upstream SHA-256 matchedDownload8d99dfbf…344349
1.1.31Cached · Upstream SHA-256 matchedDownloada1b1090c…bc201d
1.1.32Cached · Upstream SHA-256 matchedDownload6988adaa…675ca2
1.1.33Cached · Upstream SHA-256 matchedDownloadda9d9b41…af1961
2.0.0Cached · Upstream SHA-256 matchedDownload2663edee…bdc498
2.0.1Cached · Upstream SHA-256 matchedDownload8fcb95d7…e4148d
2.0.2Cached · Upstream SHA-256 matchedDownload330fee37…299dc3
2.0.3Cached · Upstream SHA-256 matchedDownloada77242d6…3cd956
2.0.4Cached · Upstream SHA-256 matchedDownload510b6782…235b58
2.0.5Cached · Upstream SHA-256 matchedDownloada68244b7…13decb
2.0.6Cached · Upstream SHA-256 matchedDownloadff323f2e…c17808
2.0.7Cached · Upstream SHA-256 matchedDownloadd12b09d6…185b92
2.0.8Cached · Upstream SHA-256 matchedDownload132c398d…e9a2bb
2.0.9Cached · Upstream SHA-256 matchedDownload19beed89…30fc78
2.1.0Cached · Upstream SHA-256 matchedDownload8083a530…8f530f
2.1.1Cached · Upstream SHA-256 matchedDownloadcfdbf33f…79f5e2
2.1.2Cached · Upstream SHA-256 matchedDownload9a8195db…27c556
2.1.3Cached · Upstream SHA-256 matchedDownload64689f12…9c9b8c
2.1.4Cached · Upstream SHA-256 matchedDownload21f5c7a1…509d19
2.1.5Cached · Upstream SHA-256 matchedDownload4625cb54…692074
2.1.6Cached · Upstream SHA-256 matchedDownloadbe234be4…8cfa21
2.1.7Cached · Upstream SHA-256 matchedDownload62f9fbbd…57291e
2.1.8Cached · Upstream SHA-256 matchedDownloadd5345058…aeb335
2.1.9Cached · Upstream SHA-256 matchedDownloadff81b0be…3d0e17
2.1.10Cached · Upstream SHA-256 matchedDownload3ead3a34…0c6e87
2.1.11Cached · Upstream SHA-256 matchedDownloaddc0420e3…d97943
2.1.12Cached · Upstream SHA-256 matchedDownload80cc5436…634516
2.1.13Cached · Upstream SHA-256 matchedDownload2a0117d0…52cd20
2.1.14Cached · Upstream SHA-256 matchedDownloadd1dcb4c8…83afdd
2.1.15Cached · Upstream SHA-256 matchedDownload01636997…80bc6c
2.1.16Cached · Upstream SHA-256 matchedDownload8d7565bc…26eb24
2.1.17Cached · Upstream SHA-256 matchedDownload1de27c1c…5c0b73
2.1.18Cached · Upstream SHA-256 matchedDownload5acb57df…9e7c8f
2.1.19Cached · Upstream SHA-256 matchedDownload3ef4d4b6…c16734
3.0.0-nullsafety.0Cached · Upstream SHA-256 matchedDownloadef2273bc…f05c25
3.0.1Cached · Upstream SHA-256 matchedDownloada15291ec…59a9eb
3.0.2Cached · Upstream SHA-256 matchedDownload3e5c9ef8…03bcab
3.0.3Cached · Upstream SHA-256 matchedDownloadf6139748…c1487a
3.0.4Cached · Upstream SHA-256 matchedDownloadebac28ef…a892a9
3.0.5Cached · Upstream SHA-256 matchedDownloadbb9f31e2…aba732
3.0.6Cached · Upstream SHA-256 matchedDownloada819fdb4…904cb7
3.0.7Cached · Upstream SHA-256 matchedDownload8c70957e…df9ece
3.0.8Cached · Upstream SHA-256 matchedDownloadd9a704c6…8652fa
3.1.0Cached · Upstream SHA-256 matchedDownload504b1c7c…32d928
3.1.1Cached · Upstream SHA-256 matchedDownload67994d65…030f54
3.1.2Cached · Upstream SHA-256 matchedDownload16ac655d…1b735d
3.1.3Cached · Upstream SHA-256 matchedDownload02bafd3b…0e5b32
3.2.0Cached · Upstream SHA-256 matchedDownload9d2c5f73…307855
3.2.1Cached · Upstream SHA-256 matchedDownloadc54ca832…b7d6c9
3.2.2Cached · Upstream SHA-256 matchedDownloadf6ffe289…fa588b
3.3.0Cached · Upstream SHA-256 matchedDownload8e9d1337…0306d6
4.0.0Cached · Upstream SHA-256 matchedDownloadac57358d…f60a27
4.0.1Cached · Upstream SHA-256 matchedDownload96e2cf13…383599
4.0.2Cached · Upstream SHA-256 matchedDownload1abe795f…f0f97d
4.0.3Cached · Upstream SHA-256 matchedDownload4a4a0190…b42bb2
4.0.4Cached · Upstream SHA-256 matchedDownloade006027f…074d89
4.0.5Cached · Upstream SHA-256 matchedDownload820dc27f…3ef0fd
4.0.6Cached · Upstream SHA-256 matchedDownloadb7b392c9…20f655
4.0.7Cached · Upstream SHA-256 matchedDownload30e8694b…b69643
4.0.8Cached · Upstream SHA-256 matchedDownload5e59c3d9…92538d
4.0.9Cached · Upstream SHA-256 matchedDownloadd0eec4f1…a2697c
4.0.10Cached · Upstream SHA-256 matchedDownload3f0cd7ca…6beda0
4.0.11Cached · Upstream SHA-256 matchedDownloadc5e0014f…7e40b9
4.0.12Cached · Upstream SHA-256 matchedDownload1f9ecf99…b5dd67
4.0.13Cached · Upstream SHA-256 matchedDownload3686865f…70fd24
4.0.14Cached · Upstream SHA-256 matchedDownload1d67caca…b0f524
4.0.15Cached · Upstream SHA-256 matchedDownload483a389d…861227
4.0.16Cached · Upstream SHA-256 matchedDownload73964e36…00f4ef
4.0.17Cached · Upstream SHA-256 matchedDownloada72242c9…e0d9bf
4.1.0Cached · Upstream SHA-256 matchedDownload6e703d5e…108888
4.1.1Cached · Upstream SHA-256 matchedDownload2029d93a…53ee11
4.1.2Cached · Upstream SHA-256 matchedDownload93d1141e…1fcadf
4.1.3Cached · Upstream SHA-256 matchedDownload028f6196…fd9271
4.1.4Cached · Upstream SHA-256 matchedDownload004a2e90…2c033d
4.1.5Cached · Upstream SHA-256 matchedDownload441d775d…67d2f2
4.1.6Cached · Upstream SHA-256 matchedDownload49a0d4b0…21aa4a
4.1.7Cached · Upstream SHA-256 matchedDownload4c68bfd5…da018e
4.2.0Cached · Upstream SHA-256 matchedDownload2237616a…d69ca8
4.3.0Cached · Upstream SHA-256 matchedDownloadf31d5253…8bea7d
4.4.0Cached · Upstream SHA-256 matchedDownload599d08e3…013533
4.5.0Cached · Upstream SHA-256 matchedDownload20842a5a…01a26c
4.5.1Cached · Upstream SHA-256 matchedDownloadb50b4153…7dbc2a
4.5.2Cached · Upstream SHA-256 matchedDownload8346ad4b…01c4a6
4.5.3Cached · Upstream SHA-256 matchedDownload13d3349a…9e31c3
4.5.4Cached · Upstream SHA-256 matchedDownload4e973fcf…c4d928
4.6.0Cached · Upstream SHA-256 matchedDownload51555e36…54e332
4.7.0Cached · Upstream SHA-256 matchedDownload6acdc597…55a273
4.7.1Cached · Upstream SHA-256 matchedDownload48c11d09…cff0bf
4.7.2Cached · Upstream SHA-256 matchedDownload492bd52f…62604c
4.8.0Cached · Upstream SHA-256 matchedDownloadf9881ff4…94dfce
4.9.0Cached · Upstream SHA-256 matchedDownloadac8932c0…d7725f
4.9.1Cached · Upstream SHA-256 matchedDownload6300175e…473c52
4.9.2Cached · Upstream SHA-256 matchedDownload1976370a…5c688e
4.10.0Cached · Upstream SHA-256 matchedDownloadb1b35307…1cd1fd
4.10.1Cached · Upstream SHA-256 matchedDownloada1e7f495…11ce89
4.10.2Cached · Upstream SHA-256 matchedDownload0be525eb…3ebf89
4.11.0Cached · Upstream SHA-256 matchedDownloadd701df3e…44761f
4.11.1Cached · Upstream SHA-256 matchedDownload677a295e…fea65e
4.12.0Cached · Upstream SHA-256 matchedDownload89ed75b2…95b72a

Dependencies

archive "\u003e=1.0.6"

xml "any"