IMG_SaveWEBPAnimation_IO(3)
π IMG_SaveWEBPAnimation_IO(3) π
okay so bestie, welcome to the SDL_image3 FUNCTIONS section of the manual, and today's main character is IMG_SaveWEBPAnimation_IO. she's the one who takes your whole animation and drops it into a WEBP file, through an SDL_IOStream. no cap. π
β¨ NAME β¨
IMG_SaveWEBPAnimation_IO β save an animation in WEBP format to an SDL_IOStream. literally that's her whole job and she ate. π¦
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
bool IMG_SaveWEBPAnimation_IO(IMG_Animation *anim, SDL_IOStream *dst, bool closeio, int quality);
π«Ά DESCRIPTION π«Ά
so here's the tea, and it's actually important tea: if closeio is true, then dst is gonna get closed before the function returns. and not like "only if it worked" β whether this function succeeds or not. it's closing either way. so don't be out here planning to keep using dst afterwards, okay? π
π FUNCTION PARAMETERS π
animβ the animation you wanna save. your lil masterpiece. your baby. πdstβ anSDL_IOStreamfrom which data will be written to. (yes bestie, the manpage really does say "from which data will be written to" β she's a little quirky like that, we love her anyway π)closeioβ true means close/free theSDL_IOStreambefore returning, false means leave it open. pick wisely, this one has consequences. πqualityβ a number between 0 and 100. and she means two different things depending on your vibe:- for lossy:
0gives the smallest size,100gives the largest. β¨ - for lossless: this parameter is the amount of effort put into the compression.
0is the fastest but gives larger files, compared to the slowest, but best,100. so like... speed vs. quality, the eternal struggle. β
- for lossy:
π₯ RETURN VALUE π₯
returns true on success or false on failure. and if it fails? call SDL_GetError() for more information, because she will not be explaining herself unprompted. π
π AVAILABILITY π
this function is available since SDL_image 3.4.0. so if you're on something older, it's giving "not yet, babe". π§
π SEE ALSO π
IMG_SaveAnimation(3)IMG_SaveAnimationTyped_IO(3)IMG_SaveANIAnimation_IO(3)IMG_SaveAPNGAnimation_IO(3)IMG_SaveAVIFAnimation_IO(3)IMG_SaveGIFAnimation_IO(3)
the whole save-animation friend group, fr fr. go say hi. π
and that's the page!! mwah π this was brought to you by SDL_image version 3.4.8, straight from the SDL_image corner of the world β go forth and save your animations, bestie, you've got this. πβ¨π¦
π¦ where this page comes from
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 43: SDL3_image-devel 3.4.8-1.fc43 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- fedora 44: SDL3_image-devel 3.4.8-1.fc44 Β· Zlib AND (HPND-Pbmplus AND Zlib) AND MIT AND (MIT OR Unlicense) AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms