density

Specifies the image resolution. Sets an attribute and does not alter the underlying raster image.

parameters

 

  • density: the density of the image in pixels per unit, as a couple of integer separated by × (or x), Cannot be combined with neither horizontal density nor vertical density.

  • horizontal density: the horizontal density of the image in pixels per unit. Cannot be combined with the density parameter. If the vertical parameter is omitted, it will be considered at the same value.

  • vertical density: the horizontal density of the image in pixels per unit. Cannot be combined with the density parameter. If the horizontal parameter is omitted, it will be considered at the same value.

  • quality: the quality of file for type which handle it (jpeg, mpeg, png, mng, tiff, miff, bpg, webp…​). It’s a positive integer, usually from 0 (or 1) to 100, the lowest means the lowest quality, the highest means highest quality.

  • unit: the unit of dimension for density.

    • by default, unit is inches

    • could be set in pixels per centimeters

JSON object properties

  • density: density

  • horizontal: horizontal density

  • vertical: vertical density

  • quality: quality

  • densityCentimeter: if present, a boolean to set if the unit is centimeter (true)

  • ppi: if present, a boolean to set if the unit is inches (true)

  • ppc: if present, a boolean to set if the unit is centimeters (true)

Only one of the three parameters densityCentimeter, ppi or ppc can be indicated.

simplified syntax parameters

  • prefix d: density

  • prefix hv: horizontal density

  • prefix vv: vertical density

  • prefix q: quality

array type parameters

The possible arrays are:

  • [density]

  • [horizontal density, vertical density]

By example :

{ "density": [300] }

Or

{ "density": [72,72] }

string type parameter

The value of the string is the density.

{ "density": "72×72" }

Example 1 - Set density to 300 DPI

Simplified syntax: d_300,c_density

Example 2 - Set density to 256 × 192 DPC

Simplified syntax: vh_256,vv_192,ppc,c_density