File Output Options - mpaperno/TouchPortal-Dynamic-Icons GitHub Wiki

Image File Output Options per Format

These are the options available per output type in the "Save Icon To File" action (added in plugin version 1.3). The output type is determined based on the extension of the specified file (.png, .jpg, etc).

Notes:

  • Option names are case-sensitive.
  • String type values should be quoted.
  • Boolean type values must be specified as true or false, not numbers.
  • Some option names have alternate spellings with equivalent meaning (eg. "colors" and "colours").

Options format example:
quality=90, smartSubsample=true, preset="icon"

AVIF

Option Type Default Description
quality number 50 quality, integer 1-100
lossless boolean false use lossless compression
effort number 4 CPU effort, between 0 (fastest) and 9 (slowest)
chromaSubsampling string "4:4:4" set to "4:2:0" to use chroma subsampling

GIF

Option Type Default Description
progressive boolean false use progressive (interlace) scan
colors
colours
number 256 maximum number of palette entries, including transparency, between 2 and 256
effort number 7 CPU effort, between 1 (fastest) and 10 (slowest)
dither number 1.0 level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most)

JPEG

Option Type Default Description
quality number 80 quality, integer 1-100
progressive boolean false use progressive (interlace) scan
chromaSubsampling string "4:2:0" set to "4:4:4" to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling
optimiseCoding
optimizeCoding
boolean true optimise Huffman coding tables
mozjpeg boolean false use mozjpeg defaults, equivalent to trellisQuantisation=true, overshootDeringing=true, optimiseScans=true, quantisationTable=3
trellisQuantisation boolean false apply trellis quantisation
overshootDeringing boolean false apply overshoot deringing
optimiseScans
optimizeScans
boolean false optimise progressive scans, forces progressive
quantisationTable
quantizationTable
number 0 quantization table to use, integer 0-4
0 - sharper
1 - neutral
2 - smoother
3 - balanced
4 - accurate

PNG

By default, PNG output is full color with alpha at 8 bits per pixel (aka. PNG-24). Set palette = true (or any of the options which imply it) to produce indexed color output with maximum of 256 colors plus alpha (aka. PNG-8).

Option Type Default Description
progressive boolean false use progressive (interlace) scan
compressionLevel number 6 zlib compression level, 0 (fastest, largest) to 9 (slowest, smallest)
adaptiveFiltering boolean false use adaptive row filtering
palette boolean false quantise to a palette-based image with alpha transparency support
quality number 100 use the lowest number of colours needed to achieve given quality, sets palette to true
effort number 7 CPU effort, between 1 (fastest) and 10 (slowest), sets palette to true
colors
colours
number 256 maximum number of palette entries, sets palette to true
dither number 1.0 level of Floyd-Steinberg error diffusion, sets palette to true

TIFF

Option Type Default Description
quality number 80 quality, integer 1-100
compression string "jpeg" compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k
predictor string "horizontal" compression predictor options: none, horizontal, float
pyramid boolean false write an image pyramid
tile boolean false write a tiled tiff
tileWidth number 256 horizontal tile size
tileHeight number 256 vertical tile size
xres number 1.0 horizontal resolution in pixels/mm
yres number 1.0 vertical resolution in pixels/mm
resolutionUnit string "inch" resolution unit options: inch, cm
bitdepth number 8 reduce bitdepth to 1, 2 or 4 bit
miniswhite boolean false write 1-bit images as miniswhite

WebP

Option Type Default Description
quality number 80 quality, integer 1-100
alphaQuality number 100 quality of alpha layer, integer 0-100
lossless boolean false use lossless compression mode
nearLossless boolean false use near_lossless compression mode
smartSubsample boolean false use high quality chroma subsampling
smartDeblock boolean false auto-adjust the deblocking filter, can improve low contrast edges (slow)
preset string "default" named preset for preprocessing/filtering, one of: default, photo, picture, drawing, icon, text
effort number 4 CPU effort, between 0 (fastest) and 6 (slowest)

Original source: https://sharp.pixelplumbing.com/api-output

⚠️ **GitHub.com Fallback** ⚠️