Previous: Image Architecture, Up: Drawing Two-Dimensional Images
Read an image from the source. The source can be a pathname designator (a string or a path), or a stream. The caller can supply a value for type, width, and height for sources that don't indicate these values. A value of nil for type means recognize the type automatically. Other values for type are :truecolor (an array of 3-byte color values) :256-gray-level (an array of 1-byte gray-level values) :binary (an array of bits).
Write the image to the destination. The destination can be a pathname designator (a string or a path), or a stream. Valid values of type are :pnm (pbm, pgm, or ppm according to the type of image), :png, :jpeg, (more...). The quality argument is a value from 0 to 1 and indicates desired image quality (for formats with lossy compression).