Code Monkey home page Code Monkey logo

bitmap-js's Issues

Feature Request: createBitmapBuffer

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.

feature request: read bitmap file from ArrayBuffer, for browsers

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 ArrayBuffers or UInt8Arrays inside the object instead of Buffers).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.