Namespace: image

image

Members

imagemagick

imagemagick library
Source:

Methods

<static> jpegoptim(filepath, options, callback)

jpegoptim
Parameters:
Name Type Description
filepath String JPEG file path.
options String jpegoptim options.
callback function
Source:
Example
var filepath = './test/image/logo.jpg';

<static> optim(path, options, callback)

run the optipng and jpegoptim
Parameters:
Name Type Description
path String JPEG|PNG file path.
options String options.
callback function
Source:
Example
var filepath = './test/image/logo.jpg';
var options = {
    optipng:   { use: true, options: "-o 2"},
    jpegoptim: { use: true, options: "--strip-all"}
    pngquant: { use: true, options: "--ext .png -f -v"}
}

<static> optimdir(dirpath, options, callback)

run the recursive directory of optipng and jpegoptim
Parameters:
Name Type Description
dirpath String directory root path
options String options.
callback function
Source:
Example
var filepath = './test/image/logo.jpg';
var options = {
    optipng:   { use: true, options: "-o 2"},
    jpegoptim: { use: true, options: "--strip-all"}
    pngquant: { use: true, options: "--ext .png -f -v"},
    limit: 10
}

<static> optipng(filepath, options, callback)

optipng
Parameters:
Name Type Description
filepath String PING file path.
options String optipng options.
callback function
Source:
Example
var filepath = './test/image/logo.png';

<static> pngquant(filepath, options, callback)

pngquant
Parameters:
Name Type Description
filepath String PNG file path.
options String pngquant options.
callback function
Source:
Example
var filepath = './test/image/logo.png';