ericandrewlewis / bitmap-js Goto Github PK
View Code? Open in Web Editor NEWRead and create bitmap image files in Node
License: MIT License
Read and create bitmap image files in Node
License: MIT License
Bitmaps with a negative height sets the origin to the top left.
I am working on a pull request. #3
createBitmapBuffer if the same createBitmapFile, but it returns the buffer instead of writing the bitmp to a a file, I need it to return a buffer.
I'm perusing for tools to read bitmap file content, and stumbled on this. Neat!
In the web, reading a bitmap file can yield an ArrayBuffer
with the binary data, like this:
const response = await fetch('/path/to/file.bmp')
const data = response.arrayBuffer()
I've no experience with bitmaps (other than starting to peruse how to read the data just now). I've tried steps in this guide with no luck: https://www.i-programmer.info/projects/36-web/6234-reading-a-bmp-file-in-javascript.html
But when I send the data to the GPU (WebGL), I get a black texture, so I'm doing something wrong somewhere.
Anyway, it'd be neat if this lib would detect a browser environment, and in that case either accept an ArrayBuffer
object, or a URL and fetch
it to an ArrayBuffer
, and finally create the same sort of meta object with the same content (but ArrayBuffer
s or UInt8Array
s inside the object instead of Buffer
s).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.