Getting Started

​ ​Welcome

Blitline Job

Job Response

Job Options

Functions

Polling and Postbacks

Gotchas

Development Recommendations

Service Limits

Examples List

List of Available Functions

Output Options

S3 Destination

IAM Users

S3 Signed Url

Azure Destination

FTP Destination

Other Service Signed Urls

CDN

Advanced

Metadata

Colorspace

Color Extraction

Static IPs

Signed Jobs

Formats

Pipelines

Image Optimization

Smart Image

PDF

Fonts

Subimage

Special (Non-Image) Processing

AWS Rekognition/Facial Recognition

Apache Tika

Vector Processing

Animated GIFs

Screenshots of Websites

IM Scripts

Video Keyframes

Zipping

​ ​Trancoding Video Presets

​ ​Video Transcoding

List of Available Functions

Updated a month ago ​by Blitline Support

Below is a list of all the available Blitline functions.

ANNOTATE

Adds text to an image

Sample:

{
    "name":"annotate",
    "params":{
        "text":"my_text",
        "color":"#ffffff"
    }
}

Required:

  • text : Text to be placed on image

Optional:

  • x : X offset (defaults to 0)
  • y : Y offset (defaults to 0)
  • color : Color of text (defaults to ‘#ffffff’)
  • style : “normal” or “italic” or “oblique” (defaults to “normal”)
  • kerning : Distance between letters (defaults based on font)
  • font_weight : “bold” or “normal” (defaults to “bold”)
  • font : Font of text (defaults to ‘Arial’) 
    Need an Open Source font added? Write us at support@blitline.com
  • point_size : Size of text (defaults to 32)
  • stretch : Stretch value (Normal/Expanded/Condensed)
  • stroke : Color of stroke (defaults to “transparent”)
  • dropshadow _color : Adds a dropshadow of a specified color
  • dropshadow _offset : Pixels down/right for dropshadow, if dropshadow_color is set. 
    (defaults to 3)
  • gravity : Placement of text (defaults to ‘CenterGravity’)


Example: http://www.blitline.com/docs/gist_runner?gist_id=5437247


APPEND

Appends images together either vertically or horizontally


Sample:

{
    "name":"append",
    "params":{
        "vertical":false
    }
}


Optional:

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


Example: http://www.blitline.com/docs/gist_runner?gist_id=5437148


AUTO LEVEL

Automatically adjusts the levels the color channels of an image


Sample:

{
    "name":"auto_level"
}


AUTO GAMMA

Automatically adjusts the brightness levels of the channels of an image


Sample:

{
    "name":"auto_gamma"
}


AUTO ENHANCE

Automatically ‘enhances’ (magic wand) an image.


Sample:

{
    "name":"auto_enhance"
}


BLUR

Blurs an image


Sample:

{
    "name":"blur"
}


Optional:

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


BACKGROUND COLOR

Sets a transparent background color to be a solid (useful when converting pngs to jpgs)


Sample:

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


Optional:

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


COMPOSITE

Composites one image onto another


Sample:

{
    "name":"composite",
    "params":{}
}


Required:

  • src : Url of image you wants composited with original image

Optional:

  • scale_to_fit : { “width” : width, “height” : height }, to automatically scale src specific size. Can also be percentage if prefixed with %
  • scale_to_match : “true” or “false” to automatically scale src to the same size as current image (defaults to false)
  • scale_to_fill : { “width” : width, “height” : height }, to automatically scale src to fill specific size. Can also be percentage if prefixed with %
  • 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.
  • composite_op : How composite is to be applied. Defaults to “OverCompositeOp” (which means it will just be layed on top of original image). See “Composite Ops” section below for more options


Example: http://www.blitline.com/docs/gist_runner?gist_id=5095014


CONTRAST

Adjusts contrasts within the image.


Sample:

{
    "name":"contrast",
    "params":{}
}


Optional:

  • sharpen : Contrast is increased if true (defaults to false)


CAPTION

Annotates an image with text autowrap feature.


Sample:

{
    "name":"caption",
    "params":{ "text" : "Sample Text" }
}


Required:

  • text : Text to be placed on image

Optional:

  • x : X offset (defaults to 0)
  • y : Y offset (defaults to 0)
  • width : Width of text area, either in pixels or percentage (ie. ‘90%’)
  • height : Height of text area, either in pixels or percentage (ie. ‘90%’)
  • color : Color of text (defaults to ‘#ffffff’)
  • font_weight : “bold” or “normal” (defaults to “bold”)
  • font : Font of text (defaults to ‘Arial’) 
    Need an Open Source font added? Write us at support@blitline.com
  • text_gravity : Where to align text, defaults to CenterGravity
  • point_size : Size of text
  • gravity : Placement of text (defaults to ‘CenterGravity’)


Example: http://www.blitline.com/docs/gist_runner?gist_id=8f12eeee40e5bb5ec299


CONTRAST STRETCH CHANNEL

Adjusts contrasts within the image.


Sample:

{
    "name":"contrast_stretch_channel",
    "params":{
        "black_point":10
    }
}


Required:

  • black_point : Burn at most this many pixels. Specify an absolute number of pixels as a numeric value

Optional:

  • white_point : Burn at most this many pixels. Specify an absolute number of pixels as a numeric value. If not given defaults to all_points-black_point


CONVERT COMMAND

Advanced function with direct access to IM’s convert command.


Sample:

{
    "name":"convert_command",
    "params":{}
}


Optional:

  • **** : Each param is an option. If the option has a value, set the value, otherwise leave as empty string.


Example: http://blog.blitline.com/post/40641947670/convert-command


CROP

Crop an image to a specific size. 

Note: This is not used very often. You are probably looking for “resize_to_fill”.


Sample:

{
    "name":"crop",
    "params":{
        "x":0,
        "y":0,
        "width":10,
        "height":10
    }
}


Required:

  • width : Width of resulting image

Optional:

  • height : Height of resulting image
  • x : X offset
  • y : Y offset
  • preserve_aspect_if_smaller : If source image is smaller than target size, crop smaller image to still be same aspect ratio (default false)
  • gravity : Sets the starting gravity of where the x,y will offset from


Example: http://www.blitline.com/docs/gist_runner?gist_id=5109149


CROP TO SQUARE

Crop an image to a sqaure, based on height vs width. Square side length will be the smaller of the 2.


Sample:

{
    "name":"crop_to_square",
    "params":{}
}


Optional:

  • gravity : Gravity of resulting crop (default CenterGravity)


Example: http://www.blitline.com/docs/gist_runner?gist_id=5294156


DELETE PROFILE

Deletes color profile information.


Sample:

{
    "name":"delete_profile",
    "params":{}
}


Required:

  • name : Name of the profile to remove (or * to remove wildcard)

DESKEW

Tries to relalign a slightly distorted image. (Typically used in scanning and OCR)


Sample:

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


Optional:

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


DENSITY

Sets the DPI of an image


Sample:

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


Required:

  • dpi : Sets the DPI of the image

DESPECKLE

Reduces the speckle noise while preserving the edges


Sample:

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


DISSOLVE

Composites with transparency


Sample:

{
    "name":"dissolve",
    "params":{}
}


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: http://www.blitline.com/docs/gist_runner?gist_id=5095014


ELLIPSE

Draws an ellipse


Sample:

{
    "name":"ellipse",
    "params":{
        "origin_x":100,
        "origin_y":100,
        "ellipse_width":50,
        "ellipse_height":30,
        "stroke_width":5,
        "color":"#ffffff",
     }
}


Required:

  • origin_x : Center X coordinate
  • origin_y : Center Y coordinate
  • ellipse_width : Width of ellipse
  • ellipse_height : Height of ellipse

Optional:

  • color : Color of stroke (default “#ffffff”)
  • stroke_width : Width of ellipse perimeter(stroke) line (default 0, no stroke)
  • stroke_opacity : Opacity of stroke (default 1.0)
  • fill_color : Color to fill the ellipse with (defaults to ‘color’ value)
  • fill_opacity : Opacity of fill (defaults to 1.0)


Example: http://www.blitline.com/docs/gist_runner?gist_id=8200526


ENHANCE

Reduces noise in the image


Sample:

{
    "name":"enhance",
    "params":{}
}


EQUALIZE

Equalizes an image (Auto-adjust image).


Sample:

{
    "name":"equalize",
    "params":{}
}


GAMMA CHANNEL

Adjusts contrasts within the image.


Sample:

{
    "name":"gamma_channel",
    "params":{
        "gamma":1.0
    }
}


Required:

  • gamma : Gamma adjustent (Usually 0.8 to 2.3)

GRAY COLORSPACE

Turns image into grayscale.


Sample:

{
    "name":"gray_colorspace",
    "params":{}
}


IMAGE GRID

Builds a grid of input images


Sample:

{
"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: https://www.blitline.com/v3/home/gist?gist_id=af4943b5e1297b5214494d2ed600e7a5


IMAGGA SMART CROP

Uses Imagga image analysis tools to determine the best crop for you photo. This requires a Blitline+Imagga subscription.


Sample:

{
  "name":"imagga_smart_crop",
  "params":{
    "resolution" : "150x150"
   }
}


Required:

  • resolution : The height and width of the desired cropped image. (Height and width are separated by a lower case ‘x’)

Optional:

  • no_scaling : Optional setting to not autoscale image, but to crop the raw original to the target area. Defaults to false


Example: http://www.blitline.com/docs/gist_runner?gist_id=58d9007c1a7c304c254b


LINE

Draws a linear line between two points.


Sample:

{
    "name":"line",
    "params":{
        "x":10,
        "y":10,
        "x1":50,
        "y1":50,
        "width":1,
        "color":"#ffffff",
        "opacity":1.0,
        "line_cap":"butt"
    }
}


Required:

  • x : Starting X coordinate
  • y : Starting Y coordinate
  • x1 : Ending X coordinate
  • y1 : Ending Y coordinate

Optional:

  • width : Width of line (default 1)
  • color : Color of line (default “#ffffff”)
  • opacity : Opacity of line (default 1.0)
  • line_cap : How the line ends. Only relevant for widths > 1. Two possible options are “butt”(default) and “round”(rounds ends).


LEVEL

Levels channels of image


Sample:

{
    "name":"level",
    "params":{
  }
}


Required:

Optional:

  • channel : Channel to operate on (defualt AllChannels)
  • black_point : Starting black point (default 0.0)
  • white_point : Ending white point (default 65535.0)
  • gamma : Gamma offset


LEVELIZE

Inverse of ‘level’


Sample:

{
    "name":"level",
    "params":{
  }
}


Required:

Optional:

  • channel : Channel to operate on (defualt AllChannels)
  • black_point : Starting black point (default 0.0)
  • white_point : Ending white point (default 65535.0)
  • gamma : Gamma offset


LIQUID RESCALE

Uses seam carving to reduce image size


Sample:

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


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: http://www.blitline.com/docs/gist_runner?gist_id=5778e028450aece00814


MEDIAN FILTER

Applies a digital filter that improves the quality of a noisy image. Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.


Sample:

{
    "name":"median_filter",
    "params":{}
}


Optional:

  • radius : Radius of blur (defaults to 1.0)


MODULATE

Changes the brightness, saturation, and hue.


Sample:

{
    "name":"modulate",
    "params":{}
}


Optional:

  • Brightness : Brightness adjustment (defaults to 1.0)
  • Saturation : Brightness adjustment(defaults to 1.0)
  • Hue : Hue adjustment (defaults to 1.0)


NO OP

Simple noop(no operation). No function performed on image. 

(If you are using this to move your original, please see ‘move original’ @ http://www.blitline.com/docs/b... instead)


Sample:

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


NORMALIZE

Changes the contrast of a color image by adjusting the pixel color to span the entire range of colors available.


Sample:

{
    "name":"normalize",
    "params":{}
}


PAD

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


Sample:

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


Required:

  • size : Thickness of padding

Optional:

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


Example: http://www.blitline.com/docs/gist_runner?gist_id=5437331


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.


Sample:

{
    "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: http://www.blitline.com/docs/gist_runner?gist_id=5437355


PHOTOGRAPH

Creates an image that has a white border, with a slight curl, that appears like a photograph


Sample:

{
    "name":"photograph",
    "params":{}
}


Optional:

  • angle : Angle of rotation


PIXELATE

Pixelates an area on an image


Sample:

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


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: http://www.blitline.com/docs/gist_runner?gist_id=6380380


QUANTIZE

Analyzes the colors within a reference image and chooses a fixed number of colors to represent the image


Sample:

{
    "name":"quantize",
    "params":{
        "number_colors":8
    }
}


Required:

  • number_colors : Number of colors to reduce to

Optional:

  • color_space : The colorspace to quantize in (defaults to “RGBColorspace”)
  • dither : Whether or not to use dithering on the resulting image (defaults to “false”)


RECTANGLE

Draws a rectangle


Sample:

{
    "name":"rectangle",
    "params":{
        "x":10,
        "y":10,
        "x1":50,
        "y1":50,
        "stroke_width":5,
        "color":"#ffffff",
        "opacity":1.0,
    }
}


Required:

  • x : Starting X coordinate
  • y : Starting Y coordinate
  • x1 : Ending X coordinate
  • y1 : Ending Y coordinate

Optional:

  • color : Color of stroke (default “#ffffff”)
  • stroke_width : Width of rectangle perimeter(stroke) line (default 0, no stroke)
  • stroke_opacity : Opacity of stroke (default 1.0)
  • fill_color : Color to fill the rectangle with (defaults to ‘color’ value)
  • fill_opacity : Opacity of fill (defaults to 1.0)
  • ch : corner height. If present, will cause rounded corners, and REQUIRES ‘cw’ attribute as well
  • cw : corner width. If present, will cause rounded corners, and REQUIRES ‘ch’ attribute as well


Example: http://www.blitline.com/docs/gist_runner?gist_id=8200545


RESAMPLE

Resample the image to a new resolution


Sample:

{
    "name":"resample",
    "params":{
        "density":72.0
    }
}


Required:

  • amount : The density of the outputted image. (defaults to 72.0)

RESIZE

Resize the image to a specific height and width. 

Note: This is not used very often. You are probably looking for “resize_to_fit”.


Sample:

{
    "name":"resize",
    "params":{
        "width":10,
        "height":10
    }
}


Required:

  • width : The new width of the image
  • height : The new height of the image

Optional:

  • scale_factor : Instead of height and width you can set a scale factor. (eg 0.5 = 50%)


RESIZE TO FILL

Resize the image to fit within the specified dimensions while retaining the aspect ratio of the original image. If necessary, crop the image in the larger dimension 

Common English Translation: This is probably the crop you want if you want to cut a center piece out of a photo and use it as a thumbnail. This will cut out the center (by default) to your defined size.


Sample:

{
    "name":"resize_to_fill",
    "params":{
        "width":40,
        "height":40
    }
}


Required:

  • width : Width of desired image
  • height : Height of desired image

Optional:

  • autosharpen : Automatically sharpens image after resize
  • only_shrink_larger : Don’t upsize image (defaults to false)
  • gravity: Force edge to align


Example: http://www.blitline.com/docs/gist_runner?gist_id=5205228


RESIZE TO FIT

Resize the image to fit within the specified dimensions while retaining the original aspect ratio. The image may be shorter or narrower than specified in the smaller dimension but will not be larger than the specified values

Common English Translation: This is probably the crop you want if you need to rescale a photo down to a smaller size while keeping the same height to width ratio.


Sample:

{
    "name":"resize_to_fit",
    "params":{
        "width":40,
        "height":40
    }
}


Required:

  • width : Width of desired image (optional if height defined)
  • height : Height of desired image (optional if width defined)

Optional:

  • only_shrink_larger : Don’t upsize image (defaults to false)
  • autosharpen : Automatically sharpens image after resize
  • gravity: Force edge to align

ROTATE

Rotates the image.


Sample:

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


Required:

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

SCALE

Resize the image to a specific height and width. 

Note: This is not used very often. You are probably looking for “resize_to_fit”.


Sample:

{
    "name":"scale",
    "params":{
        "width":10,
        "height":10
    }
}


Required:

  • width : The new width of the image
  • height : The new height of the image

Optional:

  • scale_factor : Instead of height and width you can set a scale factor. (eg 0.5 = 50%)


SCRIPT

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


Sample:

{
    "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


SEPIA TONE

Applies sepia filter


Sample:

{
    "name":"sepia_tone",
    "params":{}
}


Optional:

  • threshold : Threshold for quantizing sepia tone


SHARPEN

Sharpens the image


Sample:

{
    "name":"sharpen",
    "params":{}
}


Optional:

  • sigma : Gaussian sigma of sharpen (defaults to 1.0)
  • radius : Gaussian radius of shapen (defaults to 0.0)


SKETCH

Simulates a pencil sketch.


Sample:

{
    "name":"sketch",
    "params":{}
}


Optional:

  • sigma : Gaussian operator (defaults to 0.0)
  • radius : Gaussian operator (defaults to 0.0)
  • angle : Angle of sketch (defaults to 0.0)}


STEGANO

Embeds a hidden watermark in the image. 

NOTE: Watermark image must be a greyscale image, AND image saved to your destination MUST be PNG. Jpeg compression obscures IM stegano signature.


Sample:

{
    "name":"stegano",
    "params":{ "watermark_url" : "http://www.mysite.com/watermark.png"}
}


Required:

  • watermark_url : Url of watermark to embed in image (must be grayscale)

Optional:

  • offset : Pixel offset from beginning of image to embed hidden watermark (defaults to 0.0)


TILE

Tiles a src image over the current image.


Sample:

{
    "name":"tile",
    "params":{ "src":"http://https://s3.amazonaws.com/img.blitline/test_pngs/apple.png" }
}


Required:

  • src : Smaller image to be tiled on top of image

Optional:

  • scale : Scale factor for ‘src’ image (in the event it needs to be scaled) (defaults to 1.0)
  • width : Resize ‘src’ to width, requires height as well(if set, scale is ignored)
  • height : Resize ‘src’ to height, requires width as well(if set, scale is ignored)


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.


Sample:

{
    "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


Sample:

{
    "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)}


VIGNETTE

Gradually shades the edges of the image by transforming the pixels into the background color.


Sample:

{
    "name":"vignette",
    "params":{}
}


Optional:

  • color : Background color to fade to (default is ‘#000000’)
  • x : Influences the amount of background color in the horizontal dimension. (default = 10)
  • y : Influences the amount of background color in the vertical dimension. (default = 10)
  • threshold : The threshold needed to apply the amount, specified as a fraction between 0 and 1.0 (defaults to 0.05)
  • sigma : Gaussian operator (defaults to 10.0)
  • radius : Gaussian operator (defaults to 0.0)


WATERMARK

Adds a text watermark to an image. For more control use ‘annotate’


Sample:

{
    "name":"watermark",
    "params":{
        "text":"Image processing by Blitline"
    }
}


Required:

  • text : Text to add to image

Optional:

  • gravity : Relative positioning of text (default is ‘CenterGravity’)
  • point_size : Point size of text. (default = 94)
  • font_family : Font family of text. (default = ‘Helvetica’)
  • opacity : The opacity of the text on the image (defaults to 0.45)


Example: http://www.blitline.com/docs/gist_runner?gist_id=5437386


How did we do?