zhensherlock / watermark-js-plus

watermark for the browser
https://zhensherlock.github.io/watermark-js-plus/
MIT License
360 stars 25 forks source link
canvas javascript typescript watermark

watermark logo

[![][npm-release-shield]][npm-release-link] [![][npm-downloads-shield]][npm-downloads-link] [![][package-size-shield]][package-size-link] [![][codecov-shield]][codecov-link]
[![][github-release-date-shield]][github-release-date-link] [![][github-action-build-shield]][github-action-build-link] [![][github-license-shield]][github-license-link] [![][gitter-shield]][gitter-link] [//]: # ( npm package) [//]: # ( GitHub Workflow Status) [//]: # ( npm bundle size) [//]: # ( npm download week) [//]: # ( GitHub) [//]: # ( Join the chat at https://gitter.im/china-hy/watermark-js-plus)

Watermark

This is a canvas-based watermark for browser.

Watermark works with both Vue 2 , Vue 3 And React.

Translations

Installing

# or pnpm or yarn
npm install watermark-js-plus

Usage

Demo Collection

Watermark

import { Watermark } from 'watermark-js-plus'

const watermark = new Watermark({
  content: 'hello my watermark',
  width: 200,
  height: 200,
  onSuccess: () => {
    // success callback
  }
})

watermark.create()

Blind Watermark

import { BlindWatermark } from 'watermark-js-plus'

const watermark = new BlindWatermark({
  content: 'hello my watermark',
  width: 200,
  height: 200,
  onSuccess: () => {
    // success callback
  }
})

watermark.create()

Decode Blind Watermark

import { BlindWatermark } from 'watermark-js-plus'

BlindWatermark.decode({
  url: uploadFile.url, // image url
  onSuccess: (imageBase64) => {
    // success callback
  }
})

Documentation

To learn more, check its documentation.

Maintainers

@zhensherlock.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Standard Readme follows the Contributor Covenant Code of Conduct.

Contributors

This project exists thanks to all the people who contribute.

License

MIT © MichaelSun