@lancercomet/grand-painter
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

The Grand Painter

npm version

Draw images on canvas with layer effects.

header-image

Quick start

import { paint, Processors } from 'the-grand-painter'

const stageElement = document.getElementById('stage') as HTMLCanvasElement
const imageElement = new Image()

// Put an image on a canvas.
paint({
  stage: stageElement,
  image: imageElement,
  x: 50, 
  y: 50,
  processor: Processors.Normal()
})

// "Overlay" a image on a canvas.
paint({
  stage: stageElement,
  image: imageElement,
  x: 50, 
  y: 50,
  processor: Processors.Overlay()
})

Processor List

  • ColorBurn
  • ColorDodge
  • Darken
  • Dissolve
  • Lighten
  • LighterColor
  • LinearBurn
  • LinearDodge
  • Multiply
  • Normal
  • Overlay
  • Screen
  • Softlight

Example

Check examples in dev/ for more information.

License

Apache-2.0

Package Sidebar

Install

npm i @lancercomet/grand-painter

Weekly Downloads

4

Version

1.0.1

License

Apache-2.0

Unpacked Size

264 kB

Total Files

24

Last publish

Collaborators

  • pwch