QPix Command Reference |
![]() ![]() |
Image compression is the process of reducing the size of images. Compressed images require less storage space when saved on disk, as well as less RAM when handled in memory (although they must be decompressed for displaying).
QuickTime provides image compression and decompression services through software components commonly called codecs (compressors/decompressors).
Each codec implements a specific compression method or algorithm. Some of them implement lossless compression: once compressed with such a lossless codec, an image can be reconstructed without loss of quality from its compressed form.
In favor of better storage savings, however, most codecs slightly change certain image pixels to further reduce size and this will result, at least theoretically, in loss of image information. A lossy codec carefully chooses which image data to omit, taking into account the human perception of visual images, so that it fools the user into seeing what appears to be the original image.
Note: 4D includes commands for image compression (COMPRESS PICTURE, COMPRESS PICTURE FILE and LOAD COMPRESS PICTURE FROM FILE), but it is recommended that you use the QPix commands as they offer more control over the compression procedure.
QPix gives access to QuickTime's compression services throught the following commands:
QPx_CompressPicture | Compresses a picture variable |
QPx_CompressPictureFile | Compresses a PICT file in place (on disk) |
QPx_GetCompressedPictureInfo | Returns information about a QuickTime-compressed picture |