This is a bin wrapper for OxiPNG for use with
imagemin
and theimagemin-oxipng
plugin.
You probably want the @vheemstra/imagemin-oxipng
plugin instead.
npm install --save oxipng-bin
import {execFile} from 'node:child_process';
import oxipng from 'oxipng-bin';
execFile(oxipng, [
'--opt', '4',
'--strip', 'safe',
'--out', 'output.png',
'input.png'
], err => {
if (err) {
throw err;
}
console.log('Image optimized!');
});
npm install --global oxipng-bin
oxipng --help
MIT © Imagemin
MIT © OxiPNG by Josh Holmer
This package is made by Philip van Heemstra
Based on jpegtran-bin by Sindre Sorhus
Info on building oxipng binaries