搜索分类、插件与代码仓

插件详情v1.1.0

watermark_unique

watermark_unique 是一个 Flutter 包,用于在图像上添加文本和图像水印。您可以自定义水印的位置、颜色、背景色和内边距。

AndroidiOSWeb
近 30 天下载
105
喜欢数
29
Pub 分数
150

安装插件

flutter pub add watermark_unique

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

watermark_unique 是一个 Flutter 包,旨在为图像添加可自定义的文本和图像水印。它允许用户调整水印的位置、颜色、背景颜色和内边距,以实现精确控制。适用于需要图像保护或品牌标识的应用程序,支持 Android、iOS 和 Web 平台。该包轻量级,可通过简单命令无缝集成到现有的 Flutter 项目中。其开源性质鼓励社区贡献并保持透明度。

适合场景

  • 向图像添加版权信息
  • 用标志为照片添加品牌标识
  • 保护数字内容免遭未经授权的使用
  • 创建带水印的缩略图
  • 可视化自定义图像元数据

主要特点

  • 支持文本和图像水印
  • 可配置的位置和对齐方式
  • 可调节的颜色和背景选项
  • 可自定义的内边距设置
  • 跨平台兼容性(Android、iOS、Web)

适合对象

  • 摄影和媒体应用
  • 内容管理系统
  • 电商平台
  • 数字资产库
  • 创意工具和编辑器

使用建议

  • 在应用水印之前需要先加载图像
  • 性能可能随大图像而变化
  • 仅限静态水印放置
  • 无内置的撤销或编辑历史
  • 依赖外部图像处理效率

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

watermark_unique

watermark_unique is a flutter package to add text and image watermarks on an image. You can customize the watermark's position, color, background color, and padding. Check on pub.dev: https://pub.dev/packages/watermark_unique

Documentation

Features
  • Add text to image
  • Add watermark to image
  • Get result via File or Uint8List

Parameters for image that you can change

  • Text
  • Position by X
  • Position by Y
  • Text size
  • Text color (withOpacity)
  • Background text color (optional / withOpacity)
  • Padding for text if background exist (optional)
  • Quality of image with watermark
  • Image format that you will use to compress

Usage

An example of how you can add text to an image (only IOS or Android):

final image = await watermarkPlugin.addTextWatermark(
  filePath: photo!.path, // image file path
  text: 'Test watermark text', // watermark text
  x: 500, // position by x
  y: 400, // position by y
  textSize: 250, // text size
  color: Colors.purpleAccent, // color of text
  isNeedRotateToPortrait: true, // rotation image to portrait (Default: false) ONLY ANDROID
  backgroundTextColor: Colors.black.withOpacity(0.5), // color of background text (optional)
  quality: 100, // quality of image with watermark
  backgroundTextPaddingLeft: 12, // padding of background text (optional)
  backgroundTextPaddingTop: 12, // padding of background text (optional)
  backgroundTextPaddingRight: 12, // padding of background text (optional)
  backgroundTextPaddingBottom: 12, // padding of background text (optional)
  imageFormat: ImageFormat.jpeg, // image format that you will use to compress
);

An example of how you can add a watermark to an image (only IOS or Android):

final image = await watermarkPlugin.addImageWatermark(
  filePath: photo!.path, // image file path
  watermarkImagePath: watermark!.path, // watermark image file path
  x: 500, // position by x
  y: 400, // position by x
  quality: 100, // quality of image with watermark
  imageFormat: ImageFormat.jpeg, // image format that you will use to compress
  watermarkWidth: 300, // watermark image width
  watermarkHeight: 300,  // watermark image height
);

An example of how you can add text to an image and get results via Uint8List (IOS || Android || WEB):

final image = await watermarkPlugin.addTextWatermarkUint8List(
  filePath: photo!.path, // image file path
  text: 'Test watermark text', // watermark text
  x: 500, // position by x
  y: 400, // position by y
  textSize: 250, // text size
  color: Colors.purpleAccent, // color of text
  isNeedRotateToPortrait: true, // rotation image to portrait (Default: false) ONLY ANDROID
  backgroundTextColor: Colors.black, // color of background text (optional)
  backgroundTextPaddingLeft: 12, // padding of background text (optional)
  backgroundTextPaddingTop: 12, // padding of background text (optional)
  backgroundTextPaddingRight: 12, // padding of background text (optional)
  backgroundTextPaddingBottom: 12, // padding of background text (optional)
);

An example of how you can add a watermark to an image and get results via Uint8List (IOS || Android || WEB):

final image = await watermarkPlugin.addImageWatermarkUint8List(
  filePath: photo!.path, // image file path
  watermarkImagePath: watermark!.path, // watermark image file path
  x: 500, // position by x
  y: 400, // position by x
  watermarkWidth: 300, // watermark image width
  watermarkHeight: 300,  // watermark image height
);

Example screenshots

所属分类

依赖

依赖清单 2 项

  • image^4.5.4
  • plugin_platform_interface^2.1.8

源码仓库

使用此插件的项目

暂无相关数据。