---
name: "IMG_SaveAVIF"
section: "3"
platform: "linux"
package: "libsdl3-image-doc"
version: "3.2.4+ds-1+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/IMG_SaveAVIF"
---

# IMG\_SaveAVIF(3)

Save an SDL\_Surface into a AVIF image file.

## NAME

IMG\_SaveAVIF - Save an SDL\_Surface into a AVIF image file.

## HEADER FILE

Defined in SDL3\_image/SDL\_image.h

## SYNOPSIS

```
#include "SDL3_image/SDL_image.h"
```

**bool IMG\_SaveAVIF(SDL\_Surface \*surface, const char \*file, int quality);**

## DESCRIPTION

If the file already exists, it will be overwritten.

## FUNCTION PARAMETERS

- *surface*

  the SDL surface to save.

- *file*

  path on the filesystem to write new file to.

- *quality*

  the desired quality, ranging between 0 (lowest) and 100 (highest).

## RETURN VALUE

Returns true on success or false on failure; call SDL\_GetError() for more information.

## AVAILABILITY

This function is available since SDL\_image 3.0.0.

## SEE ALSO

**•**(3), [**IMG\_SaveAVIF\_IO**(3)](/IMG_SaveAVIF_IO/3.md)
