Kategorien, Pakete und Repositories suchen

Paketdetailsv4.12.0

image

Die Dart-Bildbibliothek bietet Server- und Web-Anwendungen die Fähigkeit, Bilder mit verschiedenen Bilddateiformaten zu laden, zu bearbeiten und zu speichern.

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
9 Mio.
Likes
1760
Pub-Punkte
160

Paket installieren

flutter pub add image

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Die Dart-Bildbibliothek ermöglicht Server- und Webanwendungen das Laden, Bearbeiten und Speichern von Bildern in mehreren Formaten. Sie unterstützt gängige Operationen wie Größenänderung, Ausschneiden, Farbanpassungen und Formatkonvertierung, wodurch sie ideal für Bildverarbeitungsaufgaben ohne Abhängigkeit von nativen Plattformwerkzeugen ist. Die Bibliothek ist leichtgewichtig und für den Einsatz in Flutter-Anwendungen auf Android, iOS, Web, macOS, Windows und Linux konzipiert. Sie ist besonders nützlich für Backend-Bildtransformationen oder die dynamische Erzeugung von Miniaturbildern.

Anwendungsfälle

  • Bildgrößenanpassung und -ausschnitt
  • Thumbnailerstellung
  • Bildformatkonvertierung
  • Server-seitige Bildverarbeitung
  • Dynamische Bildmanipulation in Web-Anwendungen

Hauptmerkmale

  • Unterstützt mehrere Bildformate
  • Plattformübergreifende Kompatibilität
  • Leicht und schnell
  • Eingebaute Bildfilter
  • erweiterbare Bildverarbeitungspipeline

Geeignet für

  • Backend-Bildverarbeitung
  • Webbasierte Bildwerkzeuge
  • Flutter-Apps, die Bildmanipulation benötigen
  • Automatisierte Bildworkflows
  • Entwickler, die Bildbearbeitungsfunktionen erstellen

Hinweise

  • Nicht für die Echtzeit-UI-Darstellung optimiert
  • Eingeschränkter Support für erweiterte Bildeffekte
  • Benötigt manuelle Handhabung großer Dateien
  • Kein integrierter Cache
  • Am besten geeignet für nicht-interaktive Bildaufgaben

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Dart Image Library

Dart CI pub package

Overview

The Dart Image Library provides the ability to load, save, and manipulate images in a variety of image file formats.

The library can be used with both dart:io and dart:html, for command-line, Flutter, and web applications.

NOTE: 4.0 is a major revision from the previous version of the library.

Documentation

Supported Image Formats

Read/Write

  • JPG
  • PNG / Animated PNG
  • GIF / Animated GIF
  • BMP
  • TIFF
  • TGA
  • PVR
  • ICO
  • WebP / Animated WebP (lossless and lossy)

Read Only

  • PSD
  • EXR
  • PNM (PBM, PGM, PPM)

Write Only

  • CUR

Examples

Create an image, set pixel values, save it to a PNG.

import 'dart:io';
import 'package:image/image.dart' as img;
void main() async {
  // Create a 256x256 8-bit (default) rgb (default) image.
  final image = img.Image(width: 256, height: 256);
  // Iterate over its pixels
  for (var pixel in image) {
    // Set the pixels red value to its x position value, creating a gradient.
    pixel..r = pixel.x
    // Set the pixels green value to its y position value.
    ..g = pixel.y;
  }
  // Encode the resulting image to the PNG image format.
  final png = img.encodePng(image);
  // Write the PNG formatted data to a file.
  await File('image.png').writeAsBytes(png);
}

To asynchronously load an image file, resize it, and save it as a thumbnail:

import 'package:image/image.dart' as img;

void main(List<String> args) async {
  final path = args.isNotEmpty ? args[0] : 'test.png';
  final cmd = img.Command()
    // Decode the image file at the given path
    ..decodeImageFile(path)
    // Resize the image to a width of 64 pixels and a height that maintains the aspect ratio of the original. 
    ..copyResize(width: 64)
    // Write the image to a PNG file (determined by the suffix of the file path). 
    ..writeToFile('thumbnail.png');
  // On platforms that support Isolates, execute the image commands asynchronously on an isolate thread.
  // Otherwise, the commands will be executed synchronously.
  await cmd.executeThread();
}

Kategorien

Abhängigkeiten

Abhängigkeiten 1 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden

Ranglisten