home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / adobe / spec / photoshp.txt < prev    next >
Text File  |  1994-06-01  |  3KB  |  104 lines

  1.  
  2. Adobe Photoshop_ 2.5 File Format
  3.  
  4. ¿1992 Thomas Knoll
  5. ¿1993 Adobe Systems, Inc.
  6.  
  7. Photoshop 2.5 format was designed to be fast and easy to read and 
  8. write, while solving a couple of problems with Photoshop 2.0 format:
  9.  
  10. (1) It is data fork only, thus cross-platform.
  11.  
  12. (2) It uses optional RLE compression, so simple images and mask channels can 
  13. be saved much more compactly.
  14.  
  15. The Macintosh file type code is '8BPS'. The DOS extension is '.PSD'.  All 
  16. information is stored in big-endian byte order, so little-endian machines 
  17. will have to swap bytes when reading and writing.
  18.  
  19. The following sections describe the information stored in the file's data 
  20. fork, in order.
  21.  
  22. 1.  Signature  (4 bytes)
  23.  
  24. Always equal to '8BPS' for this format.  Do not try to read the file if 
  25. the signature does not match this value.
  26.  
  27. 2.  Version  (2 bytes)
  28.  
  29. Always equal to 1 for this format.  Do not try to read the file if the 
  30. version number does not match this value.
  31.  
  32. 3.  Reserved  (6 bytes)
  33.  
  34. Readers should ignore these bytes, and writers should write zeros.
  35.  
  36. 4.  Channels  (2 bytes)
  37.  
  38. The number of channels in the image, including any alpha channels.  Supported 
  39. range is 1 to 16 for Photoshop 2.5.
  40.  
  41. 5.  Rows  (4 bytes)
  42.  
  43. The height of the image in pixels.  Supported range is 1 to 30000 for 
  44. Photoshop 2.5.
  45.  
  46. 6.  Columns  (4 bytes)
  47.  
  48. The width of the image in pixels.  Supported range is 1 to 30000 for 
  49. Photoshop 2.5.
  50.  
  51. 7.  Depth  (2 bytes)
  52.  
  53. The number of bits per channel.  Supported values are 1 and 8 for 
  54. Photoshop 2.5.
  55.  
  56. 8.  Mode (2 bytes)
  57.  
  58. The color mode of the file.  Supported values are: Bitmap = 0, Grayscale = 1, 
  59. Indexed Color = 2, RGB Color = 3, CMYK Color = 4, Multichannel = 7, 
  60. Duotone = 8, Lab Color = 9.
  61.  
  62. 9.  Mode Data (4 byte length + variable)
  63.  
  64. Contains the required data to define the color mode.
  65.  
  66. For indexed color images, the count will be equal to 768, and the mode data 
  67. will contain the color table for the image, in non-interleaved order.
  68.  
  69. For duotone images, the mode data will contain the duotone specification, 
  70. the format of which is not documented.  Non-Photoshop readers can treat 
  71. the duotone image as a grayscale image, and keep the duotone specification 
  72. around as a black box for use when saving the file.
  73.  
  74. For all other modes, the byte count is zero.
  75.  
  76. 10.  Image Resources  (4 byte length + variable)
  77.  
  78. Contains a Photoshop 2.5 image resources block, the format of which is 
  79. documented separately.  Information contained in this block includes 
  80. the image's resolution, and pen tool paths.
  81.  
  82. 11.  Reserved Data (4 byte length + variable)
  83.  
  84. Reserved for future use.  Readers should skip this, and writers should write 
  85. a zero length block.
  86.  
  87. 12.  Compression (2 bytes)
  88.  
  89. Two values are currently define:  0 = Raw Data, 1 = RLE compressed.
  90.  
  91. 13.  Image Data (variable)
  92.  
  93. Image data is stored in planar order, e.g. all the red data, all the green 
  94. data, etc.  Each plane is stored in scanline order, with no pad bytes.
  95.  
  96. If the compression code is 0, the image data is just the raw image data.
  97.  
  98. If the compression code is 1, the image data starts with the byte counts 
  99. for all the scan lines (rows * channels), with each count stored as a 
  100. two-byte value.  The RLE compressed data follows, with each scan 
  101. line compressed separately.  The RLE compression is the same compression 
  102. algorithm used by the Macintosh ROM routine PackBits, and the TIFF standard.
  103.  
  104.