annotate

 

Adds text to an image


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"text"Text to be placed on image
"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_family"Font of text (defaults to 'Helvetica') <br>Need an Open Source font added? Write us at support@blitline.com
"point_size"Size of text (defaults to 32)
"stroke"Color of stroke (defaults to "transparent")
"dropshadow _color"Adds a dropshadow of a specified color
"dropshadow _offet"Pixels down/right for dropshadow, if dropshadow_color is set. <br>(defaults to 3)
"gravity" Placement of text (defaults to 'CenterGravity')

Example

append

 

Appends images together either vertically or horizontally


Looks like...

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

PARAMS:  Required / Optional

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

Example

blur

 

Blurs an image


Looks like...

{
    "name":"blur"
}

PARAMS:  Required / Optional

NameDescription
"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)


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"color"Color you want for the background color (defaults to '#ffffff')

composite

 

Composites one image onto another


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"src"Url of image you wants composited with original image
"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. (Gravity param overrides x,y values)
"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

contrast

 

Adjusts contrasts within the image.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"sharpen"Contrast is increased if true (defaults to false)

contrast stretch channel

 

Adjusts contrasts within the image.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"black_point"Burn at most this many pixels. Specify an absolute number of pixels as a numeric value
"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 (beta)

 

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"<Convert Options>"Each param is an option. If the option has a value, set the value, otherwise leave as empty string.

Example

crop

 

Crop an image to a specific size.

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"Width of resulting image
"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

crop to square

 

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"gravity"Gravity of resulting crop (default CenterGravity)

Example

delete profile

 

Deletes color profile information.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"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)


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"threshold"Maximum threshold percentage for deskewing (Default = 0.40)

density

 

Sets the DPI of an image


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"dpi"Sets the DPI of the image

despeckle

 

Reduces the speckle noise while preserving the edges


Looks like...

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

enhance

 

Reduces noise in the image


Looks like...

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

equalize

 

Equalizes an image (Auto-adjust image).


Looks like...

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

gamma channel

 

Adjusts contrasts within the image.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"gamma"Gamma adjustent (Usually 0.8 to 2.3)

imagga smart crop

 

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"resolution"The height and width of the desired cropped image. (Height and width are separated by a lower case 'x')
"no_scaling"Optional setting to not autoscale image, but to crop the raw original to the target area. Defaults to false

Example

line

 

Draws a linear line between two points.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"x"Starting X coordinate
"y"Starting Y coordinate
"x1"Ending X coordinate
"y1"Ending Y coordinate
"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).

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.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"radius"Radius of blur (defaults to 1.0)

modulate

 

Changes the brightness, saturation, and hue.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"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' HERE instead)


Looks like...

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


Looks like...

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"size"Thickness of padding
"gravity"Location of padding (default "CenterGravity")
"color"Color of padding (default "#ffffff")

Example

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.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"Output width
"height"Output height
"color"Color for the padding (defaults to "#ffffff")
"gravity"Location of output relative to padding (defaults to center)

Example

photograph

 

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"angle"Angle of rotation

quantize

 

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"number_colors"Number of colors to reduce to
"color_space"The colorspace to quantize in (defaults to "RGBColorspace")
"dither"Whether or not to use dithering on the resulting image (defaults to "false")

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


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"The new width of the image
"height"The new height of the image
"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.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"Width of desired image
"height"Height of desired image
"gravity"Location of crop (defaults to 'CenterGravity')
"only_shrink_larger"Don't upsize image (defaults to false)

Example

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.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"Width of desired image (optional if height defined)
"height"Height of desired image (optional if width defined)
"only_shrink_larger"Don't upsize image (defaults to false)

rotate

 

Rotates the image.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"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".


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"width"The new width of the image
"height"The new height of the image
"scale_factor"Instead of height and width you can set a scale factor. (eg 0.5 = 50%)

sepia tone

 

Applies sepia filter


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"threshold"Threshold for quantizing sepia tone

sharpen

 

Sharpens the image


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"sigma"Gaussian sigma of sharpen (defaults to 1.0)
"radius"Gaussian radius of shapen (defaults to 0.0)

sketch

 

Simulates a pencil sketch.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"sigma"Gaussian operator (defaults to 0.0)
"radius"Gaussian operator (defaults to 0.0)
"angle"Angle of sketch (defaults to 0.0)}

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.


Looks like...

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

unsharp mask

 

Sharpens an image


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"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.


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"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'


Looks like...

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

PARAMS:  Required / Optional

NameDescription
"text"Text to add to image
"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


Param Options

Gravity
options for placement on some functions

"gravity" : "EastGravity"
"gravity" : "WestGravity"
"gravity" : "NorthGravity"
"gravity" : "SouthGravity"
"gravity" : "NorthWestGravity"
"gravity" : "NorthEastGravity"
"gravity" : "SouthWestGravity"
"gravity" : "SouthEastGravity"
"gravity" : "CenterGravity"}

Interlace Type
options for saving interlance option

"type" : "UndefinedInterlace"
"type" : "NoInterlace"
"type" : "LineInterlace"
"type" : "PlaneInterlace"
"type" : "PartitionInterlace"}

Composite Ops
options for compositing