0.1.20 • Published 5 years ago

image-glue v0.1.20

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

image-glue

Library to combine two images: npm.io + npm.io => npm.io

image-glue uses sharp. Great library, thanks! 👏

Installation

npm i --save image-glue

Use

import fs from 'fs'
import {merge} from 'image-glue'

const image1 = fs.readFileSync('./image1.jpg')
const image2 = fs.readFileSync('./image2.jpg')
const opts = { format: 'jpeg', background: { r: 150, g: 150, b: 150 }, output: { quality: 100 } }
merge([image1, image2], opts).then(combinedImage => fs.writeFileSync('./combined-image.jpg', combinedImage))

opts

PropertyExplanation
formatOutput format. Defaults to the format of the first image.
backgroundBackground color. Defaults to { r: 255, g: 255, b: 255 } if first image does not have the alpha channel. Defaults to { r: 0, g: 0, b: 0, alpha: 0 } if the first image does have the alpha channel
outputOutput properties. You can set quality like this: {quality: 1}
0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago