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

bitmap-to-boxes

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitmap-to-boxes

Partitions a 2D binary image into rectangles

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

bitmap-to-boxes

Partitions a binary image into a non-overlapping collection of rectangles. Works both in node.js and in browserify.

Example

var image = require("ndarray-pack")([
  [1, 1, 0, 0, 0, 1],
  [0, 1, 1, 1, 0, 1],
  [0, 1, 0, 1, 0, 1],
  [0, 1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1, 1],
  [1, 1, 1, 0, 0, 1]
])

var boxes = require("bitmap-to-boxes")(image)

Install

npm install bitmap-to-boxes

API

require("bitmap-to-boxes")(image[, greedy])

Decomposes the binary bitmap image into a collection of boxes.

  • image is a binary 2D ndarray
  • greedy is an optional flag, which if set uses a faster greedy approximation instead of an optimal algorithm.

Returns A list of boxes encoded by their lower/upper bounds respectively which partition the image.

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 02 Jul 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