Patent ID: 7554558

Claim:
A computer readable storage medium having stored thereon sequences of instructions which are executable by a digital processing system, and which, when executed by the digital processing system, cause the system to perform a method to process one or more images, the method comprising: parsing a first command written for a first color space; and based at least on the first command, automatically selecting a color space in which an operation associated with the first command is to be processed, wherein the selected color space is selected based on the first command and one or more color spaces of one or more input buffers associated with the first command, wherein when the first command operates only in the first color space, the selected color space is the first color space; when the first command generates similar results in the first color space and in the second color space, the color space for the operation associated with the first command is selected to minimize color space conversion; and when the first command generates different results in the first color space and in the second color space and when the selected color space is the second color space, the method further comprises: transforming the first command to a second command in the second color space, wherein the second command generates a similar result in the second color space as the first command in the first color space.