Skip to content

samdaltonmaag/node-jpeg-recompress-bin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

jpeg-recompress (part of JPEG Archive) Node.js wrapper that optimize JPEG images.

Compress JPEGs by re-encoding to the smallest JPEG quality while keeping perceived visual quality the same and by making sure huffman tables are optimized. This is a lossy operation, but the images are visually identical and it usually saves 30-70% of the size for JPEGs coming from a digital camera, particularly DSLRs. By default all EXIF/IPTC/XMP and color profile metadata is copied over, but this can be disabled to save more space if desired.

Build Status NPM version Dependency Status devDependency Status

Install

$ npm install -g jpeg-recompress-bin

Usage with Node.js

var execFile = require('child_process').execFile;
var jpegRecompress = require('jpeg-recompress-bin').path;

execFile(jpegRecompress, ['--quality high', '--min 60', 'input.jpg', 'output.jpg'], function(err) {
  if (err) {
    throw err;
  }
  
  console.log('Image minified');
});

License

This is licensed under BSD. JPEG Archive is also licensed under MIT.

About

jpeg-recompress (part of JPEG Archive) node.js wrapper that optimize JPEG images.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%