🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

img-split

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

img-split

Split an into equally-sized parts

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

img-split

Split an <img> into equally-sized parts

Super Mario Bros. overworld tileset split into 16x16 fragments

install

npm install img-split

usage

const split = require('img-split')
const load = require('img-load')

load('./tiles.png', (error, image) => {
  if (error) throw error
  var tiles = split(image, 16, 16)
  for (var tile of tiles) {
    document.body.appendChild(tile)
  }
})

images = split(image, width, height)

Splits image into individual <canvas> elements of the dimensions described by width and height.

  • image: The HTMLImageElement to be split
  • width: The desired width of each resulting <canvas> element
  • height: The desired height of each resulting <canvas> element

license

MIT © Brandon Semilla

Keywords

split

FAQs

Package last updated on 06 Jun 2017

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