IMG_SaveGIF(3)

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

πŸ’Ύ IMG_SaveGIF β€” the SDL_image3 glow-up for your surfaces

okay bestie, picture this: you've got a whole SDL_Surface sitting there looking gorgeous, and you wanna make it a GIF file on disk. That's literally this function. It lives in the SDL_image3 family and it's the main-character move for "save this surface as a GIF, bestie, right now." πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

bool IMG_SaveGIF(SDL_Surface *surface, const char *file);

πŸŽ€ DESCRIPTION πŸŽ€

So here's the tea: this saves your surface out as a GIF image file. That's it, that's the vibe. πŸ’…

⚠️ Heads up though β€” if the file already exists, it gets overwritten. No "are you sure?", no little confirmation popup, no mercy. Your old file is gone-gone. So maybe double-check that path before you send it, iykyk. πŸ’€

πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • surface β€” the SDL_Surface you're saving. Your star. Your icon. ✨
  • file β€” the path on the filesystem where the new file gets written. Yes, the whole path, not just the name, bestie.

🌈 RETURN VALUE 🌈

  • Returns true when it works. Slay. πŸŽ‰
  • Returns false when it doesn't. 😭
  • Either way, if you're curious why it failed, call SDL_GetError() and it'll spill the details for you.

⭐ AVAILABILITY ⭐

This one's been around since SDL_image 3.4.0, so if you're on anything older, it's giving not found, unfortunately. πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • IMG_SaveGIF_IO(3) β€” the IO-flavored sibling, if you wanna save to something that isn't just a plain old file path. 🫢

and that's the whole page, no cap πŸ’– this was SDL_image 3.4.8, from the SDL_image manual, so go forth and save those GIFs, queen πŸ§šπŸŒΈπŸ“

πŸ“¦ where this page comes from