Patent Publication Number: US-6037950-A

Title: Configurable, extensible, integrated profile generation and maintenance environment for facilitating image transfer between transform spaces

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates generally to image processing systems and, more particularly, to methods and devices for generating, viewing, editing and validating profiles linking different transform spaces. In a particularly useful embodiment, the profiles are generated between first and second color spaces where one of the color spaces is associated with either a source or a destination device in an image processing system. The profile can then be utilized within image processing software, or the contents of the profile can be viewed, edited or validated. 
     Digital image processing involves electronically capturing an image of a scene, altering the captured image in some desired fashion and passing the altered image to an output device. An upstream element of a digital image processing system can be thought of as a source device, whereas a downstream element can be thought of as a destination device. For instance, a simple image processing system could include an image acquisition device such as a digital camera, camcorder, scanner, CCD, etc., a color processor for processing the colors of the image, and an image rendering device, such as a printer, monitor, computer memory, etc. When considering a communication between the acquisition device and image rendering device, the acquisition device is deemed as the source device whereas the image rendering device is deemed as the destination device. All imaging devices impose distortions on both the color and other characteristics of an image. 
     Transferring images and documents between digital imaging devices such as monitors, scanners and printers requires color matching, i.e. matching of color characteristics of the respective devices since different imaging devices have different color capabilities, describe color characteristics in different terms, and operate in different color spaces. For example, a color display monitor in a computer system may operate in RGB color space by creating and describing colors in terms of red, green and blue (RGB) values. The RGB values associated with particular colors for the display monitor are device-dependent in that the RGB values associated with specific colors are particular for the given monitor. Since the RGB values are device-dependent, colors displayed on different monitors will probably not be visually identical even for the same RGB input values. 
     Most printers create and describe colors in device-dependent terms differing from those used by monitors. For example, printers use cyan magenta, yellow and black (CMYK) values to describe colors, and are said to operate in the CMYK color space. Since the CMYK values are device-dependent, colors printed on any given printer will probably not match colors printed on a different printer for the same CMYK value. 
     Further complicating color matching between devices is the fact that different devices have different color capabilities. Every rendering device, such as a printer or monitor, has a limited range of colors, i.e. a gamut, that it can reproduce. Those skilled in the art will recognize that color display monitors tend to be able to produce a wider range of lighter colors whereas color printers tend to be able to produce a wider range of darker colors. Consequently, the gamut for a color display monitor is different from the gamut for a color printer. As a result, some colors displayed on display monitors cannot be reproduced on color printers and vice versa. 
     Models are often used to translate colors between devices while trying to maintain the perceived color appearance. For example, suppose that the user displays an image on a monitor. If he prints the image without any color matching, the color appearance of the printed image will differ significantly from that of the original. Using a color matching model, this difference can be reduced to a perceptively acceptable level. Color matching models can be empirically or analytically derived. 
     In recent years, device-independent paradigms for the characterization of color information in an image processing system have been developed and are being implemented. ColorSync, developed by Apple Computer and KCMS, developed by Eastman Kodak Co., are examples of systems or components supporting a device-independent color paradigm. This paradigm is based upon a characterization of the image pixel data (digits) in a device-independent color space, e.g. CIE L*a*b* or CIE XYZ, using a color management system. 
     U.S. Pat. No. 5,561,459 issued Oct. 1, 1996 to Stokes et al. discloses automatic profile generation for a self-calibrating color display. Cathode ray tube (CRT) parameters are measured and combined with previously acquired calibration parameters in order to create updated characteristic information for the profile. The characteristic information includes the CRT color gamut, the white and black point of the CRT and the gamma of the CRT. In addition, ambient lighting conditions may be included in the profile. This characteristic information is stored in a CRT characterization profile in a standardized format. The profile is updated whenever the CRT is recalibrated or whenever the operating conditions of the CRT are changed. Further, the profile may be employed to recalibrate a destination CRT based on a source CRT&#39;s profile. 
     U.S. Pat. No. 5,612,902 issued Mar. 18, 1997 to Stokes discloses a system and method for automatic characterization of a color printer using an analytical model which, in turn, is used to generate a multidimensional lookup table which can be used at runtime to compensate image input and create desired visual characteristics in the printed image. A detector can be incorporated into the printer which measures at least one parameter of each printed sample so that characterization can be carried out internally to the printer in a manner which is transparent to the end user. In this way, changes in paper stock, inks, or environment can be custom compensated for each printing application. 
     SUMMARY OF THE INVENTION 
     A method and system for facilitating image transfer between transform spaces by establishing a configurable, extensible, integrated profile generation and maintenance environment in a computer system includes the steps of providing a profile generation environment, a profile viewing environment, a profile editing environment, and a profile validation environment. The software for implementing the profile generation and maintenance integrates each of the available environments, is configurable to cause a desired sequence of steps to take place, and is extensible by allowing the addition or modification of capabilities without the need to update the main software program in terms of recompilation or relinking. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The aforementioned aspects and other features of the invention are described in detail in conjunction with the accompanying drawings in which the same reference numerals are used throughout for denoting corresponding elements and wherein: 
     FIG. 1 is a block diagram of a basic digital image processing system; 
     FIG. 2 is a block diagram of an overview of a configurable, extensible, integrated profile generation and maintenance environment for facilitating image transfer between transform spaces in accordance with the principles of the invention; 
     FIG. 3 is one embodiment of the profile generation block of FIG. 2; 
     FIG. 4 is another embodiment of the profile generation block of FIG. 2; 
     FIG. 5 is one embodiment of the viewing block of FIG. 2; 
     FIG. 6 is one embodiment of the editing block of FIG. 2; 
     FIG. 7 is a target image of color patches for acquisition by a source device during profile generation; and 
     FIG. 8 is an image having color patches which has been exported or rendered by a destination device during profile generation. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The characterization of a device&#39;s image pixel data in device-independent color space is commonly codified in a tagged file structure, referred to as a device profile, that accompanies the digital imaging device. A device profile is standardized and defined as &#34;a digital representation of the relation between device coordinates and a device-independent specification of color&#34; in the International Color Consortium (ICC) Profile Format Specification, Version 3.3, Nov. 11, 1996, page 101 incorporated herein in its entirety for supplemental background information which is non-essential but helpful in appreciating the applications of the present invention. 
     A standard ICC profile includes header information, a tag table and tagged element data. The profile header provides the necessary information to allow a receiving system to properly search and sort ICC profiles. The header includes, but is not limited to, the following parameters: size; color management module (CAM) type; version number; device class; color space; connection space; creation date and time; file signature; primary platform target; flags; device manufacturer; device model; device attributes; rendering intent; XYZ values; and the name of the creator. These parameters are further described below. 
     The profile size is given in bytes. The CMM, profile version number and device class are each identified. The three basic device profile classes are input, output and display. Profiles are also classified as device link, color space conversion, abstract or named color profiles. Device link profiles provide a mechanism in which to save and store a series of device profiles and non-device profiles in a concatenated format as long as the series begins and ends with a device profile. Color space conversion profiles are used as a convenient method for CMMs to convert between different non-device color spaces. Abstract color profiles provide a generic method for users to make subjective color changes to images or graphic objects by transforming the color data within a profile connection space (PCS) to be described later. Named color profiles are related to device profiles so that, for a given device there would be one or more device profiles to handle process color conversions and one or more named color profiles to handle named colors. The color space of the data stored in the profile could be any color space such as XYZ, L*a*b*, Luv, RGB, CMY, CMYK, etc. Further, the profile connection space can be any device-independent color space such as XYZ or L*a*b*. The primary platform signature indicates the primary platform or operating system for which the profile was created. The profile flags indicate various hints for the CMM such as distributed processing and caching options. The device attributes are noted which are unique to the particular device setup such as the media type. The rendering intent is either perceptual, relative colorimetric, saturation or absolute calorimetric. 
     The tag table acts as a table of contents for the profile tags and the tag element data therein. Each profile classification requires a different set of tags. Of course, the intent of using tags with profiles is to provide a common base level of functionality. One example of a tag is the calibrationDateTimeTag which provides profile calibration date and time. Initially, this tag matches the contents of the creationDateTime header flag. This allows applications and utilities to verify if this profile matches a vendor` profile and how recently calibration has been performed. Another example of a tag is the mediaWhitePointTag which specifies the media white point and is used for generating absolute colorimetry. It is referenced to the profile connection space so that the media white point as represented in the profile connection space is equivalent to this tag value. Many other profile tags are available as described in the ICC specification. 
     The ICC specification further defines a Profile Connection Space (PCS) as a device-independent color space which can be used as a standard intermediary color space for transforming color information from one device-dependent color space to another (e.g. RGB to CMYK). For example, the transformation of a color image from a digital camera to a printer can be described as a transformation into the PCS via the digital camera&#39;s profile followed by a transformation out of the PCS via the printer&#39;s profile. The PCS, however, is a virtual space so that the image may never actually be represented in the PCS on disk or in a computer memory. Thus, the PCS is regarded as a virtual stage of the image processing in contrast to an interchange or exchange color space, which is an encoding for the storage and transmission of images. 
     The inclusion of non-color, spatial information into profiles is disclosed in U.S. patent application Ser. No. 08/709,487 filed Sep. 6, 1996 by Hultgren et al., herein incorporated by reference in its entirety for supplemental background information which is non-essential but helpful in appreciating the applications of the present invention. Spatial information can be represented, for instance, by private spatial tags under the ICC recommendations. The spatial tags should include information as to which class the particular characteristic function belongs, i.e. Modulation Transfer Functions, Wiener Noise Power Spectra, or gray level dependent Wiener noise masks. The tagged format should also include information sufficient to identify both the relevant units of spatial frequency and the dimensionality of the characteristic functions. Propagation of characteristic functions is calculated within the context of the model based image processing system. 
     Although the specification of the International Color Consortium as described above provides a specific profile definition, a profile generated and maintained in accordance with the principles of the current invention is not so limited. First, as noted above, the profile considered herein is not singularly directed towards characterization of color data. Spatial and other profile data is also viable. Also, a profile generated and maintained in accordance with the principles of the current invention is more accurately defined as characteristic information for use in image processing which facilitates the transfer of information from one transform space to another. For instance, a profile can be generated to transform image data: from device-dependent color space to device-independent color space; from a first device-dependent color space to a second device-dependent color space; from device-independent color space to device-independent color space; from a first device-independent color space to a second device-independent color space; from a first device-dependent color space to a second device-dependent color space; etc. 
     Generation and maintenance of profiles are significantly simplified by configurable, extensible, integrated software which implements the features of the invention to include interactive and script driven processes for facilitating the generation, viewing, editing and validating of profiles. A script is defined as a type of program that consists of a set of instructions to an application or utility program or its operating system environment, can initiate user prompts and has the ability to react to user and software action. It is well known that a script typically includes instructions expressed using the rules and syntax of the application or utility and its operating system environment, combined with simple control structures such as loops and if/then expressions. Two sample scripts useful for implementing profile generation in accordance with the principles of the invention append this description. 
     For the purposes of the invention, the software program is integrated. For this case, integrated means that the software program contains all or some of the following: a profile generation environment, a profile viewing environment, a profile editing environment and a profile validation environment. The profile generation environment has many features built into it which are necessary for the interactive building of a profile from raw or previously processed data: extensive data acquisition screens and features; data validation steps; capabilities to receive images either from file or directly from image acquisition devices; capabilities to send images either to file or to image rendering devices; capabilities to receive data either from file or directly from measurement devices such as a spectrophotometer for measuring color; ability to receive from the user other useful data; features for reformatting and applying simple processing to data; capabilities to send raw, reformatted or processed data to data computation modules and to receive results from those modules; ability to create a profile structure and populate its substructures with raw, reformatted or processed data. The profile generation environment also has the ability to store in a history file documentation of how the profile was produced, such information can include the raw and/or processed data and instruction sequence used in the profile generation. The profile viewing environment possesses means to present to the user in a useful fashion all of the fields of the profile header and any profile tag of interest. For tags with structure unknown to the viewing environment, text and/or binary representations of the data are available. The profile editing environment possesses a means to present to the user in a useful fashion the current state of all the fields of the profile header and any profile tag of interest and the capability for user interactive modification of the contents of any of the fields in user-friendly fashion. For tags with structure unknown to the editing environment, text and/or binary editors are available. The profile validation environment contains means to verify the reasonableness and accuracy of the profile. Validation processes may report profile metrics based on testing of the self-consistency of the profile, testing of the consistency between the profile and the raw data used in its generation and/or testing the accuracy of results obtained by exercising the profile in an image processing environment. 
     For the purposes of the invention, the software program is configurable. For this case, configurable means that the software program can be controlled in such a way as to cause a well defined sequence of steps to take place, including user prompts, which result in a simplified procedure for profile generation and/or profile editing and/or profile validation. The knowledge of an expert can be encapsulated in a script which when running sends instructions to the software program or its operating system environment guiding an arbitrary user through the complexities of the profile generation, editing and/or validation task. 
     For the purposes of the invention, the software program is extensible. For this case, extensible means that new capabilities can be added to the environments of profile generation, profile viewing, profile editing and profile validation without the need to update the main software program in terms of recompilation or relinking. In the profile generation environment, new software compilation or data processing modules, such as a model based module which can utilize fewer color patch samples, can be easily added by the user or a third-party developer through adherence to a well defined application programmer&#39;s interface. The profile viewing and editing environments will react to descriptions of new tag structures written with adherence to a defined syntax, such descriptions easily added by a user or a third-party developer. In the profile validation environment, new capabilities can also be added by the user or third-party developers. 
     FIG. 1 is a diagram of an image acquisition and rendering system, also referred to as a computer system, 2 that can be used in cooperation with, and for implementing, the inventive system and method. The system 2 includes a computer 3, one or more image acquisition or source devices represented by a digital camera 4A and a scanner 4B for acquiring an image and converting it to digital image data, and one or more image rendering or destination devices represented by a color printer 5A and a video output or monitor 5B for generating an output image. The computer 3, which in one embodiment is a general-purpose stored-program digital computer, is capable of receiving and processing digital image data. 
     As is conventional, the computer 3 includes a processor module 6 and operator interface elements comprising operator input components such as a keyboard 7A, a mouse 7B and a video display device 8. The processor module 6 includes, for example, processor, memory and mass storage devices such as disk and/or tape storage elements (not separately shown) which perform processing and storage operations in connection with digital data provided thereto. The computer 3 will generally be processing certain programs which could be stored and retrieved from the hard drive or a computer-readable medium 1 such as a magnetic diskette or a CD-ROM, which enable it to perform selected image processing operations as described throughout the specification. The operator input elements 7A and 7B are provided to permit an operator to input information for processing. The video display device 8 is provided to display output information to the operator. Although one embodiment of the image acquisition and rendering system 2 is shown as comprising particular components, it will be appreciated that the computer system 3 may include a variety of components in addition to or instead of those depicted in FIG. 1, such as special-purpose hardware and/or program components, or a combination of a computer 3 with special-purpose hardware and/or program components. 
     FIG. 2 is a block diagram of a preferred overview of a configurable, extensible, integrated profile generation and maintenance environment for facilitating image transfer between transform spaces in accordance with the principles of the invention. A profile can either be imported from an external file, application or device in block 18, or generated in block 20. Once the profile is either generated or acquired, it can be viewed in block 50, edited in block 70, validated in block 90, or saved in block 92. 
     FIG. 3 is a flow chart of one example for profile generation according to the principles of the invention. In block 21, the user selects one or more script(s), for example corresponding to a Polaroid PDC-2000 digital camera 4A, from a predefined list. After the user selects the script(s), he executes the selected script(s) in block 22. For the purposes of this example, the profile when generated will contain header and tag information which is conveniently divided into first, second and third header and tag information. In block 24 a utility routine is called by the selected script(s) to automatically generate the first header and tag information such as the profile version, device manufacturer, device model, etc. Then in block 26 an application is run by the script(s) which prompts the user to select and/or fill in data for the second header and tag information which includes entries such as the identity of the profile creator or user, color space signatures, attributes, rendering intent, etc. In block 28, first and second transform space data, which may consist of the null set, is imported which is used for generating in block 30 the third header and tag information such as blueTRCTag, greenColorantTag, mediaWhitePointTag, etc. The first, second and third header and tag information is saved in the newly generated profile in block 32. 
     In the embodiment of FIG. 4, if the selected script(s) is associated with a source device as queried in decision block 34, then the first transform space can, for example, be defined as device-dependent color space and the second transform space can be defined as device-independent color space. For instance, if the chosen script(s) is associated with the PDC-2000 digital camera, then when a target 100 having color patches 102 as illustrated in FIG. 7 is acquired by the camera, the RGB values in RGB space are averaged for each color patch 102. In this case, the target 100 consists of 64 color patches 102 each including an averaging area 104 which shows the user the position and size of the averaging areas 104 that will be used to average color information within each color patch. The size and location of the averaging areas 104 can be modified by the user. The L*a*b* values associated with each patch in L*a*b* space are also imported in block 28 for use in block 30 for generating the third header and tag information. 
     In the case where the selected script(s) does not associate with a source device, then decision block 34 in FIG. 4 is answered in the negative and block 36 queries whether the selected script(s) associates with a destination device. If the selected script(s) does associate with a destination device, then in block 38 both device-independent data and device-dependent data are imported. This is accomplished by rendering a color image such as target 130 in FIG. 8 through the destination device such as a color printer. The device-dependent data is expressed in a chosen device-dependent color space such as CMYK color space and the device-independent data is expressed in a chosen device-independent color space such as L*a*b* color space. Thereafter, both the CMYK and L*a*b* values are utilized as previously described to generate the third header and tag information in block 30 which, in turn, is saved in the profile in block 32. 
     In the case where block 36 is answered in the negative, then the script will guide the user in block 40 through the acquisition of two related color sets, either one of which could consist of the null set. In block 30, the color set data is then used to generate the third header and tag information which, in turn, is stored in block 32. 
     FIG. 5 is a block diagram of one embodiment of the viewing block 50 of FIG. 2. The user selects a profile which is opened in block 52 and displayed by a list of headers and tags in block 54. The user selects a particular header or tag for viewing in block 56 and the software determines in decision block 58 whether the tag type is recognized for retrieval. The header is always recognizable so for any header selected by the user, the decision block 58 is bypassed and the header information is displayed to the user in block 62. If the tag type is recognized, then the particular tag information is retrieved and displayed to the user in some useable format in block 62. If the tag type is not recognized by the software, then the tag information is displayed in block 60 to the viewer in text or binary format. 
     FIG. 6 is a block diagram of one embodiment of the editing block 70 of FIG. 2. As in the viewing block 50, the user first selects a profile which is opened in block 72 and displayed by a list of headers and tags in block 74. The user then selects a particular header or tag for viewing and editing in block 76 and the software determines in decision block 78 whether the tag type is recognized for retrieval. The header is always recognizable so for any header selected by the user, the decision block 78 is bypassed and the header information is displayed to the user in block 82. If the tag type is recognized in block 78, then the tag information is retrieved and displayed to the user in some useable format in block 82. If the tag type is not recognized by the software, then the tag information is displayed in text or binary format in block 80 to the viewer. The user can then modify the header or tag information in block 84 and save the changes in block 86. 
     Of course, the means for performing various functions in accordance with the invention could be interpreted in a number of ways including numerous combinations of hardware and software components and as such is not limited to specific structures. For instance, something as simple as the means for selecting a profile could be interpreted to include a monitor for displaying the list of possible profiles to the user, a computer program running in RAM within the computer or from a CDROM, the user input device such as a keyboard or mouse, the various scripts used for implementing the selection process, etc. On the other hand, the selection means could alternatively be interpreted merely as a user prompt and acceptance of a user selection by the program being run. 
     It is to be understood that the above described embodiments are merely illustrative of the present invention and represent a limited number of the possible specific embodiments that can provide applications of the principles of the invention. For instance, the profile making capabilities of the inventive method can be used for providing transformation of data between any two transform spaces. The above examples using first and second color spaces are exemplary. Numerous and varied other arrangements may be readily devised in accordance with these principles by those skilled in the art without departing from the spirit and scope of the invention as claimed. 
     
         __________________________________________________________________________
SAMPLE SCRIPT 1                                                           
property scriptName: &#34;Sample Device Script&#34;                               
property scriptVersion: 1.0                                               
tell front document of application &#34;ProfileMaker&#34;                         
Set the device parameters.                                                
set device to {name:&#34;sample Device&#34;, type:Output, maker:&#34;PLRD&#34;,           
model:&#34;0000&#34;, media: &#34;Output Media&#34;, space:RGBData, print area: {800,     
1000}, resolution:                                                        
{100, 100}, LUT indicies:256, tolerance:3.0, background:                  
{65535, 65535, 65535}, PCS:labData, dev time:0}                           
Add a profile description tag of the device name and current date         
make new tag at end of profile 1 with properties ˜                  
{signature:profileDescriptionTag, type:textDescriptionType,               
data:&#34;Sample Device (100 dpi, Output Media)&#34;}                             
make new tag at end of profile 1 with properties                          
{signature:polaPixelPitchTag, type: polaPitchType, data: {0.254,          
0.254}}                                                                   
The kodak device settings, a text tag. Not sure what to put in here, so   
just                                                                      
put in something simple.                                                  
make new tag at end of profile 1 with properties ˜                  
{signature:kodakDeviceSettingsTag, type:textDescriptionType,              
data:&#34;For best results use . . . (additional settings info)&#34;}             
set prismStr to&#34;*Media: Output Media&#34; &amp; return &amp;&#34;*Resolution: 100 dpi&#34;    
&amp; return                                                                  
make new tag at end of profile 1 with properties ˜                  
{signature:polaInformationTag, type:polaSecureTextType,                   
data:prismStr }                                                           
make new tag at end of profile 1 with properties ˜                  
{signature:deviceMfgDescTag, type:profileDescriptionTag,                  
data: &#34;Polaroid Corporation&#34;}                                             
make new tag at end of profile 1 with properties ˜                  
{signature: deviceModelDescTag, type:profileDescriptionTag,               
data:&#34;0000&#34;}                                                              
make new tag at end of profile 1 with properties ˜                  
{signature:technologyTag, type:signatureType, data: &#34;XYZ&#34;}                
end tell                                                                  
SAMPLE SCRIPT 2                                                           
Setup disables any datasets that are not color and enables the color      
ones.                                                                     
Computes the Tags for a color output device using the 8x8x9 targets.      
This is currently restricted to one target in the Mix A format.           
Includes the rms of the standard deviations along with the max stdev of   
the                                                                       
repeated patches.                                                         
property scriptName: &#34;Sample Procedure&#34;                                   
property scriptVersion: 1.0                                               
property minVersion: 1.0                                                  
- The Sylvania D50 illuminant.0, 0.858086}                                
property computeCode: -4500                                               
property validateCode : -4501                                             
property incrementList: {36.429, 36.429, 36.429, 36.429, 36.429, 36.429,  
36.429}                                                                   
property incrementList2: {36.0, 36.0, 36.0, 36.0, 36.0, 36.0, 39}         
Factors for limits on the standard deviations of the repeated patches, a  
list of lists.                                                            
The items are                                                             
Mean, stdev, min, max, and rms. Within each it is L, a, b, E. Blank lists 
are not                                                                   
checked.                                                                  
The numbers multiply the tolerance in the device record.                  
property dLimits: {{0.7, 0.7, 0.7, 1.0}}                                  
on GetPMFolder( )                                                         
get path to application &#34;ProfileMaker&#34;                                    
tell application &#34;Finder&#34; to get container of result                      
return (result as text)                                                   
end GetPMFolder                                                           
validate( )                                                               
on setup( )                                                               
tell front document of application &#34;ProfileMaker&#34;                         
get every dataset whose name is &#34;Color Output 8x8x9&#34;                      
if (count result) is 0 then                                               
create the color space data sets                                          
make new dataset at end ˜                                           
with properties ˜                                                   
{type:Color Space, layout:{8, 8, 9}, patch size:{40,                      
40}, color source: {category:Resource, name:&#34;8x8x9 [mix A]&#34;}, LUT         
source:˜                                                            
        {category:Resource, name: &#34;NULL&#34;},                                
name: &#34;Color Output 8x8x9&#34;, lab source:˜                            
        {category:PR 650}, state:0}                                       
end if                                                                    
end tell                                                                  
return 0                                                                  
end setup                                                                 
This computes the tags for the mix A targets. It is set up to handle      
only                                                                      
one dataset for now. It also does not incorporate any data from the LUT   
96 target.                                                                
on compute( )                                                             
set baseName to (path to temporary items folder as text) &amp; (time of       
(current                                                                  
date) as text)                                                            
set dataPath to GetPMFolder( ) &amp; &#34;data:Output:&#34;                           
Create temp file name for the clut data of the A to B tags                
set tA2B0 to (baseName &amp; &#34;.tA2B0&#34;)                                        
set tA2B1 to (baseName &amp; &#34;.tA2B1&#34;)                                        
set tA2B2 to (baseName &amp; &#34;.tA2B0&#34;) Make the same as Intent 0              
set tInvIn0 to (baseName &amp; &#34;.tinvIn0&#34;)                                    
set tInvIn1 to (baseName &amp; &#34;.tinvIn1&#34;)                                    
Create temp file name for the data for the inverse clut data. This is for 
the                                                                       
B to A                                                                    
tags and is a scaled-integer version of the invert3D output.              
set tB2A0 to (baseName &amp; &#34;.tB2A0&#34;)                                        
set tB2A1 to (baseName &amp; &#34;.tB2A1&#34;)                                        
set tB2A2 to (baseName &amp; &#34;.tB2A0&#34;) -- Make the same as Intent 0           
set tGamutOut to (baseName &amp; &#34;.gamutout&#34;)                                 
Some file(s) are needed to run this script. They MUST be stored in a      
folder                                                                    
called                                                                    
&#34;Data:Output&#34; that is in the same folder as ProfileMaker. Construct this  
path here.                                                                
set tGoalSpace to (dataPath &amp; &#34;17CubedLabGoals.v1&#34;)                       
set tA2BInLut to (dataPath &amp; &#34;A2BInlut888.v10&#34;)                           
set tNullLut3 to (dataPath &amp; &#34;NullLut3.v10&#34;)                              
set tNullLut1 to (dataPath &amp; &#34;NullLut1.v10&#34;)                              
tell front document of application &#34;ProfileMaker&#34;                         
activate -- for faster response                                           
get device                                                                
set tolr to tolerance of result                                           
set |dset| to first dataset whose enabled is true       
tell |dset|                                             
set labValues to lab                                                      
set dName to name                                                         
end tell                                                                  
end tell                                                                  
Now average the repeat neutral points. Create a list of the points.       
Average                                                                   
them. Compute the L, a, b, and E terms.                                   
Use RMS.                                                                  
set deviations to { }                                                     
set root3 to square root of 3                                             
repeat with i from 0 to 7                                                 
set theFirst to i * 73 + 1                                                
set theRest to i * 8 + 513                                                
set theList to {item theFirst of lab Values } &amp; (items theRest thru       
(theRest + 7) of lab Values)                                              
set ans to average theList -- mean, stdev, rms for one gray level         
set theMeans to mean of ans                                               
copy theMeans to item theFirst of lab Values -- copy mean back into       
original 512 area                                                         
set theOffset to { }                                                      
repeat with j from 1 to 3                                                 
set theOffset to theOffset &amp; -(item j of theMeans as real) --             
need the as real if theOffset is a negative number. Applescript error!    
end repeat                                                                
compute the difference between the mean and each item in the list.        
Then get the RMS x root 3 to get the E at each point                      
set ans to scale theList by factor {1, 1, 1 } with offset theOffset       
set theList to { }                                                        
repeat with j from 1 to 9                                                 
set temp to item j of ans                                                 
set x to root3 * (rms of (average temp))                                  
set theList to theList &amp; {(temp &amp; x) }                                    
end repeat                                                                
- Add toations to deviations &amp; {rms of (average theList) }                
list of deviations are each level                                         
end repeat                                                                
set deviations to rms of (average deviations) -- Get result across all    
levels                                                                    
Some routine can check the deviations to see if they are out of range.    
 if deviations are out of range then do the following code.               
  display dialog &#34;The rms errors of repeat patches exceed                 
predefined limits. The number of incidents is:&#34; &amp; ˜                 
   (first item of ans) buttons {&#34;Stop&#34;, &#34;Continue&#34;} default               
button 1 with icon caution                                                
  if button returned of result is &#34;Stop&#34;then return 0                     
Get the first 512 items of the labValues, then create the normalized      
data.                                                                     
First do the colorimetric.                                                
set labValues to items 1 thru 512 of labValues                            
Normalize to the Dmin point.                                              
set xyzData to transform labValues to XYZs with XYZn illum -- using       
Sylvania D50                                                              
set blackXYZ to first item of xyzData                                     
set whiteXYZ to last item of xyzData                                      
set labValues to transform xyzData to LABs with XYZn whiteXYZ             
set labValues to do black correction labValues ofendPoints {DMax:(first   
item of labValues), DMin:(last item of labValues) }                       
write map labValues increment by incrementList2 save to (file tInvIn1)    
write map (scale labValues by factor {652.8, 256.000094, 256.000094}      
with                                                                      
offset {0, 32768, 32768})˜                                          
increment by incrementList save to (file tA2B1)                           
Invert this map with the default goal space. Save the result to disk.     
invert3D file:tInvIn1 save to file tB2A1 output gamut to file tGamutOut   
goal                                                                      
space file tGoalSpace scale result by 257.0 ˜                       
message &#34;Computing inverse colorimetric data&#34; params                      
{smoothness:0.0, tolerance:0.1, iterations:5 }˜                     
protected points {{{1,9,9}, {0.0,0.0,0.0}}, {{17,9,9}, {1.0, 1.0,         
1.0}}}                                                                    
Normalize to the Dmin preserving the lightness. This is for the           
perceptual                                                                
tags.                                                                     
set temp to item 2 of whiteXYZ                                            
set labValues to transform xyzData to LABs with XYZn {(item 1 of          
whiteXYZ)/temp, 1.0, (item 3 of whiteXYZ)/temp }                          
set labValues to do black correction labValues ofendPoints {DMax:(first   
item of labValues), DMin:(last item of labValues)}                        
write map labValues increment by incrementList2 save to (file tInvIn0)    
write map (scale labValues by factor {652.8, 256.000094, 256.000094}      
with                                                                      
offset {0, 32768, 32768})˜                                          
increment by incrementList save to (file tA2B0)                           
Invert this map with the default goal space. Save the result to disk.     
invert3D file tInvIn0 save to file tB2A0 goal space file tGoalSpace       
scale                                                                     
result by 257.0˜                                                    
protected points {{{1,9,9}, {0.0,0.0,0.0}}, {{17,9,9}, {1.0, 1.0,         
1.0}}}˜                                                             
message &#34;Computing inverse perceptual data&#34;                               
tell application &#34;ProfileMaker&#34;                                           
activate                                                                  
tell front document                                                       
Add a copyright tag                                                       
get (current date) as string                                              
set myYear to fourth word of result                                       
make new tag at end of profile 1 with properties                          
        {signature:copyrightTag, type:textType,                           
data:&#34;Copyright&#34; &amp; myYear &amp; ˜                                       
          &#34;Polaroid Corporation. All rights reserved.&#34;}                   
make new tag at end of profile 1 with properties ˜                  
        {signature:mediaWhitePointTag, type:XYZType,                      
data:whiteXYZ }                                                           
make new tag at end of profile 1 with properties ˜                  
        {signature:mediaBlackPointTag, type:XYZType,                      
data:blackXYZ }                                                           
Make the AtoB tags. 2 is identical to 0.                                  
make new tag at end of profile 1 with properties ˜                  
        {signature:AToB0Tag, type:lut16Type, data: {alias                 
tA2BInLut, ˜                                                        
          alias tA2B0, alias tNulILut3}}                                  
make new tag at end of profile 1 with properties ˜                  
        {signature:AToB1 Tag, type:lut16Type, data:{alias                 
tA2BInLut, ˜                                                        
          alias tA2B1, alias tNulILut3}}                                  
make new tag at end of profile 1 with properties ˜                  
        {signature:AToB2Tag, type:lut16Type, data:{alias                  
tA2BInLut, ˜                                                        
          alias tA2B0, alias tNullLut3}}                                  
Make the BtoA tags. 2 is identical to 0                                   
make new tag at end of profile 1 with properties ˜                  
        {signature:BToA0Tag, type: lut16Type, data:{alias                 
tNullLut3, ˜                                                        
          alias tB2A0, alias tNullLut3}}                                  
make new tag at end of profile 1 with properties ˜                  
        {signature:BToA1Tag, type:lut16Type, data: {alias                 
tNullLut3, ˜                                                        
          alias tB2A1, alias tNullLut3}}                                  
make new tag at end of profile 1 with properties ˜                  
        {signature:BToA2Tag, type: lut16Type, data:{alias                 
tNullLut3, ˜                                                        
          alias tB2A0, alias tNullLut3}}                                  
Make the gamut tag. Its luts should be the same as the                    
BtoA0tag.                                                                 
make new tag at end of profile 1 with properties                          
        {signature: gamutTag, type:lut16Type, data:{alias                 
tNullLut3, ˜                                                        
          alias tGamutOut, alias tNullLut1}}                              
Modify the prismInformation tag                                           
tell application &#34;ProfileMaker&#34;                                           
        user                                                              
        set theUser to name of result                                     
end tell                                                                  
set tmp to {{&#34;script &amp; scriptName &amp; &#34;(compute)&#34;, &#34;ver.&#34; &amp;                 
scriptVersion &amp; (&#34;ran&#34; &amp; ˜                                          
        (current date) as text) &amp; &#34;,via ProfileMaker version&#34;             
&amp; version of application &#34;ProfileMaker&#34; &amp; &#34;,by&#34; &amp; theUser &amp; ˜       
        &#34;,dataset \&#34;&#34;&amp; dName &amp; &#34;\&#34; of document \&#34;&#34; &amp; name                 
&amp; &#34;\&#34;&#34;}}                                                                  
This nextstatement would add the above text to the                        
Polainformation tag (was called prism)                                    
tell p1ib to UpdatePrismInformation(tmp)                                  
end tell                                                                  
end tell                                                                  
clean up the temporary files.                                             
tell application &#34;Finder&#34;                                                 
delete alias tInvIn0                                                      
delete alias tInvIn1                                                      
delete alias tA2B0                                                        
delete alias tA2B1                                                        
delete alias tA2B2 -- Not present yet                                     
delete alias tB2A0                                                        
delete alias tB2A1                                                        
delete alias tB2A2 -- Not present yet                                     
delete alias tGamutOut                                                    
end tell                                                                  
beep                                                                      
display dialog ˜                                                    
&#34;Computation Done. Eleven tags added or updated. Remember to              
save your profile.&#34; buttons {&#34;OK&#34;} default button 1 with icon 1           
return 0                                                                  
end compute                                                               
on validate( )                                                            
This script verifies the operation of a current profile for a device. It  
must                                                                      
be the profile embedded                                                   
in the front most document of ProfileMaker.                               
Get the path to the data folder. Load the libraries. Generate the         
dataset                                                                   
names.                                                                    
tell application &#34;Finder&#34; to set tfolder to ((container of (path to       
application                                                               
&#34;ProfileMaker&#34;)) as text) &amp; &#34;data:Output:&#34;                                
Check on the existence of previous datasets.                              
tell front document of application &#34;ProfileMaker&#34;                         
set enabled of every dataset to false                                     
try                                                                       
set enabled of every dataset whose state is validateCode to               
true                                                                      
on error                                                                  
end try                                                                   
get every dataset whose enabled is true -- Should have a list of 3        
datasets.                                                                 
set dsetCount to count result                                             
Make new datasets if required                                             
set nameList to {&#34;Calculated&#34;, &#34;Measured&#34;, &#34;Adjusted&#34;}                    
- Name of dataset we make for the                                         
check, or have made for the check.                                        
if dsetCount is 0 then                                                    
repeat with i from 1 to 3                                                 
        make new dataset at end ˜                                   
          with properties ˜                                         
          {type:Color Space, layout:{9, 9, 1}, patch                      
size:{40, 40}, color source: ˜                                      
            {category:Import, name:(tfolder &amp;                             
&#34;Validate9x9v2.rgb&#34;) }, lab source: ˜                               
            {category:PR 650}, LUT source: ˜                        
            {category:Resource, name: &#34;NULL&#34;},                            
name: ˜                                                             
chkName &amp; item i of nameList,                                             
state:validateCode }                                                      
        if dsetCount is 0 then set lab source of result to                
{category:AToB1 Tag }                                                     
        set dsetCount to dsetCount + 1                                    
        endrepeat                                                         
        return 0 -- User measures data. Runs routine again to finish      
the analysis.                                                             
endif                                                                     
There should be 3, enabled datasets at this point. Get them in an         
ordered list by their names                                               
if dsetCount is not 3 then error &#34;Wrong number of datasets!!&#34;             
set dsetList to { }                                                       
repeat with i from 1 to 3                                                 
try                                                                       
        set dsetList to (dsetList &amp; (first dataset whose enabled          
is true and name contains item i of nameList))                            
on error                                                                  
        error &#34;The required datasets with proper names are not            
present. Please check them.&#34;                                              
end try                                                                   
end repeat                                                                
set lab of every patch of item 3 of dsetList to { }                       
set labValues to lab of item 2 of dsetList                                
tell profile 1 -- we should be able to get data either from the profile   
or                                                                        
the document                                                              
try                                                                       
        set blackXYZ to data of first tag whose signature is              
mediaBlackpointTag                                                        
        set whiteXYZ to data of first tag whose signature is              
mediaWhitePointTag                                                        
on error                                                                  
        error &#34;Cannot find media XYZ tags!&#34;                               
end try                                                                   
end tell                                                                  
end tell                                                                  
Normalize to the Dmin point.                                              
set xyzData to transform labValues to XYZs with XYZn illum -- using       
Sylvania D50                                                              
set labValues to transform xyzData to LABs with XYZn whiteXYZ             
set nLab to transform {blackXYZ, whiteXYZ} to LABs with XYZn              
whiteXYZ                                                                  
set labValues to do black correction labValues of endpoints {DMax:        
(first                                                                    
item of nLab), DMin:(last item of nLab)}                                  
tell front document of application &#34;ProfileMaker&#34;                         
set lab of (item 3 of dsetList) to labValues                              
end tell                                                                  
Now do the differences calculation.                                       
tell front document of application &#34;ProfileMaker&#34;                         
set diffs to compare item 3 of dsetList to item 1 of dsetList             
end tell                                                                  
set diffs to average diffs                                                
tell front document of application &#34;ProfileMaker&#34;                         
set strData to (&#34;Validated on&#34; &amp; (current date) as text) &amp; &#34;by&#34; &amp;         
&#34;????&#34; &amp; &#34;.Delta LabE stats: &#34; &amp; ˜                                  
(diffs as text)                                                           
repeat with |dset|in dsetList                           
tell |dset|                                             
        get notes                                                         
        set notes to strData                                              
end tell                                                                  
end repeat                                                                
set notes of profile 1 to profileNotes                                    
Modify the prismInformation tag to reflect what has been done.            
return 0                                                                  
end tell                                                                  
end validate                                                              
__________________________________________________________________________