gulp-jpeg-2000
A gulp plugin for converting images to JPEG 2000 (JP2) using ImageMagick
$ yarn add gulp-jpeg-2000 -D
$ npm i gulp-jpeg-2000 -D
Make sure you have ImageMagick with the legacy tools installed on your system. This plugin uses ImageMagick's legacy command $ convert
that was changed to $ magick convert
in version 7.
Using Homebrew:
$ brew install imagemagick
Run $ convert -version
to ensure the version you've installed includes the legacy command. If you get an error from this command, try $ brew install imagemagick@6
.
Run $ convert -version
to see if ImageMagick is already installed. If not, use apt:
$ apt install imagemagick
Download ImageMagick. Check "install legacy tools" when installing.
Run $ convert -version
to ensure the legacy command was sym linked.
var gulp = require('gulp');
var jp2 = require('gulp-jpeg-2000');
function convertJP2() {
return gulp.src('src/images/**/*.{jpg,jpeg,png}')
.pipe(jp2())
.pipe(gulp.dest('dist/images'));
}
MIT © Courtney Pattison