Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitmap-ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitmap-ts

Library built in [Typescript](https://www.typescriptlang.org/) to load/handle a bitmap file. Support 1, 2, 4, 8, 16(no tested) and 24 bpp. The following functions are available: - read(File) - negative() - rotate90CW() - rotate90CCW() - rotate180() - rota

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

bitmap-ts

A typescript library for loading, transforming, and filtering BMP images, directly from the browser. This is a port from RequireJS to NPM (https://github.com/testica/bitmap-ts).

Installation

$ npx install bitmap-ts

OR

$ yarn add bitmap-ts

Example Usage

import { Bitmap } from 'bitmap-ts';

const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    const file: File = event.target.files![0];
    const bmp = new Bitmap(file);

    bmp.read((response: Bitmap) => {
      this.imageData = response.currentData();
    });

    const image = new Image();

    image.onload = () => {
      this.imageHeight = image.height;
      this.imageWidth = image.width;
    };

    image.src = URL.createObjectURL(file);
}

Credits: Leonardo Testa & Carlos Abreu

Keywords

FAQs

Package last updated on 16 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc