Shayton Equilibrium Kitchen Utensil 2003 User Manual

Page of 194
188 
 Appendix B 
• 
• 
• 
W h a t ’ s   t h e   b e s t   m e t h o d   f o r   c o l o r   c o r r e c t i n g   a   G r a y s c a l e   i m a g e ?
To maintain compatibility with previous versions of MediaRich, Grayscale images may be 
treated in the same manner as RGB images. However, this assumes that the default RGB 
colorspace uses equal amounts of red, green, and blue to represent gray, and that the 
transform from Grayscale to RGB is linear. 
If a profile is available for your Grayscale images, better results will be obtained by using 
the Grayscale profile to color correct the Grayscale image to RGB before processing it as an 
RGB image.
H o w   d o   I   t r e a t   a l l   i m a g e s   a s   R G B   i m a g e s ?
If you are not concerned about precise color conversions, the loadAsRGB method has been 
provided as an add-on to the media object in the file: Scripts/Sys/media.ms. 
This method loads an image, and if the image colorspace is not RGB, it converts the image 
to RGB using the embedded profile, default source, and destination profiles defined in the 
global.properties file. If the image has an embedded profile, it is used as the source. Here 
is an example of how to use the loadAsRGB method:
#include "Sys/media.ms"
image = new Media();
image.loadAsRGB(name @ "myImage.tif");
Now, irrespective of the colorspace of the image stored in myImage.tif, the image is an 
RGB image.