1.0.0 • Published 4 years ago

wayak-pixels-selector v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Table of Contents

PixelsSelector

getPixelInfo

Returns the values of a pixel of an image or canvas

Parameters

  • x number x position.
  • y number y position.
  • canvasImageSource (Image/Canvas) source image.

Returns object a object with props r,g,b,a,uint32

floodFill

Returns an image fill from a starting point as the "magic wand" tool in photoshop

Parameters

  • pX number x position.
  • pY number y position.
  • canvasImageSource (Image/Canvas) source image.
  • tolerance number number (0-200).
  • tintColor (string/number)? can be '#ff0000'(string) or 0xff0000(number) or 'ff0000'(string), if is null return pixel with original rgb values.

Returns ImageData a ImageData Object with the same sizes of canvasImageSource

step2