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

im-decode

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

im-decode

A node.js library that leverages ImageMagick to turn images into RGBA arrays (Uint8Arrays).

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by138.46%
Maintainers
1
Weekly downloads
 
Created
Source

im-decode

A node.js library that leverages ImageMagick to turn images into RGBA arrays (Uint8Arrays).

Install

npm install im-decode

im-decode requires ImageMagick CLI tools to be installed. There's plenty of ways to install ImageMagick, choose what's right for you.

Usage

var decode = require('im-decode');
decode(imageBuffer, function(err, rgbaArray) {
  // do something
});

decode(image, [dimensions], callback)

  • image Buffer
  • dimensions (optional) Array of dimensions in the form [w, h], i.e. [640, 480]
  • callback Function(Error, Uint8Array)

Returns a Uint8Array when provided an image as a Buffer. Passing in a dimensions Array is optional, but will provide a slight speed improvement (~7% speed increase for 640x480 images was seen in testing). The speed improvement is due to the nature of knowing the size of the end result Buffer vs continually creating new Buffers of ever increasing size. At least that's my assumption without diving into it any deeper.

Keywords

FAQs

Package last updated on 08 Jan 2014

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