IMG_CREATEANIMATIONENCODER(3)

πŸ“¦
version 3.4.8 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– IMG_CreateAnimationEncoder(3) πŸ’–

okay bestie so you want to make an animated file out of a bunch of pictures?? say less. this is the SDL_image function that spins up an animation encoder for you β€” that's the little guy who takes all your frames and smushes them into one glorious animated file. it lives in SDL_image3, in the FUNCTIONS crew. ✨


🌸 NAME 🌸

IMG_CreateAnimationEncoder β€” create an encoder to save a series of images to a file.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_image/SDL_image.h>

IMG_AnimationEncoder * IMG_CreateAnimationEncoder(const char *file);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: you hand it a filename, it hands you back an encoder, and then you feed that encoder a whole series of images and it writes them out as one animated file. main character behavior tbh. πŸ’…

these animation types are currently supported:

  • ANI
  • APNG
  • AVIFS
  • GIF
  • WEBP

and how does it know which one you want?? the file type is determined from the file extension, no cap. so like "file.webp" will be encoded using WEBP. the extension is literally doing the vibe check for you. 🫢


✨ FUNCTION PARAMETERS ✨

  • file β€” the file where the animation will be saved. that's it, that's the whole input. your destination. your final form. 🎯

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a new IMG_AnimationEncoder, or NULL on failure. and bestie, if it's NULL?? call SDL_GetError() for more information β€” that's where the actual reason is hiding, don't just sit there staring at the NULL like 😭


🌈 AVAILABILITY 🌈

This function is available since SDL_image 3.4.0. (so if you're on something older… no encoder for you, sorry not sorry πŸ’€)


πŸ“ SEE ALSO πŸ“

these are the rest of the girlies in the animation-encoder friend group β€” go read them too, iykyk πŸ’œ


and that's the whole page, bestie!! you ate. this was SDL_image version 3.4.8, dropping from the SDL_image manual, and yeah we're literally done here β€” go make something animated and iconic πŸ”₯πŸ’–

πŸ“¦ where this page comes from