SOD C/C++ API Reference - Image Processing


int sod_img_save_as_jpeg(sod_img input, const char *zPath, int Quality);


Save a sod_img object in a file on disk (JPEG format). JPEG does ignore alpha channels in input data.


sod_img    input

The input image to be saved. The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem() or dynamically created via sod_make_image() and processed using the image processing interfaces offered by sod.

const char    *zPath

Destination path on disk.

int    Quality

Compression quality (a value between 0 and 100). Lower quality results in a smaller image. Higher quality looks better but results in a bigger image. Pass a negative value for a default ratio.

Return Value

SOD_OK is returned on success. Any other return value indicates failure.


Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also