Generic Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## save-pixmap

Arguments: pixmap filename &key (quality 100)

Saves a pixmap to a new file. Any pixmap can be written as a BMP, PNG, JPEG, TIFF, or GIF file. Note GIF files are supported only on the Windows platform.

pixmap is the pixmap to save. It may have been loaded from a file with load-pixmap, or copied from the screen with get-pixmap, or created programmatically from a lisp array of pixel values (see cg-pixmaps.htm).

filename is the path of the file to create. It can be either a pathname or a path namestring. If the file already exists it will be replaced.

quality is an integer between 0 and 100 inclusive, specifying a tradeoff value between image quality and file size. It is used only for jpeg files (though that possibly could change with enhancements to the encoders that are in the underlying windowing systems). The default value is 100, which means the highest quality and largest file size.

The kind of pixmap file that's written is determined by the pathname-type of the filename argument, which should be either bmp, png, jpeg, jpg, tiff, tif, or gif. BMP files are uncompressed and therefore the largest, while PNG files are smaller, and JPEG files (even when quality is 100) are typically smaller still.

One known unsolved problem on Windows is that it doesn't work to load a non-bmp pixmap from a file and then save it as a bmp file if you passed the use-gdi-plus argument to load-pixmap as true.

A pixmap could alternately be saved to a file as Lisp source code with save-lisp-pixmap.

See also cg-pixmaps.htm.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version