GIFsonic API Reference

All of the transformations available in GIFsonic's API, with live examples that you can experiment with.

src parameter

This is the only required parameter. It tells GIFsonic which image to process.

Even if you don't add any transformation after src, GIFsonic will still serve your image through our CDN (which is an extremely easy way to implement a CDN for your GIFs 😉).

src will need to be URL-encoded if your GIF's URL contains special characters (&, =, or any of !$'()*+,;).

Transformations

Add transformations in the form of URL commands/parameters to change your GIF.

You can combine any number of transformations.

Size

Control the output dimensions of your image

Width (width, w)
Resize your image by width.
If omitted, it will be calculated automatically from height

Height (height, h)
Resize your image by height.
If omitted, it will be calculated automatically from width

Fit (fit)
Strategies to fit your image within the given space.

Crop

Trim pixels outside a given box

Crop (crop)
Just set to 1 🙄.

Crop width (crop_width, crop_w)
Removes any image data exceeding the given width.

Crop height (crop_height, crop_h)
Removes any image data exceeding the given height.

Crop x (crop_x)
X coordinate where to start crop_width.

Crop y (crop_y)
Y coordinate where to start crop_height.

Animation

Slow down, speed up, change your GIF's animation

Reverse (reverse)
Make the animation play in reverse.

Speed (speed)
Change the animation's speed.

Text

Add text to your image

Text (text)

Font family (text_font_family)

Font size (text_font_size)

Color (text_color)

Horizontal alignment (text_hoz_align, text_align)

Vertical alignment (text_vert_align, text_valign)

Text in (text_in)
After how long text should appear.

Text out (text_out)
After how long text should go away.

Format

Control the output format, image quality, and more

Number of colors (num_colors)
Reduce the color palette to make the image weight less.

Watermark

Add a logo or image overlay

URL (watermark_url, mark_url)
Your watermark's URL.

Position (watermark_position, mark_position, mark_pos)
Where your watermark goes.

Width (watermark_width, mark_width, mark_w) required
Specify your watermark width.
If omitted, height is calculated automatically

Height (watermark_height, mark_height, mark_h)
Specify your watermark height.
If omitted, width is calculated automatically

Background

Add a background color to transparent GIFs

Background color (background_color, bg_col)

Rotation

Rotate and flip your image

Rotate (rotate, rot)

Flip (flip)

Meme

Create animated memes, with automatic font effects and auto-resizing text

Top text (meme_top_text)
The text at the top.
Font family is the meme font (Oswald, similar to Impact but with accented letters and open source), and cannot be changed. Size is automatically calculated based on the length of the text.

Top text in (meme_top_text_in)
After how long text at the top should appear.

Top text out (meme_top_text_out)
After how long text at the top should go away.

Bottom text (meme_bottom_text)
The text at the bottom.
Font family is the meme font (Oswald, similar to Impact but with accented letters and open source), and cannot be changed. Size is automatically calculated based on the length of the text.

Bottom text in (meme_bottom_text_in)
After how long text at the bottom should appear.

Bottom text out (meme_bottom_text_out)
After how long text at the bottom should go away.

Options

Besides transformations, we support a few options that you can pass.

v

Useful to control which version of your image will be served by GIFsonic. A sample value would be: v=20170813 (accepts strings, integers, whatever).

t

Similar to v, t is meant to contain a timestamp to make sure GIFsonic doesn't serve a cached version of your GIF.
Very useful while developing. Just include with the current timestamp: t=1516763599 (accepts strings, integers, whatever).

download

Forces the file to be downloaded. Add &download=1 to the URL to enable.

no_cache

deprecated, don't use.

purge_cache

deprecated, don't use.

Icon pack by Icons8