> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GIF

> Convert a video segment into a lightweight GIF animation.

`f_gif` converts a video into a GIF. Combine it with the trim tokens `so_`, `eo_`, and `d_` to control which segment becomes the GIF, and with `w_` to set the output width.

<Info>
  `f_gif` returns a GIF image, not video. Reference the result with an `<img>` tag rather than a `<video>` element.
</Info>

## How to use it?

Add `f_gif` to the URL. On its own it converts the full video; add trim tokens to capture a segment.

| Token   | What it does                                  |
| ------- | --------------------------------------------- |
| `f_gif` | Converts the output to GIF                    |
| `so_`   | Optional start offset in seconds, e.g. `so_5` |
| `eo_`   | Optional end offset in seconds, e.g. `eo_10`  |
| `d_`    | Optional duration in seconds, e.g. `d_10`     |

<Tabs>
  <Tab title="Full Video to GIF">
    ```bash theme={null}
    https://assets.autorender.io/LOKVTtKVGb/f_gif,w_400/doc/skateboarding.mp4
    ```

    <div className="flex object-contain justify-center mt-4">
      <img src="https://assets.autorender.io/LOKVTtKVGb/f_gif,w_400/doc/skateboarding.mp4" alt="Video to GIF conversion" className="shadow-lg max-w-full" />
    </div>
  </Tab>

  <Tab title="Trim by duration (so_5, d_10)">
    ```bash theme={null}
    https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,d_10,w_400/doc/skateboarding.mp4
    ```

    <div className="flex object-contain justify-center mt-4">
      <img src="https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,d_10,w_400/doc/skateboarding.mp4" alt="Trimmed GIF by duration" className="max-w-full" />
    </div>
  </Tab>

  <Tab title="Trim by end offset (so_5, eo_10)">
    ```bash theme={null}
    https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,eo_10,w_400/doc/skateboarding.mp4
    ```

    <div className="flex object-contain justify-center mt-4">
      <img src="https://assets.autorender.io/LOKVTtKVGb/f_gif,so_5,eo_10,w_400/doc/skateboarding.mp4" alt="Trimmed GIF by end offset" className="max-w-full" />
    </div>
  </Tab>
</Tabs>

We recommend trimming with `d_` and setting a width with `w_` (e.g. `f_gif,so_5,d_10,w_400`) because GIF file size grows fast with both length and dimensions. Use GIFs for silent previews in lists and cards where full video controls are not needed.

## Next steps

<CardGroup cols={2}>
  <Card title="Trim" icon="scissors" iconType="solid" href="/docs/video/trim">
    Pick the exact segment before converting to GIF.
  </Card>

  <Card title="Resize & aspect ratio" icon="crop-simple" iconType="solid" href="/docs/video/resize">
    Control GIF dimensions with width, height, and ratio.
  </Card>
</CardGroup>
