layout (set position)

This command just places the image in an image of a certain size.

parameters

  • target size: size (dimension values) of the new image (width and height). Default is size of the image.

  • gravity: gravity value, location of the image (center by default)

  • location: coordinates (x and y) of the center of the source image in the target image

  • fill color: color value, color to fill the empty space

JSON object properties

  • width: width of the new image

  • height: height of the new image

  • gravity: gravity

  • x: the x (easting) of the center point of the source image in the target image

  • y: the y (northing) of the center point of the source image in the target image

  • background (or color): color to fill the empty space. Only classic color or $dom type color is allowed.

simplified syntax parameters

  • prefix w: the width of the target image

  • prefix h: the height of the target image

  • prefix g: the gravity

  • prefix x: the x (easting) of the center point of the source image in the target image

  • prefix y: the y (northing) of the center point of the source image in the target image

  • prefix bg: the color to fill empty space

array type parameters

The possible arrays are:

  • [width, height]

  • [gravity, width, height]

  • [color, width, height]

  • [color, gravity, width, height]

  • [gravity, color, width, height]

  • [x, y, width, height]

  • [gravity, x, y, width, height]

  • [color, x, y, width, height]

  • [color, gravity, x, y, width, height]

  • [gravity, color, x, y, width, height]

Example 1 - Simple layout

{ "layout":["dodgerblue",600,600] }

Maldives: W400×H225

Maldives: W600×H600

Simplified syntax: bg_dodgerblue,w_600,h_600,c_layout

Example 2 - Layout, specifying location

{ "layout":{ "gravity": "east", "y": 100, "width": 600, "height": 600, "background": "dodgerblue" } }

Maldives: W400×H225

Maldives: W600×H600

Simplified syntax: bg_dodgerblue,g_east,y_100,w_600,h_600,c_layout