https://github.com/brendan-c/outline-image
Outlines blocks of color within PNG images using jimp
https://github.com/brendan-c/outline-image
Last synced: about 2 months ago
JSON representation
Outlines blocks of color within PNG images using jimp
- Host: GitHub
- URL: https://github.com/brendan-c/outline-image
- Owner: brendan-c
- Created: 2021-09-11T21:17:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-19T21:54:24.000Z (over 3 years ago)
- Last Synced: 2025-03-14T18:05:28.741Z (3 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Usage
`npm install outline-image`
## Example
```
const outlineImage = require('outline-image')outlineImage (
imagePath, // {string}
outputPath, // {string}
outlineColor, // {array [red, blue, green, alpha]} (represented as numbers 0-255)
// OR hex string}
trim = true // {boolean}
)
```## as CLI tool
```
// only accepts hex string
// trim {string 'trim'} optional
npx outline 'input.png' 'output.png' '#ffffff' 'trim'
```### Note:
This package is very limited in it's functionality. In it's current form (0.0.x), it has the following limitations:- Only draws outline on transparent pixels
- Input images (`imagePath`) must be PNG format and contain transparency
- Only draws 1px wide outline
- Adds full 1px transparent border prior to drawing outline to ensure full outline
- `trim` (optional, default = true) removes **all** excess transparent border after outline is drawn