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

9-slicer

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

9-slicer

Convert PNG to 9slice

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

9-slicer

Build Status npm license

Automatically judge the enlarged area and create 9 slice images

Examples

input

input.png

output

Sliced PNG

output.png

Parameters

{ width: 420,
  height: 240,
  left: 46,
  right: 45,
  top: 48,
  bottom: 48 }

Demo

9 SLICER

Distribution

npm

npm i -D 9-slicer

files

for CommonJS

for Browser

for ESModules

Usage

for CommonJS

const { readFileSync, writeFileSync }  = require('fs');
const { slice } = require('9-slicer');

const input = readFileSync('input.png');
const output = slice(input);

// Example of outputting only things that can be reduced by 30% or more
if(30 <= output.reduction){
  writeFileSync('output.png', output.buffer);
  writeFileSync('output.json', JSON.stringify(output.params));
}

Keywords

FAQs

Package last updated on 10 Dec 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