Color Profiles

Top Previous Topic Next Topic  Print this topic

This section describes the support for color profiles by XF Rendering Server 2013.

 

Graphics professionals know the importance of color management. No matter how much thought an user puts into the color scheme for a given project, all of that work is for naught if the user can not get the printed results to match the expectations.

 

Each color is encoded as a combination of Red, Green and Blue values. What do these values mean; e.g. what color is 88/249/17? Without any context, it is a meaningless triplet of numbers. This is where color spaces come in.

 

A color space provides the definition for what color the numerical combination represents.

If the example of 88/249/17 is interpreted using the Adobe RGB color space, it is a vibrant, attention getting green. If, on the other hand, the same value is interpreted using the sRGB color space, it is a pale, yellowish-green.

 

                       (88, 249, 17) in Adobe RGB The same RGB value in sRGB

 

RGB Colors

By default all colors used in the XSL-FO documents are considered to be given in the sRGB color space.

 

To use RGB colors, the user must either specify values for the each component (Red, Green and Blue), or a color name. XF Rendering Server 2013 supports the extended palette described in the SVG specifications for both SVG and XSL-FO input.

 

The following notations are equivalent:

 

       

       <fo:block color="red">Red text.</fo:block>

       <fo:block color="rgb(255,0,0)">Red text.</fo:block>

       <fo:block color="rgb(100%,0%,0%)">Red text.</fo:block>

       <fo:block color="#FF0000">Red text.</fo:block>

       <fo:block color="#F00">Red text.</fo:block>

 

 

The last notation is called a short notation. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00.

 

When generating PDFs, all RGB colors are mapped to a predefined PDF color space called DeviceRGB.

 

CMYK Colors

An Ecrion specific extension can be used for specifying colors in CMYK (Cyan,Magenta,Yellow,Black) format:

 

       

       <fo:block color="cmyk(0%,100%,100%,0%)">Red text.</fo:block>

      <fo:block color="cmyk(0,1,1,0)">Red text.</fo:block>

      <fo:block color="cmyk(0,0.5,0.7,0)">Color text.</fo:block>

 

 

When generating PDFs, all CMYK colors specified using this extension are mapped to DeviceCMYK color space.

 

ICC Profiles

In addition, the XSL-FO recommendation specifies how to use colors described by an external ICC profile. With accurate monitor and printer profiles, the prints will closely

match what is displayed on the monitor.

 

To declare a color space, the fo:color-profile element must be used.

 

Example of usage:

 

 

<?xml version="1.0" encoding="utf-8" ?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

       <fo:declarations>

               <fo:color-profile color-profile-name="RGBColorProfile" src="ColorProfiles\RGB\AppleRGB.icc"/> 

               <fo:color-profile color-profile-name="CMYKColorProfile" src="ColorProfiles\CMYK\USWebCoatedSWOP.icc"/> (1)

       </fo:declarations>

       <fo:layout-master-set>

               <fo:simple-page-master master-name="all-pages" page-width="8in" page-height="11in">

                       <fo:region-body region-name="xsl-region-body" column-gap="0.25in" padding-top="6pt" padding-left="6pt" padding-right="6pt" padding-bottom="6pt" margin-top="0.7in" margin-left="0.7in" margin-right="0.7in"                                                margin-bottom="0.7in"/>

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.7in"padding-top="6pt" padding-left="0.7in" padding-right="0.7in" padding-bottom="6pt"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.7in" padding-top="6pt" padding-left="0.7in" padding-right="0.7in" padding-bottom="6pt"/>

               </fo:simple-page-master>

               <fo:page-sequence-master master-name="default-sequence">

                       <fo:repeatable-page-master-reference master-reference="all-pages"/>

               </fo:page-sequence-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="default-sequence">

               <fo:flow flow-name="xsl-region-body" font-size="12pt" font-family="Times New Roman">

                       <fo:block background="rgb(255,0,0)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,0,#RGBColorProfile, 1, 0, 0)">ICC RGB Color</fo:block> (2)

                       <fo:block background="rgb-icc(255,0,0,#CMYKColorProfile, 0, 1, 1, 0)">ICC CMYK Color</fo:block>

                       <fo:block background="rgb(0,255,0)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(0,255,0,#RGBColorProfile, 0, 1, 0)">ICC RGB Color</fo:block>

                       <fo:block background="rgb-icc(0,255,0,#CMYKColorProfile, 0.63, 0, 1, 0)">ICC CMYK Color</fo:block>

                       <fo:block background="rgb(255,0,255)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,255,#RGBColorProfile, 1, 0, 1)">ICC RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,255,#CMYKColorProfile, 0.27, 0.82, 0, 0)">ICC CMYK Color</fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

<?xml version="1.0" encoding="utf-8" ?>

 

The important points in this example are:

 

(1) Two color spaces, named "RGBColorProfile" and "CMYKColorProfile", are declared.

(2) The rgb-icc function is used for specifying the intensities of each component in this color space. The name of this function is a little misleading, because rgb-icc can be used to describe not only RGB (Red, Green, Blue) colors, but also Grayscale, CMYK and spot (Pantone) colors.

 

rgb-icc has the following arguments:

 

       

       rgb-icc(fallbackRed,fallbackGreen,fallbackBlue,#colorProfileReference, component1,..., componentN)

 

 

·First three parameters are used when the color profile can not be found, or when the document is displayed in XF Designer.
·The fourth parameter is a reference to a color profile declared with fo:color-profile.
·The fifth and next parameters are used to specify the color.

 

If the color profile is a Grayscale color profile, only one component must be used.

If the color profile is RGB, three values must be used, while for a CMYK color profile four values are needed. Each value is a floating point number that represents the intensity and  must be between 0.00 and 1.00.

 

 

Note:

·XF Rendering Server 2013 will output an error if the number of components specified when using rgb-icc does not match the number of colors defined in the color profile.