Uncommon Functions

These are the lesser of used functions. These are useful for very specialized operations.

APPEND

Append images together either horizontally or vertically

{
  "name": "append",
  "params": {
    "other_images": "http://placekitten.com/421/540,http://placekitten.com/422/540",
    "vertical": false
  }
}

Optional:

  • vertical : Whether images are appended vertically(true) or horizontally(false)
  • other_images : Comma separated list of urls to other images

EXAMPLE:




AUTO ENHANCE

Automatically ‘enhances’ (magic wand) an image.

{
  "name": "auto_enhance"
}



BLUR

Blurs an image using Guassian blur.

{
  "name": "blur"
}

Optional:

  • sigma : Gaussian sigma of blur (defaults to 1.0)
  • radius : Gaussian radius of blur (defaults to 0.0)}



DESKEW

Deskews an image (if it's slightly misaligned). Useful for images of documents.

{
  "name": "deskew",
  "params": {}
}

Optional:

  • threshold : Maximum threshold percentage for deskewing (Default = 0.40)


DENSITY

Changes the exif density and will resize based on current set density

{   
  "name":"density",    
  "params":
    {        
      "dpi":"200"    
    }
}

Required:

  • dpi : Sets the DPI of the image


DESPECKLE

Reduces the speckle noise while preserving the edges

{
  "name": "despeckle",
  "params": {}
}



DISSOLVE

Composites with transparency

{
  "name": "dissolve",
  "params": {
    "src": "http://mysite/image_to_overlay",
    "src_percentage": 0.3
  }
}

Required:

  • src : Url of image you wants composited on top of original image

Optional:

  • scale_to_fit : { “width” : width, “height” : height }, to automatically scale src to fit within specific size. Can also be percentage if suffixed with >#/li###
  • scale_to_fill : { “width” : width, “height” : height }, to automatically scale src to fill the area defined. Can also be percentage if suffixed with >#/li###
  • scale_to_match : “true” or “false” to automatically scale src to the same size as current image (defaults to false)
  • as_mask : “true” or “false” to use src as a greyscale mask (defaults to false)
  • x : X offset of where to place image on original image
  • y : Y offset of where to place image on original image
  • gravity : Instead of x,y you could use gravity.
  • src_percentage : Percentage (0.0-1.0) of alpha on overlayed image (default 0.25)
  • dst_percentage : Percentage (0.0-1.0) of alpha on original (bottom) image (default 1.0)

EXAMPLE:




IMAGE GRID

Builds a grid of input images

{
    "name": "image_grid",
    "params": {
        "images": ["https://s3.amazonaws.com/img.blitline/skysmall.jpg", "https://unsplash.it/200/300/?random", "https://unsplash.it/200/300/?random", "https://unsplash.it/200/300/?random", "https://unsplash.it/200/300/?random", "https://unsplash.it/200/300/?random"],
        "cell_width": 200,
        "cell_height": 200,
        "columns": 3,
        "padding": 2,
        "color": "#ffda5a"
    }
}

Required:

  • images : Array of images to be placed into the grid
  • cell_width : Width of cell to output
  • cell_height : Height of cell to output
  • columns : Number of columns to display

Optional:

  • padding : Padding between cells
  • color : Color of padding

EXAMPLE




LIQUID RESCALE

Uses seam carving to reduce image size

{
  "name": "liquid_rescale",
  "params": {
    "width": 1000,
    "height": 1000
  }
}

Required:

  • width : Target width
  • height : Target height

Optional:

  • delta_x : Maximum seam transversal step (default 0)
  • rigidity : Bias for non-straight seams (default 0)

EXAMPLE




PAD

Add empty space to one side or all sides of image (Useful for centering an image on a new canvas color)

{
  "name": "pad",
  "params": {
    "size": 30
  }
}

Required:

  • size : Thickness of padding

Optional:

  • gravity : Location of padding (default “CenterGravity”)
  • color : Color of padding (default “#ffffff”)

EXAMPLE




PIXELATE

Pixelates an area on an image (blurs out an area and makes it look like pixels are blurred)

{
  "name": "pixelate",
  "params": {
    "size": 30
  }
}

Optional:

  • x : X position of starting area on image (default 0)
  • y : Y position of starting area on image (default 0)
  • width : Width of area to pixelate (defaults to width of original image)
  • height : Height of area to pixelate (defaults to height of original image)
  • amount : 1-100 value representing the amount to pixelate

EXAMPLE




ROTATE

Rotates the image.

{
  "name": "rotate",
  "params": {
    "amount": 90
  }
}

Required:

  • amount : The number of degrees to rotate the image.


SCRIPT

Run your own scripts on Blitline cloud servers. Perfect for using your own ImageMagick scripts

{
  "name": "script",
  "params": {
    "bash_string": "convert input.png -trim output.png"
  }
}

Optional:

  • bash_string : String representation of a bash file that will execute on the server (requires NO ‘executable’ or ‘files)
  • files : Extra files to download before the script is run (requires ‘executable’)
  • executable : Command line to run script (requires ‘files’)

Example: http://www.blitline.com/docs/scripts




TRIM

Makes a ‘best guess’ crop to upper-left and lower-right corners. For example, if you have an image with a bunch of white border around it, and you want it cropped to only where there something other than the border color.

{
  "name": "trim",
  "params": {}
}

Optional:

  • fuzz : Fuzz the trimming edge. For JPEGs, due to compression or anti-aliasing often times edges aren’t a clean line. The “fuzz” values allows you to trim with a slight extra fuzz around the trim area. (Defaults to 0.0, valid values are 0.0 - 1.0)



UNSHARP MASK

Sharpens an image

{
  "name": "unsharp_mask",
  "params": {}
}

Optional:

  • sigma : Gaussian operator (defaults to 1.0)
  • radius : Gaussian operator (defaults to 0.0)
  • amount : The percentage of the blurred image to be added to the receiver, specified as a fraction between 0 and 1.0 (defaults to 1.0)
  • threshold : The threshold needed to apply the amount, specified as a fraction between 0 and 1.0 (defaults to 0.05)}




Did this page help you?