1.2.1 • Published 1 year ago

imgpress v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

imgpress - Image Compressor

Description

This is a simple image compressor that uses the sharp package to compress images.

Global Installation & Usage

Installation cli (globally)

npm i -g imgpress

Compressing a single image from cli

imgpress s -i <input> -o <output> -q <quality> -w <width> -h <height> -p <webp compression for png files>

If no output is specified, the output will be OriginalFile_processed.ext

Compressing multiple images in a directory from cli

imgpress f -i <input-directory> -o <output-directory> -q <quality> -w <width> -h <height> -p <webp compression for png files>

If no output directory is specified, the output directory will be "_processed" in the input directory.

Project Installation & Usage

Project-level Installation

npm i imgpress

Compressing a single image in node project

import { Compressor } from 'imgpress';

await Compressor.imageCompress('./original.jpg', './processed.jpg', {
  quality: 80, //default is 80
  maxWidth: 1000, //default is 1000
  maxHeight: 1000, //default is 1000
  pngToWebp: false // default is false, only works for png files
});

Compressing multiple images in a directory in node project

import { Compressor } from 'imgpress';

await Compressor.folderCompress('./originals', './processed', {
  quality: 80, //default is 80
  maxWidth: 1000, //default is 1000
  maxHeight: 1000, //default is 1000
  extensions: ['jpg', 'png', 'jpeg'], //default is ['jpg', 'png', 'jpeg'], images to process by extension
  pngToWebp: false // default is false, only works for png files
});
1.2.0

1 year ago

1.1.1

1 year ago

1.2.1

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago