New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

guess-image-layout

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

guess-image-layout

Guess the Layout of Image Pixels. Returns layout in xdim layout syntax.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

guess-image-layout

Guess the Layout of Image Pixels. Returns layout in xdim layout syntax.

install

npm install guess-image-layout

basic usage

import guessImageLayout from "guess-image-layout";

const rgba = [123, 234, 42, 255, 124, 42, 42, 255, ...];
guessImageLayout({ data: rgba, bands: 4, height: 768  });
// { layout: "[row,column,band]", bands: 4, height: 768, width: 1024 }

const bands = [
  [123, 124, ...], // red band
  [234, 42, ...], // green band
  [42, 42, ...], // blue band
  [255, 255, ...] // alpha band
];
guessImageLayout({ data: bands });
// { layout: "[band][row,column]", bands: 4, height: undefined, width: undefined }

advanced usage

If you already know the array of layout of the data, you can pass that in and it will calculate what it can.

import guessImageLayout from "guess-image-layout";

const rgba = [123, 234, 42, 255, 124, 42, 42, 255, ...];

guessImageLayout({ data: rgba, layout: "[band][row,column]" })
// { "bands": 4, "layout": "[band][row,column]", height: undefined, width: undefined }

Keywords

FAQs

Package last updated on 25 Jun 2022

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