---
jupytext:
  formats: md:myst
  text_representation:
    extension: .md
    format_name: myst
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

(sec:gif)=
# Case Study: GIF

The [GIF format](https://www.fileformat.info/format/gif/egff.htm) is widely used to encode image sequences.

The GIF file [gif.fan](gif.fan) can be directly used in Fandango:

```shell
$ fandango fuzz -f gif.fan -n 1 --population-size=1 -o 32x32.gif 
```

produces a [32x32 pixel GIF file](32x32.gif):

```{image} 32x32.gif
:alt: Generated GIF file
:class: bg-primary mb-1
:width: 200px
:align: center
```

Here is the generated `gif.fan` specification file.

```{versionadded} 1.1
`gif.fan` requires Fandango 1.1 or later.
```

```{code-cell}
:tags: ["remove-input"]
!cat gif.fan
```

```{note}
Note that `gif.fan` does not support only all GIF features, so it cannot be used to [parse](sec:parsing) arbitrary GIF files.
```
