Less Common Functions

BACKGROUND COLOR

Sets the default background color for transparent images

{
  "name": "background_color",
  "params": {}
}

Optional:

  • color : Color you want for the background color (defaults to ‘#ffffff’)



NO OP

A no-op functions which just outputs the input as an image

{    
    "name":"no_op",    
  "params":{}
}



PAD RESIZE TO FIT

Resize to fit, but will pad to keep the aspect ratio. So for example, if you are going from a 3:4 aspect ratio to a 3:2 aspect ratio, this method will assure the result the desired output size, and pad the filled in area with a specified color.

{
  "name": "pad_resize_to_fit",
  "params": {
    "width": "300",
    "height": "200"
  }
}

Required:

  • width : Output width
  • height : Output height

Optional:

  • only_resize_larger : If set to true will only resize image if it’s larger then width or height (default false)
  • color : Color for the padding (defaults to “#ffffff”)
  • gravity : Location of output relative to padding (defaults to center)

EXAMPLE





Did this page help you?