Skip to content

lynxtaa/img-convert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img-convert

Simple crossplatform converter for images.

Requires ImageMagick installed and added to PATH.

Install

npm install img-convert --save

Syntax

require('img-convert')(imgPath, targetPath[, params])
  • imgPath <string> path to image file for conversion

  • targetPath <string> path to converted image file

  • params <object> contains execution parameters

Returns Promise which fulfills to targetPath.

Optionally you can specify the path for ImageMagick binary:

require('img-convert').path = "path/to/converter"

Usage

const imgConvert = require('img-convert')
imgConvert('~/picture.png', '~/thumbs/small_picture.gif', { resample: 96, resize: '50%' })
  .then(targetPath => {
    console.log(targetPath)  // '/mnt/d/thumbs/small_picture.gif'
  })
  .catch(console.log.bind(console))

About

NPM package for converting images via ImageMagick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published