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

パッケージ詳細v0.1.0

image_watermark

画像にテキストまたは画像の透かしを追加するためのFlutterパッケージ。透かしの位置と色をカスタマイズできます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
900
いいね数
64
Pub ポイント
150

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

flutter pub add image_watermark

パッケージ概要

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

テキストまたは画像の透かしをカスタマイズ可能な配置と色で画像に追加できるFlutterパッケージです。Android、iOS、Web、macOS、Windows、Linuxなど、さまざまなプラットフォームをサポートしています。開発者は、画像の保護やブランド化の目的で、アプリに透かし機能を簡単に統合できます。このパッケージは、透かしのコンテンツ、不透明度、配置、オフセットを定義するためのシンプルなAPIを提供しており、静的および動的な透かし要件に適しています。

用途

  • 画像に著作権表示を追加する
  • ロゴでブランド写真を付ける
  • デジタル資産の保護
  • ウォーターマーク付きプレビューの作成
  • ウォーターマークの外観をカスタマイズする

主な機能

  • テキストおよび画像の透かしをサポート
  • カスタマイズ可能な位置と配置
  • 調整可能な透過率と色
  • クロスプラットフォーム互換性
  • シンプルで直感的な API
  • オフセットとパディングの設定可能

適している対象

  • 画像編集アプリ
  • 写真共有プラットフォーム
  • デジタルコンテンツクリエイター
  • ECアプリケーション
  • 画像保護を必要とするアプリ

注意事項

  • 透かしを追加する前に画像の読み込みが必要です
  • 大きな画像ではパフォーマンスが異なる場合があります
  • 基本的な透かしスタイルに限定
  • 組み込みのプレビュー機能なし
  • 複雑なレイアウトには追加の処理が必要になる場合があります

元の README

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

Image Watermark

Languages

Spanish

Image watermark is flutter pacakge to add text watermark and image watermark on image,you can customize the position of watermark and color.

Based on Image pacakge.

Check on pub.dev

Example code

Add watermark text at center of image,parameter image bytes and string and it returns image bytes

final watermarkedImg = 
  await ImageWatermark.addTextWatermark(
    imgBytes: imgBytes,
    watermarktext: 'watermarkText',
  );
final watermarkedImgBytes = 
    await ImageWatermark.addTextWatermark(
            imgBytes: imgBytes, ///image bytes
            watermarktext: 'watermarkText', ///watermark text
            color: Colors.white, ///default : Colors.black
          );

Change the position of watermark

final watermarkedImg = 
    await ImageWatermark.addTextWatermark(
            imgBytes: imgBytes,             ///image bytes
            watermarktext: 'watermarkText',      ///watermark text
            dstX: 20,                   ///position of watermark x coordinate
            dstY: 30,                   ///y coordinate
            color: Colors.green, ///default : Colors.black
          );

Add image as watermark on image

final watermarkedImgBytes = 
    await ImageWatermark.addImageWatermark(
            originalImageBytes: imgBytes,
            waterkmarkImageBytes: watermarkImgByte,
          );
final watermarkedImgBytes = 
    await ImageWatermark.addImageWatermark(
            originalImageBytes: imgBytes,  //image bytes
            waterkmarkImageBytes: imgBytes2, //watermark img bytes
            imgHeight: 200,   //watermark img height
            imgWidth: 200,    //watermark img width
            dstY: 400, //watermark position Y
            dstX: 400, //watermark position X
          );
Add Fonts

Image package only have arial Fonts, you can change the font converting a .ttf font in .fnt format:

  1. Download your font in .ttf format.

  2. Convert the font to .fnt format using the next site.

  3. Use ImageFont class, readOtherFontZip if you use .zip file; readOtherFont if you unzip and get the .fnt & .png files.

Example to change fonts

Add the font in pubspec.yaml:

  assets:
  - path/to/font.zip

Then use it as follows:

final assetFont = await rootBundle.load('path/to/font.zip');

final font = assetFont.buffer.asUint8List(assetFont.offsetInBytes, assetFont.lengthInBytes);

final bitMapFont = ImageFont.readOtherFontZip(font);

...

await ImageWatermark.addTextWatermark(
  imgBytes: imgBytes,
  font: bitMapFont, /// Font from .zip
  watermarkText: 'watermark text',
  dstX: 20,
  dstY: 40,
)

Screenshots

Screenshot

Screenshot

Screenshot

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

データはまだありません。