Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 1.25 KB

README.md

File metadata and controls

71 lines (46 loc) · 1.25 KB

CanvasToBmp Library

A library that converts canvas to bmp - bitmap image per pixel

Installation

npm i canvas-to-bmp

Usage

It is good to use my primary library that it does the conversion from dom to canvas
npm i html-canvas-ts


After you get the result,
The library above returns:

canvas, ctx, you can get the width and hight from canvas like: canvas.width or canvas.height

and than you can call the method optimized bellow:

****************************************
const result: number[]  = convertCanvasToBmp(ctx, width, height);
****************************************

This return 1 (0) and 0 (255), 1 if the pixel is black and 0 if the pixel is white


Clone the seed app with

git clone [email protected]:BeratS/canvas-to-bmp.git

Browsers

It's tested on latest Chrome(102) and Firefox(100), Safari(15), Cog Browser

You can find me on:

https://twitter.com/BeratSdev
https://linkedin.com/in/berat-sulimani

"Buy Me A Coffee"



TODO

Create an issue of what are your needs of this library.
Feel free to chat with me.