All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

externalize-image Function

Summary

Returns an external image containing color information from an image.

Package

graphics-ports

Signature

externalize-image gp image &key maximum-colors important-colors type quality &allow-other-keys => external-image

Arguments
gp
A CAPI pane.
image
An image.
maximum-colors
An integer or nil. The default is nil.
important-colors
An integer or nil.
type
One of the keywords :bmp, :jpg, :jpeg, :png and :tiff. Other keywords may be supported, depending on the platform.
quality
An integer in the range [0,100].
Values
external-image
An external image.
Description

The function externalize-image returns an external-image containing color information from image, which should be an image that can be drawn to gp.

If maximum-colors is nil or if the screen has no palette, an external-image using all the colors in image is created.

If maximum-colors is an integer, the external-image containing image will be created using no more than that number of colors. If the image contains more than maximum-colors colors, then maximum-colors most frequently used colors will be accurately stored; the remainder will be approximated by nearest colors out of the accurate ones, using internal Color System parameters as the weighting factors for the color distance.

important-colors is recorded in external-image for later use, and specifies the number of colors required to draw a good likeness of the image. The default value is the number of colors in the image.

If type is supplied, it must be a keyword which specifies a known type, as returned by list-known-image-formats with for-writing-too t. The types :bmp, :jpg, :png and :tiff are known on all platforms (except Motif). Additionally, :jpeg is an as alias for :jpg.

quality is used for writing a JPG image on GTK+. It must be an integer in the inclusive range [0,100]. High values generate better images and larger files.

See also

make-image-from-port
write-external-image
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:15