1.2.2 • Published 6 years ago

transform-images v1.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

transform-images

Super simple function utility that resizes an image and normalizes it's channels using Jimp package


Maintainability Build Status Coverage Status dependencies Status devDependencies Status


Installation

npm i transform-images
yarn add transform-images
const transform = require('transform-images')

Usage

const source = 'https://images.unsplash.com/photo-1537557132238-b136d7e758ac'

const options = {
  width: 300,
  height: 180,
  output: 'image',
  outputFilename: './output.png',
  normalized: true,
  blur: true,
  blurRadius: 5,
  quality: 100
}

transform(source, options)
  .then(image => console.log('Done!'))
  .catch(error => console.error(error))

Return: Promise Either valid with an JIMP image object or a buffer, or rejected with an error

Source: string Either a valid URL or a path

Options: Object An object with desired options

PropertyTypeMandatoryDefaultDescription
widthnumberyes-Width of resized image
heightnumberyes-Height of resized image
normalizebooleannotrueApply normalization in brightness & contrast
outputstringnoimageOutput type, image or buffer
outputFilenamestringyes-Output filename when output is image
blurbooleannofalseSet to true if want to blur the image
blurRadiusnumberno5Spread radius of the blur
qualitynumberno100Quality of the JPG
1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago