パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.2

fast_image_resizer

ネイティブ実装で画像のサイズを変更します。出力形式はPNGのみをサポートしています。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2840
いいね数
19
Pub ポイント
160

パッケージをインストール

flutter pub add fast_image_resizer

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Fast Image Resizer は、複数のプラットフォームでネイティブ実装を使用して効率的な画像リサイズを可能にするFlutterパッケージです。最小限のオーバーヘッドで高パフォーマンスな画像スケーリングに特化しており、最適化された結果を提供します。このパッケージはPNG出力形式のみをサポートしており、圧縮され高品質なPNGが必要なアプリケーションに最適です。高速かつ信頼性の高い設計により、マルチメディア編集、圧縮、または画像処理ワークフローに焦点を当てたアプリへのシームレスな統合が可能です。クロスプラットフォーム互換性により、Android、iOS、Web、macOS、Windows、Linuxで一貫した動作を保証します。

用途

  • 画像サムネイルの生成
  • Web配信向けに画像を最適化する
  • ストレージ用に画像ファイルサイズを小さくする
  • アプリ表示用の画像の前処理
  • メディアアプリでの一括画像リサイズ

主な機能

  • すべてのプラットフォームでのネイティブパフォーマンス
  • PNGのみの出力形式
  • クロスプラットフォーム互換性
  • 最小限のメモリ使用量
  • サイズ変更のためのシンプルな API
  • 低遅延による高速実行

適している対象

  • 高速な画像処理が必要なアプリ
  • パフォーマンスを重視する開発者
  • PNG出力に焦点を当てたプロジェクト
  • メディア重視のアプリケーション
  • 画像最適化を必要とするWebおよびモバイルアプリ

注意事項

  • PNGファイルのみを出力します
  • リサイズ操作に限定
  • 他の画像形式のサポートはありません
  • 大きな画像の取り扱いには注意が必要です
  • 複雑な画像変換には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

fast_image_resizer

This package uses native implementations to resize an image. It should be fast compared to the image package. It only supports PNG as output at the moment.

This package has zero dependencies.

Features

  • Supported inputs: JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP
  • Supported outputs: PNG

Getting started

Add fast_image_resizer to your pubspec.yaml

Usage

import 'package:fast_image_resizer/fast_image_resizer.dart';
import 'dart:typed_data';
final rawImage = await rootBundle.load('assets/someImage.png');
final bytes = await resizeImage(Uint8List.view(rawImage.buffer), width: 150);
if (bytes != null) {
    final imageWidget = Image.memory(Uint8List.view(bytes.buffer));
    showDialog(
        context: context,
        builder: (BuildContext context) {
            return AlertDialog(
            title: const Text("Image"),
            content: imageWidget,
            );
        }
    );
}

or

final ImagePicker _picker = ImagePicker();
final XFile? image =
    await _picker.pickImage(source: ImageSource.gallery);
if (image != null) {
    final rawImage = await image.readAsBytes();
    final bytes = await resizeImage(Uint8List.view(rawImage.buffer), height: 250);
    if (bytes != null) {
        final testing = Image.memory(Uint8List.view(bytes.buffer));
        showDialog(
            context: context,
            builder: (BuildContext context) {
                return AlertDialog(
                    title: Text("Image"),
                    content: testing,
                );
            }
        );
    }
}

Known Issues

  • This currently does not work on web, because of this issue: https://github.com/flutter/flutter/issues/34075

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト