home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / macintosh technotes and q&as / qa / c / embeddingicc_eps.hqx / EmbeddingICC_EPS
Encoding:
Text File  |  1995-06-08  |  5.6 KB  |  119 lines

  1. Embedding International Color Consortium Profiles in EPS
  2.  
  3. There are two places within EPS files that embedding International Color
  4. Consortium (ICC) profiles are appropriate.  1) Associated with a screen
  5. preview.  2) Associated with the page description.  Embedding ICC profiles
  6. within a screen preview is necessary so that applications using this screen
  7. preview to display a representation of the EPS page description can do so
  8. with accurate colors.  Embedding ICC profiles within a page description is
  9. necessary so that sophisticated applications, such as OPI server software,
  10. can perform color conversions along with image replacement.  For general
  11. information concerning PostScript's Document Structuring Conventions (DSC),
  12. the EPS file format, or specific PostScript operators, see the PostScript
  13. Language Reference Manual, second edition.
  14.  
  15. 1) There are a variety of different methods of storing a screen preview
  16. within an EPS file depending on the intended environment.  For cross
  17. platform applications with embedded ICC profiles, TIFF screen previews are
  18. recommended.  The TIFF format has been extended to support the embedding of
  19. ICC profiles.  ICC profiles can also be embedded in a platform specific
  20. manner.  For example on the Macintosh, Apple has defined a method for
  21. embedding ICC profiles in PICT files.
  22.  
  23. Note that a given page description may use multiple distinct color spaces. 
  24. In such cases, color conversions must be performed to a single color space
  25. to associate with the screen preview.
  26.  
  27. 2) ICC profiles can also be embedded in the page description portion of an
  28. EPS file using the %%BeginICCProfile / %%EndICCProfile comments.  This
  29. convention is defined as follows.
  30.  
  31. %%BeginICCProfile:  <profileid> <numberof> [<type> [<bytesorlines>]]
  32.   <profileid> ::= <text>            (Profile ID)
  33.   <numberof> ::= <int>             (Lines or physical bytes)
  34.   <type> ::= Hex | ASCII            (Type of data)
  35.   <bytesorlines> ::= Bytes | Lines  (Read in bytes or lines)
  36. %%EndICCProfile (no keywords)
  37.  
  38. These comments are designed to provide information about embedded ICC
  39. profiles.  If the type argument is missing, ASCII data is assumed.  ASCII
  40. refers to an ASCII base-85 representation of the data.  If the bytesorlines
  41. argument is missing, <numberof> shall be considered to indicate bytes of
  42. data. If <numberof> = -1, the number of bytes of data are unknown.  In this
  43. case, to skip over the profile one must read data until the encountering
  44. the %%EndICCProfile comment.
  45.  
  46. <profileID> provides the profile's ID in order to synchronize it with
  47. PostScript's setcolorspace and findcolorrendering operators and associated
  48. operands (see below).  Note that <numberof> indicates the bytes of physical
  49. data, which vary from the bytes of virtual data in some cases.  With hex,
  50. each byte of virtual data is represented by two ASCII characters (two bytes
  51. of physical data).  Although the PostScript interpreter ignores white space
  52. and percent signs in hex and ASCII data, these count toward the byte count.
  53.  
  54.  
  55. Each line of profile data shall begin with a single percent sign followed
  56. by a space (% ).  This makes the entire profile section a PostScript
  57. language comment so the file can be sent directly to a printer without
  58. modification.  The space avoids confusion with the open extension mechanism
  59. associated with DSC comments.
  60.  
  61. ICC profiles can be embedded within EPS files to allow sophisticated
  62. applications, such as OPI server software, to extract the profiles, and to
  63. perform color processing based on these profiles.  In such situations it is
  64. desirable to locate the page description's color space and rendering
  65. intent, since this color space and rendering intent may need to be modified
  66. based on any color processing.  The %%BeginSetColorSpace /
  67. %%EndSetColorSpace and %%BeginRenderingIntent / %%EndRenderingIntent
  68. comments are used to delimit the color space and rendering intent
  69. respectively.  
  70.  
  71. %%BeginSetColorSpace <profileid>
  72.   <profileid> ::= <text>            (ICC Profile ID)
  73. %%EndSetColorSpace (no keywords)
  74.  
  75. <profileid> provides the ICC profile's ID corresponding to this color
  76. space.  The ICC profile with this profile must have occured in the
  77. PostScript job using the  %%BeginICCProfile / %%EndICCProfile comment
  78. convention prior to this particular %%BeginSetColorSpace comment.
  79.  
  80. An example usage is shown here for CIE 1931 (XYZ)-space with D65 white
  81. point that refers to the ICC profile with <profileid> = XYZProfile.
  82.  
  83. %%BeingSetColorSpace XYZProfile
  84. [/CIEBasedABC <<
  85.   /WhitePoint [0.9505 1 1.0890]
  86.   /RangeABC [0 0.9505 0 1 0 1.0890]
  87.   /RangeLMN [0 0.9505 0 1 0 1.0890]
  88. >>] setcolorspace
  89. %%EndSetColorSpace
  90.  
  91. Note that the setcolorspace command is included within the comments.  The
  92. PostScript enclosed in these comments shall not perform any other
  93. operations other than setting the color space and shall have no side
  94. effects.
  95.  
  96. %%BeginRenderingIntent <profileid>
  97.   <profileid> ::= <text>            (ICC Profile ID)
  98. %%EndRenderingIntent
  99.  
  100. <profileid> provides the ICC profile's ID corresponding to this rendering
  101. intent.  The ICC profile with this profile must have occured in the
  102. PostScript job using the  %%BeginICCProfile / %%EndICCProfile comment
  103. convention prior to invocation of this particular %%BeginRenderingIntent
  104. comment.
  105.  
  106. An example usage is shown here for the the Perceptual rendering intent that
  107. refers to the ICC profile with <profileid> = RGBProfile.
  108.  
  109. %%BeginRenderingIntent RGBProfile
  110. /Perceptual findcolorrendering pop 
  111. /ColorRendering findresource setcolorrendering
  112. %%EndRenderingIntent
  113.  
  114. Note that the setcolorrendering command is included within the comments.  
  115. The PostScript enclosed in these comments shall not perform any other
  116. operations other than setting the rendering intent and shall have no side
  117. effects.
  118.  
  119.