watermark_kit 2.1.1
watermark_kit: ^2.1.1 copied to clipboard
Fast watermarking for Flutter (iOS + Android). Image/text overlays for images and videos without FFmpeg (Core Image/AVFoundation on iOS; MediaCodec + GLES on Android).
2.1.1 #
Fixed
- iOS: Resolved crash in
composeTextwhen converting colorArgb (0xFFFFFFFF) from Int64 to UInt32- Changed from unsafe
Int64 → Int32 → UInt32conversion to idiomaticUInt32(truncatingIfNeeded:) - Fixes "Fatal error: Not enough bits to represent the passed value" crash
- Changed from unsafe
- iOS: Fixed text watermark clipping on right side
- Improved canvas size calculation using
CTLineGetImageBoundsin addition toCTLineGetTypographicBounds - Ensures glyphs with italic, kerning, or ligatures are not clipped
- Increased padding from 4.0 to 8.0 for safety margin
- Improved canvas size calculation using
2.1.0 #
Improved
- Android & iOS: Significantly enhanced watermark quality for both images and videos
- Android: High-quality filtering (FILTER_BITMAP_FLAG, DITHER_FLAG) with Matrix-based scaling for images; mipmaps + trilinear filtering (GL_LINEAR_MIPMAP_LINEAR) for video watermarks
- iOS: CILanczosScaleTransform for superior quality scaling (replaces simple CGAffineTransform); highQualityDownsample option added to CIContext
- Results in sharper, smoother watermarks with better detail preservation and anti-aliasing
Example
- Add save to gallery feature: users can now save watermarked images directly to their device photo library
- Cross-platform implementation using
galpackage with proper permission handling - "Save to Gallery" button added to Result preview card
- Cross-platform implementation using
2.0.0 #
Added
- Android support for image, text, and video watermarking (API 24+).
- Hardware Surface pipeline with automatic fallback to ByteBuffer YUV + GLES when needed.
- Progress callbacks and cancellation, matching iOS.
- Audio passthrough (best effort).
Fixed
- Android: prevent video tasks from hanging at 100% by properly propagating decoder EOS to the encoder.
- Android: corrected overlay vertical flip (image/text) so placement is upright while keeping coordinates unchanged.
Changed
- README updated for cross‑platform support; removed iOS‑only notes.
- Default logs reduced; added
WMLoggate for verbose debugging on Android.
Notes
- Default codec is H.264; HEVC is used when supported. Some devices/emulators may not support HEVC/Dolby Vision.
- Minimum Android SDK is 24.
1.0.0 #
Added
- iOS video watermarking with progress/cancel (Core Image + AVFoundation Reader/Writer)
- Pigeon APIs:
composeVideo,cancel, andWatermarkCallbacks(progress/completed/error) - Dart:
VideoTaskexposesprogressStream anddoneFuture - Example: dedicated Video tab with text/image watermark selection and output preview player
- Pigeon APIs:
Changed
- Package description updated to reflect image + video support
- iOS Podspec metadata (summary/homepage/author) updated; minimum iOS set to 15.0
Notes
- Default codec is H.264;
codec: 'hevc'can be used where supported - Audio is passed through on a best‑effort basis
0.0.2 #
Added
- Text watermark support for images: new
WatermarkKit.composeTextImage(...)API.- Placement options mirror
composeImage(anchor, margin, offset, units). - Text style:
fontFamily,fontSizePt(orwidthPercentfit),fontWeight,colorArgb,opacity.
- Placement options mirror
- Pigeon host method
WatermarkApi.composeTextand Dart client wiring (MethodChannel fallback retained). - Example app: "Text Watermark" section and Compose Text action.
Changed/Chore
- README updated with text watermark usage and API reference.
0.0.1 #
Initial release.
Added
- iOS image watermarking plugin using Core Image (Metal-backed CIContext under the hood).
- Public API:
WatermarkKit.composeImage(...)that composes a watermark image over a base image and returns encoded bytes.- Options:
anchor,margin(withmarginUnit: 'px'|'percent'),widthPercent,opacity,offsetX/offsetY(withoffsetUnit),format: 'png'|'jpeg',quality(JPEG). - Anchors:
topLeft,topRight,bottomLeft,bottomRight,center.
- Options:
- Pigeon-based typed bridge (Dart/Swift) for
composeImage. - Example app to pick base/watermark from gallery, tweak options, and preview the result.
Changed/Chore
- Simplified README to state iOS support without version numbers.
- Committed example iOS CocoaPods setup (Podfile/lock, xcconfig includes) for reproducible builds.
- Removed unused template tests and misc files; tightened .gitignore.