1.1.0 • Published 4 years ago

jimp-roundcorners v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

jimp-roundedcorners

Rounds the corners of a Jimp image.

Install

npm i jimp-roundedcorners

Usage

import Jimp from 'jimp'
import { roundCornersFromPath, roundCorners } from 'jimp-roundcorners'

roundCornersFromPath('inPath', {
    outImgPath: 'outPath',
    cornerRadius: {
        topLeft: 25,
        topRight: 25,
        // bottomRight: 25,
        bottomLeft: 25,
        // If any of the above is not provided,
        // 'global' will be used instead
        // In this case 'bottomRight'.
        // If global is not prvided, the default value is
        // Math.min(img.bitmap.width, img.bitmap.height) / 10
        global: 50
    }
})
.then(res => { console.log(res.img, res.path) })
.catch(err => console.log(err))

Jimp.read('inPath')
.then(img => {
    roundCorners(img, {
        cornerRadius: {
            topLeft: 25,
            topRight: 25,
            // bottomRight: 25,
            bottomLeft: 25,
// If any of the above is not provided, 'global' will be used instead
// In this case 'bottomRight'.
// If global is not prvided, the default value is
// Math.min(img.bitmap.width, img.bitmap.height) / 10
            global: 50
        }
    }).write('outPath')
})
.catch(err => console.log(err))
1.0.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago