---
name: "IMG_SaveAVIF_IO"
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_IO"
---

# IMG\_SaveAVIF\_IO(3)

Save an SDL\_Surface into AVIF image data, via an SDL\_IOStream.

## NAME

IMG\_SaveAVIF\_IO - Save an SDL\_Surface into AVIF image data, via an SDL\_IOStream.

## HEADER FILE

Defined in SDL3\_image/SDL\_image.h

## SYNOPSIS

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

**bool IMG\_SaveAVIF\_IO(SDL\_Surface \*surface, SDL\_IOStream \*dst, bool closeio, int quality);**

## DESCRIPTION

If you just want to save to a filename, you can use

**IMG\_SaveAVIF** () instead.

If **closeio** is true, **dst** will be closed before returning, whether this function succeeds or not.

## FUNCTION PARAMETERS

- *surface*

  the SDL surface to save.

- *dst*

  the SDL\_IOStream to save the image data to.

- *closeio*

  true to close/free the SDL\_IOStream before returning, false to leave it open.

- *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**(3)](/IMG_SaveAVIF/3.md)
