Free plan

Edit animation

Change the speed, length or size of an animated GIF
POST
/v1/images/edit-animation

About this tool

Edits an animated GIF or WebP picture. You can cut frames from the start or end, keep every second or third frame, play it backwards or back and forth, change the speed or the loop count, resize it, flip or turn it. You choose whether to save it as GIF, WebP or APNG.
For example, you shorten a reaction GIF and make it faster so it loops sooner.

How to use it

  1. Choose this tool.
  2. Add your animated picture with Upload or drag and drop.
  3. Choose what to change, such as speed, length, size or direction.
  4. Choose the file type to save, then press Generate.
  5. Download the edited animation.

What you get back

You get a new animated file with your changes that you can download.
GOOD TO KNOW
A still picture is refused. Up to 200 frames and 100 million pixels in all frames are read; the result may have 50 million. GIF keeps one-bit transparency and 256 colours per frame. Counts as one image per animation.
TEST IT LIVE

Try Edit animation in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/edit-animation
Tool ID
images.edit-animation
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/edit-animation" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'images=@photo.jpg' \
  -F 'trim_from=1' \
  -F 'trim_to=1' \
  -F 'every=1'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.editAnimation({
    "images": 'photo.jpg',
    "trim_from": 1,
    "trim_to": 1,
    "every": 1
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->editAnimation([
    'images' => 'photo.jpg',
    'trim_from' => 1,
    'trim_to' => 1,
    'every' => 1,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Edit an animated GIF or WebP: cut frames, keep every Nth frame, reverse it, play it back and forth, change the speed or every frame delay, the loop count, the size, flip or turn it, and save as GIF, animated WebP or APNG.

Edit animation accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. You can send several files in one request.

Edit animation is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/edit-animation with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.