DuQuant(suffixopt, qualityopt, pngquantPathopt)

A class used to easily compress png files using pngquant

new DuQuant(suffixopt, qualityopt, pngquantPathopt)

Constructs a new PNGQuant instance The constructor will try to find the pngquant binary in the same folder as DuQuant, or a (pngquant) subfolder, or in the scripts folder of After Effects. If pngquant is not in one of those, the property pngquantPath will be an empty string, and it has to be set by the user.
Parameters:
Name Type Attributes Default Description
suffix string <optional>
_DuQuant The suffix added to compressed files. Using an empty string will overwrite input files.
quality int <optional>
85 range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the quality.
pngquantPath string <optional>
The path to the pngquant binary. Will try to extract or auto find it if not set
Properties:
Name Type Description
pngquantPath string The path to the pngquant binary. Will try to extract or auto find it if not set
suffix string The suffix added to compressed files. Using an empty string will overwrite input files.
quality int range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the quality.
queue Array.<File> | Array.<Folder> An Array of File or Folder objects to compress.

Methods

compress(filesopt)

Launches compression on queue
Parameters:
Name Type Attributes Default Description
files Array.<File> | Array.<Folder> <optional>
DuQuant.queue The File or Folder objects to compress.

compressFolder(path)

Launches compression on all files in a given folder
Parameters:
Name Type Description
path string The path to the folder containing files

setPngquantPath(pathopt)

Sets the path to the pngquant binary executable
Parameters:
Name Type Attributes Description
path pngquantPath <optional>
The path to the pngquant binary executable. If not provided, DuAEF will extract the binary if it has been included, or try to find it in common folders.