IMG_Save(3)
πΎ IMG_Save(3) β the SDL_image3 glow-up where ur surface becomes a whole file π
okay bestie, listen. this is the manual page for IMG_Save, straight outta the SDL_image3 FUNCTIONS collection. it's the one that takes ur precious little SDL_Surface and yeets it onto the disk as a real image file. iconic behaviour, no notes. β¨
π NAME π
IMG_Save β save an SDL_Surface into an image file. that's it, that's the job, and she does it flawlessly. π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3_image/SDL_image.h>
bool IMG_Save(SDL_Surface *surface, const char *file);
two args, one bool, zero drama. π
π¦ DESCRIPTION π¦
okay so here's the tea, and it's important tea:
- if the file already exists, it will be overwritten. like, gone. replaced. not asked, not consulted, just overwritten. so pls be careful out there bestie, ok?? π
- for formats that accept a quality setting, a default quality of
90will be used. so if u don't specify, u get 90, which is genuinely a pretty good vibe. π
π FUNCTION PARAMETERS π
surfaceβ theSDL_Surfaceu wanna save. this is ur main character. πfileβ path on the filesystem to write the new file to. yes, a real path, on a real filesystem, bestie. ποΈ
β RETURN VALUE β
returns true on success, or false on failure. and if it fails? call SDL_GetError() for more info, because she will tell u what went wrong. not me checking the return value every single time... π
π AVAILABILITY π
this function is available since SDL_image 3.4.0. so if ur on anything older, u simply cannot sit with us. sorry babes. π
π₯ SEE ALSO π₯
the whole friend group, in order:
IMG_SaveTyped_IO(3)IMG_SaveAVIF(3)IMG_SaveBMP(3)IMG_SaveCUR(3)IMG_SaveGIF(3)IMG_SaveICO(3)IMG_SaveJPG(3)IMG_SavePNG(3)IMG_SaveTGA(3)IMG_SaveWEBP(3)
each one is a lil specialist for a specific format and honestly? we love range. π§
and that's the whole page, bestie!! mwah π this was SDL_image version 3.4.8, from the good people who bring u SDL_image β go forth and save ur surfaces, and remember to check that bool. periodt. β¨ππ¦
π¦ 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