| Did you know ... | Search Documentation: |
| image->save |
format is omitted, the
extension of the file selects it (e.g., .jpg
or .jpeg for JPEG); an extension that is not one of these
formats writes PNG. quality is used by the lossy formats
JPEG, WebP and AVIF; the default is 90. JPEG and BMP have no
transparency. GIF has 256 colours. Whether WebP and AVIF are available
depends on how SDL_image was built (see display<-image_save_formats):
if not, image->save
fails with a message on the console.
For example:
?- send(Image, save, 'photo.jpg'), send(Image, save, 'small.webp', webp, 50).
in defaults to image<-file,
the file the image was loaded from. That is a source_sink rather than a
file: if it is not something we can write to, image->save
fails with a message on the console.