@resize.to/transformer

0.0.3 • Public • Published

resize.to transformer

Greenkeeper badge Coverage Status

Uses Sharp and streams to transform an image. It is meant to be used with an options-parser. This is a building block for creating image transformation services.

Example of using it directly:

const fs = require('fs')
const inputPath = 'path/to/image.jpg'
const inputStream = fs.createReadStream(inputPath)
const outputPAth = 'path/to/transformed/image.jpg'
const outputStream = fs.createWriteStream(outputPath)
const transformer = new Transformer([
	backgroundalpha: 1,
	backgroundcolor: '#000',
	backgroundrgb: 'rgb(0, 0, 0)',
	blur: 10,
	fit: 'cover',
	gravity: 'center',
	height: 200,
	left: null,
	mirror: null,
	output: null,
	quality: 80,
	rotate: null,
	top: null,
	version: null,
	width: 400
], inputPath)
transformer.transform(inputStream, outputStream)

Readme

Keywords

none

Package Sidebar

Install

npm i @resize.to/transformer

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

7.36 kB

Total Files

8

Last publish

Collaborators

  • brandonaaron