https://github.com/thinknathan/node-image-slice
Command-line tool that slices images and outputs the segments
https://github.com/thinknathan/node-image-slice
cli-tool gamedev-tool image-slicer node-cli
Last synced: 9 months ago
JSON representation
Command-line tool that slices images and outputs the segments
- Host: GitHub
- URL: https://github.com/thinknathan/node-image-slice
- Owner: thinknathan
- License: cc0-1.0
- Created: 2023-12-18T23:15:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-01T15:50:49.000Z (10 months ago)
- Last Synced: 2025-03-01T16:32:17.830Z (10 months ago)
- Topics: cli-tool, gamedev-tool, image-slicer, node-cli
- Language: JavaScript
- Homepage:
- Size: 464 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Simple Image Slicer
[](https://github.com/thinknathan/node-image-slice/actions/workflows/ci.yml) 
Command-line utility that slices input images into segments according to specified width and height, and outputs those segments into a folder.
## Install
1. Install [Nodejs](https://nodejs.org/en) or equivalent
2. Clone this project
`git clone https://github.com/thinknathan/node-image-slice`
3. Install dependencies
`npm i`
or
`yarn`
4. Install for command-line usage
`npm link`
## Usage
`slice`
```
-f, --filename Input image filename [string]
-i, --folderPath Input folder [string]
-w, --width Width of each slice [number] [required]
-h, --height Height of each slice [number]
-d, --canvasWidth Width of canvas for final output [number]
-g, --canvasHeight Height of canvas for final output [number]
-s, --scale Rescale the image up or down by this factor, after
slicing, but before canvas resize [number] [default: 1]
-c, --cubic Uses bicubic interpolation instead of nearest neighbour if
rescaling [boolean] [default: false]
```
- If `filename` does not include an extension, `.png`, `.gif`, `.jpg` and `.jpeg` will be guessed
- Valid input formats: `jpeg`, `png`, `bmp`, `tiff`, `gif`
- Output format is `.png`
- If `height` is not specified, `width` will be used as `height`
## Background
Created with Chat-GPT 3.5.