ADOBE SYSTEMS INCORPORATED ADOBE SYSTEMS INCORPORATED
Corporate Headquarters Corporate Headquarters 345 Park Avenue 345 Park Avenue San Jose, CA 95110-2704 San Jose, CA 95110-2704 (408) 536-6000 (408) 536-6000 http://partners.adobe.com http://partners.adobe.com
b
b
b
b
c
c
Photoshop CS File
Photoshop CS File
Formats Specification
Formats Specification
Copyright 1991–2003 Adobe Systems Incorporated. Copyright 1991–2003 Adobe Systems Incorporated. All rights reserved.
All rights reserved.
Portions Copyright 1990–1991, Thomas Knoll. Portions Copyright 1990–1991, Thomas Knoll.
The information in this document is furnished for informational use only, is subject to change without notice, and should not be The information in this document is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in this document. The software described in this
any errors or inaccuracies that may appear in this document. The software described in this document is furnished under license anddocument is furnished under license and may only be used or copied in accordance with the terms of such license.
may only be used or copied in accordance with the terms of such license. Adobe, After Effects, PhotoDeluxe, Adobe Premi
Adobe, After Effects, PhotoDeluxe, Adobe Premi ere, Photoshop, Adobe Illustrator, Adobe Type Manager, Aere, Photoshop, Adobe Illustrator, Adobe Type Manager, ATM and TM and PostScript arePostScript are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple, Macintosh, and Mac are trademarks of Apple Computer, Inc. registered in the United States and other countries. Mic
Macintosh, and Mac are trademarks of Apple Computer, Inc. registered in the United States and other countries. Mic rosoft androsoft and Windows are either registered trademarks or trademarks of Microsoft
Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All otherCorporation in the United States and/or other countries. All other products are the property of their respective owners.
Contents
Contents
Preface
Preface . . . .
. . . .
. . . .
. . . 5
. 5
Audience Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 WhatWhat Is Is In In This This Document Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 SDK
SDK Discussion Discussion Mailing Mailing List List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Ch
Chap
apte
ter
r 1
1
Th
The
e Ph
Phot
otos
osho
hop
p Fi
File
le Fo
Form
rmat
at . . .
. . . .
. . . .
. . . .
. . . .
. . . . .
. . 7
7
Introduction. . .
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Large
Large Document Document FormatFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Windows
Windows . . . . . . . . . . . . 77 Mac
Mac OS OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Photoshop
Photoshop File File FormatFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 File
File Header Header Section Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10. 10 Color
Color Mode Mode Data Data Section Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. 11 Image
Image Resources Resources Section . . . . . Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 Image
Image Resource Resource Blocks Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 Image
Image Resource Resource IDsIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1313 Layer
Layer and and Mask Mask Information Information SectionSection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2424 Additional
Additional Layer Layer InformationInformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28. 28 Image
Image Data Data Section Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47. . 47
C h
Cha p
a pt e
t er
r 2
2
O t
O th e
h er
r D o
Doc u
c um e
m en t
n t F i
F il e
l e F o
F or m
r ma t
a ts
s . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . 4
49
9
Photoshop
Photoshop EPS EPS files files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49. 49 TIFF
TIFF filesfiles . . . . . . . 51. . . 51 Photoshop-specific
Photoshop-specific TIFF TIFF TTagsags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5353 TIFF
TIFF Files Files on on Mac Mac OS OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5353
Ch
Chap
apte
ter
r 3
3
Ad
Addi
diti
tion
onal
al Fi
File
le Fo
Form
rmat
ats
s . . . .
. . . .
. . . .
. . . .
. . . .
. . 5
55
5
Actions
Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56. . 56 Arbitrary
CMYK
CMYK Setup Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6464 Color
Color Books Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6666 Color
Color Table. Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6767 Color
Color Swatches Swatches . . . . . . . 68. . . 68 Contours
Contours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70. . 70 Curves
Curves . . . . . . . 72. . . 72 Custom
Custom Kernel Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7575 Duotone
Duotone OptionsOptions . . . . . . . 76. . . 76 Halftone
Halftone ScreensScreens. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78. . 78 Hue/Saturation
Hue/Saturation . . . . . . . 79. . . 79 Levels
Levels . . . . . . . 80. . . 80 Monitor
Monitor Setup Setup . . . . . . . 82. . . 82 Replace
Replace Color/Color Color/Color Range . . . . Range . . . . . . . . . . . . . . . . . . . . . . . 83. . 83 Selective
Selective ColorColor . . . . . . . 85. . . 85 Separation
Separation Tables Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86. 86 Transfer
Preface
Preface
Welcome to the Adobe Photoshop
Welcome to the Adobe Photoshop ® ® File Format Specification!File Format Specification!
This document is the detailed specification of the Adobe Photoshop file format and This document is the detailed specification of the Adobe Photoshop file format and other pertinent file formats that Adobe Photoshop reads and writes.
other pertinent file formats that Adobe Photoshop reads and writes.
Audience
Audience
The Adobe Photoshop SDK is a
The Adobe Photoshop SDK is a toolkit for C and C++ programmers who wish to writetoolkit for C and C++ programmers who wish to write
plug–ins for Adobe Photoshop on
plug–ins for Adobe Photoshop on Macintosh and Windows systems.Macintosh and Windows systems.
This document assumes you are proficient in the C programming language and its This document assumes you are proficient in the C programming language and its tools. The source code files in the SDK are
tools. The source code files in the SDK are written for Metrowerks CodeWarrior on thewritten for Metrowerks CodeWarrior on the
Macintosh, and Microsoft Visual C++ on Windows. Macintosh, and Microsoft Visual C++ on Windows. Y
You should have a working knowledge of ou should have a working knowledge of Adobe Photoshop, and understand Adobe Photoshop, and understand howhow
plug–in modules work from a user’s viewpoint. This guide assumes you understand plug–in modules work from a user’s viewpoint. This guide assumes you understand Photoshop terminology such as
Photoshop terminology such as paths paths ,, layers layers andand masks masks . For more information,. For more information,
consult the
consult the Adobe Photoshop User Guide Adobe Photoshop User Guide ..
This guide does not cont
This guide does not contain information on creating plug–in modules ain information on creating plug–in modules for Unix versionsfor Unix versions
of Photoshop. The Photoshop Unix
of Photoshop. The Photoshop Unix SDK is available on the Photoshop Unix productSDK is available on the Photoshop Unix product
CD
CD. Y. You must purchase ou must purchase the product the product CD to obCD to obtain the SDK.tain the SDK.
What Is In This Document
What Is In This Document
This document has three chapters: This document has three chapters:
ll ChapterChapter1, “The Photo1, “The Photoshop File Fshop File Formatormat,,””describes the Photoshop (describes the Photoshop (PSPSDD) native file) native file
format in detail. format in detail.
ll ChapterChapter2, “Other Doc2, “Other Document Filument File Formatse Formats,,”” discusses Photoshop’s handling of thediscusses Photoshop’s handling of the
EP
EPSSandand TIFFTIFFfile formats, which it can also create and read.file formats, which it can also create and read.
ll ChapterChapter3, “Addit3, “Additional Fiional File Formatle Formatss,,”” describes the formats of other files used bydescribes the formats of other files used by
Photoshop to store information about such items as colors, brushes and so forth. Photoshop to store information about such items as colors, brushes and so forth.
N
NOOTTEE:: For more information about file formats, you may wish to consult theFor more information about file formats, you may wish to consult the
Encyclopedia of Graphics File Formats
Encyclopedia of Graphics File Formats by James D. Murray & Williamby James D. Murray & William
vanRyper (1994, O’Reilly & Associates, Inc., Sebastopol, CA, ISBN 1–
SDK Discussion Mailing List SDK Discussion Mailing List
SDK Discussion Mailing List
SDK Discussion Mailing List
The Adobe Solutions Network
The Adobe Solutions Network (ASN) maintains an electronic mailing list that is used(ASN) maintains an electronic mailing list that is used
as peer discussion for developers. It is unmoderated and is populated
as peer discussion for developers. It is unmoderated and is populated by developersby developers
just like yourself
just like yourself, offering peer discussion of , offering peer discussion of software development kit, Adobe plug-software development kit, Adobe
plug-ins, and related issues. The mailing list is for discussion of all of
ins, and related issues. The mailing list is for discussion of all of the SDKs that fallthe SDKs that fall
under the ASN. T
under the ASN. To join the discussion send o join the discussion send an e-mail to:an e-mail to:
[email protected]
[email protected]
with the subject: with the subject:
SUBSCRIBE SUBSCRIBE
and these fields in your message body: and these fields in your message body: 1.
1. Your full name:Your full name:
2.
2. Business name:Business name:
3. 3. Address:Address: 4. 4. City:City: 5. 5. State:State: 6. 6. Country:Country: 7.
7. Country code or Zip:Country code or Zip:
8.
8. Area code and phone number (business is fine):Area code and phone number (business is fine):
9.
9. ASN member number:ASN member number:
"N/A
"N/A
" if not a member;" if not a member;"Info
"Info
" if want info." if want info. T1
1
The Photoshop File Format
The Photoshop File Format
Introduction
Introduction
This chapter discusses the Photoshop
This chapter discusses the Photoshop native file format.native file format.
Large Document Format
Large Document Format
The Large Document Format (8BPB/PSB) supports documents up to 300,000 pixels The Large Document Format (8BPB/PSB) supports documents up to 300,000 pixels in any dimension. All
in any dimension. All Photoshop features, such as Photoshop features, such as layerslayers, effects, and filters, a, effects, and filters, arere
supported by the PSB format. The PSB format is identical to the Photoshop native supported by the PSB format. The PSB format is identical to the Photoshop native format in many ways. This document
format in many ways. This document will cover the differences found in the will cover the differences found in the PSBPSB
format by donating a
format by donating a **PSB****PSB** marker.marker.
Windows
Windows
All data is stored in big
All data is stored in big endian byte order. On the Windows platform, you must byteendian byte order. On the Windows platform, you must byte
swap short and long integers when reading or writing. swap short and long integers when reading or writing.
Mac OS
Mac OS
For cross–platform compatibility
For cross–platform compatibility, all information needed , all information needed by Photoshop is stored in by Photoshop is stored in thethe
data fork. For interoperability with
data fork. For interoperability with other Macintosh applications, hother Macintosh applications, howevowever, someer, some
information is duplicated in resources stored in the resource fork of the file: information is duplicated in resources stored in the resource fork of the file:
ll For compatibility with image cataloging applications, theFor compatibility with image cataloging applications, the 'pnot''pnot'resource id 0resource id 0
contains references to thumbnail, keywords, and caption information stored in contains references to thumbnail, keywords, and caption information stored in other resources.
other resources.
ll The thumbnail picture is stored in aThe thumbnail picture is stored in a'PICT''PICT'resource, the keywords are stored inresource, the keywords are stored in
'STR#'
'STR#'resource 128 and the caption text is stored inresource 128 and the caption text is stored in'TEXT''TEXT'resource 128. Forresource 128. For
T
T ABLE ABLE 11..11 PPhhoottoosshhoop fp fiille te tyyppees s
O
OSS FFiilleettyyppee//eexxtteennssiioonn
Mac OS
Mac OS 8BPS8BPS
Windows
Photoshop File Format Photoshop File Format
1
1
ll All of the data from Photoshop’s File Info dialog is stored in 'All of the data from Photoshop’s File Info dialog is stored in 'ANPAANPA' resource 10000.' resource 10000.
The data in this resource is stored as an IPTC–NAA record 2.For more information The data in this resource is stored as an IPTC–NAA record 2.For more information on the format of this resource, see the documents in the
on the format of this resource, see the documents in the
IPTC
IPTC
folder of thefolder of theDocumentation
Documentation
folder.folder.Photoshop File Format
Photoshop File Format
The Photoshop file format is divided into five major parts, as shown in
The Photoshop file format is divided into five major parts, as shown in FiFigugurere 1.1.11::
F
F IGURE IGURE 1.1.11 PhPhototososhohop p fifile le ststruructcturure e
1.
1. File header (seeFile header (see “File H“File Header Seceader Section” on pation” on pagege 1010).).
2.
2. Color mode data (seeColor mode data (see “Color M“Color Mode Data Secode Data Section” on pagtion” on pagee 1111))
3.
3. Image resources (seeImage resources (see “Imag“Image Resourcee Resources Sections Section” on page” on page 1212))
4.
4. Layer and mask information (seeLayer and mask information (see “Layer and Mask Information Section” on“Layer and Mask Information Section” on
pa
pagege2424)) 5.
5. Image data (seeImage data (see “Image D“Image Data Secata Section” on tion” on pagepage 4747).).
The file header has
The file header has a fixed length; the other a fixed length; the other four sections are variable in length.four sections are variable in length.
File Header
File Header
Color Mode Data
Color Mode Data
Image Resources
Image Resources
Layer and Mask
Layer and Mask
Image Data
Image Data
Information
Information
Photoshop File Format Photoshop File Format
1
1
When writing one of these sections, you should write all fields in the section, as When writing one of these sections, you should write all fields in the section, as Photoshop may try to read the entire section. Whenever writing a file and skipping Photoshop may try to read the entire section. Whenever writing a file and skipping bytes, you should explicitly write zeros for the
bytes, you should explicitly write zeros for the skipped fields.skipped fields.
When reading one of the length-delimited sections, use the length field to decide When reading one of the length-delimited sections, use the length field to decide when you should stop reading. In most cases, the leng
when you should stop reading. In most cases, the length field indicates the number ofth field indicates the number of
bytes, not records,
bytes, not records, following.following.
N
NOOTTEE:: The values in “Length” column in all tables are The values in “Length” column in all tables are in bytes.in bytes.
N
NOOTTEE:: All values defined as Unicode strings consist of:All values defined as Unicode strings consist of:
–
– A 4-byA 4-byte length fite length field, repreld, representiesenting the numbng the number of charer of characters iacters in the string (n the string (notnot
bytes). bytes). –
File Header Section File Header Section
1
1
File Header Section
File Header Section
The file header contains the basic properties of the image. The file header contains the basic properties of the image.
T
T ABLE ABLE 11..22 FFiille e hheeaaddeer r sseeccttiioon n
Length Description Length Description 4
4 Signature: Signature: always always equal equal toto'8BPS''8BPS'. Do not try to read the file if the. Do not try to read the file if the
signature does not match this value. signature does not match this value. 2
2 VVersion: ersion: always always equal equal to to 1. 1. Do Do not not try try to to read read the the file file if if the the version version doesdoes
not match this value. (
not match this value. (**PSB****PSB** version is 2.)version is 2.)
6
6 Reserved: Reserved: must must be be zero.zero.
2
2 The The number number of of channels channels in in the the image, image, including including any any alpha alpha channels.channels.
Supported range is 1 to 56. Supported range is 1 to 56. 4
4 The The height height of of the the image image in in pixels. pixels. Supported Supported range range is is 1 1 to to 30,000.30,000.
((**PSB****PSB** max of 300,000.)max of 300,000.)
4
4 The The width width of of the the image image in in pixels. pixels. Supported Supported range range is is 1 1 to to 30,000.30,000.
(*PSB**
(*PSB** max of 300,000)max of 300,000)
2
2 Depth: Depth: the the number number of of bits bits per per channel. channel. Supported Supported values values are are 1, 1, 8, 8, and and 16.16.
2
2 The The color color mode mode of of the the file. file. Supported Supported values values are: are: Bitmap Bitmap = = 0; 0; Grayscale Grayscale ==
1; Indexed = 2; RGB = 3; CMYK = 4; Multichannel = 7; Duotone = 8; Lab 1; Indexed = 2; RGB = 3; CMYK = 4; Multichannel = 7; Duotone = 8; Lab = 9.
Color Mode Data Section Color Mode Data Section
1
1
Color Mode Data Section
Color Mode Data Section
The color mode data section is structured as follows: The color mode data section is structured as follows:
Only indexed color and duotone (see the
Only indexed color and duotone (see the mode field inmode field in TTablablee1.21.2) have color mode) have color mode
data. For all other modes, this section is just
data. For all other modes, this section is just the 4-byte length field, whthe 4-byte length field, which is set toich is set to
zero. zero.
ll Indexed color images: length is 768; color data Indexed color images: length is 768; color data contains the color table for thecontains the color table for the
image, in non–interleaved order. image, in non–interleaved order.
ll Duotone images: color data contains the Duotone images: color data contains the duotone specification (the format of whichduotone specification (the format of which
is not documented). Other applications that read Photoshop files can treat a is not documented). Other applications that read Photoshop files can treat a duotone image as a gray image, and just preserve the contents of the duotone duotone image as a gray image, and just preserve the contents of the duotone information when reading and writing the file.
information when reading and writing the file.
T
T ABLE ABLE 11..33 CCoolloor r mmoodde e ddatata a sseeccttiioon n
L
Leennggtthh DDeessccrriippttiioonn
4
4 TThhe e lleennggtth h oof f tthhe e ffoolllloowwiinng g ccoolloor r ddaattaa..
V
Image Resources Section Image Resources Section
1
1
Image Resources Section
Image Resources Section
The third section of the file contains image resources. It starts with a length field, The third section of the file contains image resources. It starts with a length field, followed by a series of
followed by a series of resource blocks.resource blocks.
Image Resource Blocks
Image Resource Blocks
Image resource blocks are the basic building unit of
Image resource blocks are the basic building unit of severseveral file formats, includingal file formats, including
Photoshop’s native file format, JPEG, and
Photoshop’s native file format, JPEG, and TIFFTIFF. Image resources . Image resources are used to are used to storestore
non-pixel data associated with images, such as pe
non-pixel data associated with images, such as pen tool paths.n tool paths.
N
NOOTTEE:: They are referred to as resource blocks because they hold data that was storedThey are referred to as resource blocks because they hold data that was stored
in the Macintosh’s resource fork in early versions of Photoshop. in the Macintosh’s resource fork in early versions of Photoshop. The basic structure of
The basic structure of image resource blocks is shown inimage resource blocks is shown in TTablablee1.51.5. The last field is. The last field is
the data area, which varies by resource type. The makeup of each resource type is the data area, which varies by resource type. The makeup of each resource type is described in the following sections.
described in the following sections.
T
T ABLE ABLE 11..44 IImmaagge re reessoouurrccees ss seeccttiioon n
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLeennggtth h oof f iimmaagge e rreessoouurrcce e sseeccttiioonn..
V
Vaarriiaabbllee IImmaagge re reessoouurrccees (s (sseeee “Image Resource Blocks“Image Resource Blocks””).).
T
T ABLE ABLE 11..55 IImmaagge re reessoouurrcce be blloocck k
L
Leennggtthh DDeessccrriippttiioonn
2
2 SSiiggnnaattuurree::'8BIM''8BIM'
2
2 Unique Unique identifier identifier for for the the resource.resource. TTablablee 1.61.6contains a list of resourcecontains a list of resource
IDs used by Photoshop. IDs used by Photoshop. V
Variaariablblee NamName: Pe: Pascascal sal strintring, pag, padded dded to mto makake the e the sizsize ee eveven (a nn (a null ull namnamee
consists of two bytes of 0) consists of two bytes of 0) 4
4 AAccttuuaal l ssiizze e oof f rreessoouurrcce e ddaatta a tthhaat t ffoolllloowwss
V
Variaariablblee The The resresourource dace data, dta, descescriberibed in td in the sehe sectictions oons on the n the indindiviividuadual rel resoursourcece
types. It is padded t
Image Resources Section Image Resources Section
1
1
Image Resource IDs
Image Resource IDs
Image resources use several standard ID numbers, as shown in
Image resources use several standard ID numbers, as shown in TTablablee 1.61.6. Not all file. Not all file
formats use all ID’s. Some information may be stored in other sections of th
formats use all ID’s. Some information may be stored in other sections of the file.e file.
N
NOOTTEE:: For those resource IDs that have been added since Photoshop 3.0. the entryFor those resource IDs that have been added since Photoshop 3.0. the entry
indicates the version in which they were introduced,
indicates the version in which they were introduced, e.g. (e.g. (Photoshop 6.0).Photoshop 6.0).
T
T ABLE ABLE 11..66 IImmaagge re reessoouurrcce Ie IDDs s
ID ID Description Description H Heexx DDeecciimmaall 0
0xx0033EE88 11000000 (Obsolete—Photoshop 2.0 only (Obsolete—Photoshop 2.0 only ) Contains five 2-byte values: number of) Contains five 2-byte values: number of
channels, rows, columns, depth, and mode channels, rows, columns, depth, and mode 0
0xx0033EE99 11000011 MMaacciinnttoossh ph prriinnt t mmaannaaggeer r pprriinnt it innffo o rreeccoorrdd
0
0xx0033EEBB 11000033 (Obsolete—Photoshop 2.0 only (Obsolete—Photoshop 2.0 only ) Indexed color table) Indexed color table
0
0xx0033EEDD 11000055 ResolutionInfoResolutionInfostructurestructure See Appendix A in
See Appendix A in
Photoshop API Guide.pdf
Photoshop API Guide.pdf
..0
0xx003E3EEE 10100066 NaNammes es oof f ththe e aallpphha ca chahannnneells s aas s a sa sereriiees s oof Pf Paassccaal l sstrtriinngsgs..
0
0xx0033EEFF 11000077 DisplayInfoDisplayInfostructurestructure See Appendix A in
See Appendix A in
Photoshop API Guide.pdf
Photoshop API Guide.pdf
..0
0xx0033FF00 11000088 TThhe e ccaappttiioon n aas s a a PPaassccaal l ssttrriinngg..
0
0xx0033FF11 11000099 BBoorrddeer r iinnffoorrmmaattiioonn
Contains a fixed number (2 bytes real, 2
Contains a fixed number (2 bytes real, 2 bytes fraction) for the borderbytes fraction) for the border
width, and 2 bytes
width, and 2 bytes for border units (1 = inches, 2 = for border units (1 = inches, 2 = cm, 3 = points, 4 =cm, 3 = points, 4 =
picas, 5 = columns). picas, 5 = columns). 0
0xx0033FF22 11001100 BaBacckkggrroouunnd d ccoolloorr..
See
See “Color “Color SwatcSwatches” on hes” on pagepage6868..
0
0xx0033FF33 11001111 PPrriinnt t ffllaaggss
A series of one-byte boolean
A series of one-byte boolean values (seevalues (see Page SetupPage Setup dialog): labels, cropdialog): labels, crop
marks, color bars, registration marks, negative, flip, interpolate, caption, marks, color bars, registration marks, negative, flip, interpolate, caption, print flags.
print flags. 0
0xx0033FF44 11001122 GGrraayyssccaalle ae annd md muullttiicchhaannnneel hl haallffttoonniinng ig innffoormrmaattiioonn
0
0xx0033FF55 11001133 CCoolloor r hhaallffttoonniinng g iinnffoorrmmaattiioonn
0
Image Resources Section Image Resources Section
1
1
0
0xx0033FF99 11001177 DDuuoottoonne e ttrraannssffeer r ffuunnccttiioonnss
0
0xx0033FFAA 11001188 DDuuoottoonne e iimmaagge e iinnffoorrmmaattiioonn
0x
0x0303FFBB 10101919 TTwwo bo bytytes es ffor or ththe ee effffecectitivve be bllacack k anand wd whihite te vvalalueues fs for or ththe de dot ot rarangngee
0
0xx0033FFCC 11002200 (Obsolete) (Obsolete)
0
0xx0033FFD D 11002211 EEPPS S ooppttiioonnss
0
0xx0033FFEE 11002222 QQuuiicck k MMaassk k iinnffoorrmmaattiioonn
2 bytes containing Quick Mask channel ID; 1-
2 bytes containing Quick Mask channel ID; 1- byte boolean indicatingbyte boolean indicating
whether the
whether the mask was initially emptymask was initially empty..
0
0xx0033FFFF 11002233 (Obsolete) (Obsolete)
0
0xx00440000 11002244 LLaayyeer r ssttaatte e iinnffoorrmmaattiioonn
2 bytes containing the index of ta
2 bytes containing the index of target layer (0 = bottom layer).rget layer (0 = bottom layer).
0
0xx00440011 11002255 WWoorrkkiinng g ppaatth h ((nnoot t ssaavveedd))
See
See “Pa“Path resourth resource formce format” on pageat” on page2020..
0
0xx00440022 11002266 LLaayyeerrs s ggrroouup ip innffoorrmmaattiioonn
2 bytes per layer containing a group
2 bytes per layer containing a group ID for the dragging ID for the dragging groups. Layers ingroups. Layers in
a group have the same group ID. a group have the same group ID. 0
0xx00440033 11002277 (Obsolete) (Obsolete)
0
0xx00440044 11002288 IIPPTTCC--NNAAA A rreeccoorrdd
Contains the
Contains the File Info...File Info... information. See the documentation in theinformation. See the documentation in the
IPTC
IPTC
folder of the
folder of the
Documentation
Documentation
folder.folder.0
0xx00440055 11002299 IImmaagge e mmoodde e ffoor r rraaw w ffoorrmmaat t ffiilleess
0
0xx00440066 11003300 JPJPEEG G qquuaalliittyy. . PPrriivvaattee..
0
0xx00440088 11003322 (Photoshop 4.0) Grid and guides information(Photoshop 4.0) Grid and guides information
See
See “Grid and guid“Grid and guides resources resource formate format” on page” on page 1717..
0
0xx00440099 11003333 (Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only(Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only
See
See “Thumb“Thumbnail resonail resource furce format” on pageormat” on page1919..
0
0xx004400AA 11003344 (Photoshop 4.0) Copyright flag(Photoshop 4.0) Copyright flag
Boolean indicating whether image is copyrighted. Can be set via Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in
Property suite or by user in File Info...File Info...
T
T ABLE ABLE 11..66 IImmaagge re reessoouurrcce Ie IDDs s (Continued) (Continued)
ID ID Description Description H Heexx DDeecciimmaall
Image Resources Section Image Resources Section
1
1
0
0xx004400BB 11003355 (Photoshop 4.0) URL(Photoshop 4.0) URL
Handle of a
Handle of a text string with uniform resource locator. Can be set text string with uniform resource locator. Can be set viavia
Property suite or by user in
Property suite or by user in File Info...File Info...
0
0xx004400CC 11003366 (Photoshop 5.0) (Photoshop 5.0) Thumbnail resource (supersedes resource 1033)Thumbnail resource (supersedes resource 1033)
See
See “Thum“Thumbnail resbnail resource fource format” on pageormat” on page1919..
0
0xx004400DD 11003377 (Photoshop 5.0) Global Angle(Photoshop 5.0) Global Angle
4 bytes that contain an integer between 0 and 359, which is the global 4 bytes that contain an integer between 0 and 359, which is the global lighting angle for effects layer
lighting angle for effects layer. If not present, . If not present, assumed to be 30.assumed to be 30.
0
0xx004400EE 11003388 (Photoshop 5.0) Color samplers resource(Photoshop 5.0) Color samplers resource
See
See “Color sam“Color samplers resplers resource foource format” on pagermat” on page 2020..
0
0xx004400FF 11003399 (Photoshop 5.0) ICC Profile(Photoshop 5.0) ICC Profile
The raw bytes of an ICC (In
The raw bytes of an ICC (International Color Consortium) format profile.ternational Color Consortium) format profile.
See
See
ICC34.pdf
ICC34.pdf
in thein theDocumentation
Documentation
folder andfolder andICC34.h
ICC34.h
ininSample Code\Common\Includes
Sample Code\Common\Includes
.. 00xx00441100 11004400 (Photoshop 5.0) Watermark(Photoshop 5.0) Watermark
One byte. One byte. 0
0xx00441111 11004411 (Photoshop 5.0) ICC Untagged Profile(Photoshop 5.0) ICC Untagged Profile
1 byte that disables any assumed profile handling when opening the file. 1 byte that disables any assumed profile handling when opening the file. 1 = intentionally untagged.
1 = intentionally untagged. 0
0xx00441122 11004422 (Photoshop 5.0) Effects visible(Photoshop 5.0) Effects visible
1-byte global flag to show/hide a
1-byte global flag to show/hide all the effects layerll the effects layer. Only present when. Only present when
they are hidden. they are hidden. 0
0xx00441133 11004433 (Photoshop 5.0) Spot Halftone(Photoshop 5.0) Spot Halftone
4 bytes for version, 4 bytes for length, and the variable length
4 bytes for version, 4 bytes for length, and the variable length data.data.
0
0xx00441144 11004444 (Photoshop 5.0) Document-specific IDs seed number(Photoshop 5.0) Document-specific IDs seed number
4 bytes: Base value, starting
4 bytes: Base value, starting at which layer IDs will be generated (or aat which layer IDs will be generated (or a
greater value if existing IDs already exceed it). Its pu
greater value if existing IDs already exceed it). Its purpose is to rpose is to avoid theavoid the
case where we
case where we add layers, flatten, save, open, and then add layers, flatten, save, open, and then add more layersadd more layers
that end up with the same IDs as the first set. that end up with the same IDs as the first set. 0
0xx00441155 11004455 (Photoshop 5.0) Unicode Alpha Names(Photoshop 5.0) Unicode Alpha Names
Unicode string (4 bytes length followed by string). Unicode string (4 bytes length followed by string).
T
T ABLE ABLE 11..66 IImmaagge re reessoouurrcce Ie IDDs s (Continued) (Continued)
ID ID Description Description H Heexx DDeecciimmaall
Image Resources Section Image Resources Section
1
1
0
0xx00441177 11004477
(Photoshop 6.0)
(Photoshop 6.0) Transparency Index.Transparency Index.
2 bytes for the
2 bytes for the index of transparent color, if any.index of transparent color, if any.
0
0xx00441199 11004499
(Photoshop 6.0)
(Photoshop 6.0) Global AltitudeGlobal Altitude
4 byte entry for altitude 4 byte entry for altitude 0
0xx004411AA 11005500
(Photoshop 6.0)
(Photoshop 6.0) SlicesSlices
See
See “Slic“Slices resoures resource formace format” on paget” on page 2222..
0
0xx004411BB 11005511
(Photoshop 6.0)
(Photoshop 6.0) Workflow URLWorkflow URL
Unicode string Unicode string 0
0xx004411CC 11005522
(Photoshop 6.0)
(Photoshop 6.0) Jump To XPEPJump To XPEP
2 bytes major version, 2 bytes minor version, 4 bytes count. Following is 2 bytes major version, 2 bytes minor version, 4 bytes count. Following is repeated for count: 4 bytes block size, 4 bytes key, if key =
repeated for count: 4 bytes block size, 4 bytes key, if key ='jtDd''jtDd', then, then
next is a Boolean for the dir
next is a Boolean for the dirty flag; otherwise it’s a 4 byte entry ty flag; otherwise it’s a 4 byte entry for thefor the
mod date. mod date. 0
0xx004411DD 11005533
(Photoshop 6.0)
(Photoshop 6.0) Alpha IdentifiersAlpha Identifiers
4 bytes of length, followed by 4 bytes each for every alpha identifier. 4 bytes of length, followed by 4 bytes each for every alpha identifier. 0
0xx004411EE 11005544
(Photoshop 6.0)
(Photoshop 6.0) URL ListURL List
4 byte count of UR
4 byte count of URLs, followed by 4 byte long, 4 byte ID, and UnicodeLs, followed by 4 byte long, 4 byte ID, and Unicode
string for each count. string for each count. 0
0xx00442211 11005577
(Photoshop 6.0)
(Photoshop 6.0) Version InfoVersion Info
4 bytes version, 1 byte
4 bytes version, 1 bytehasRealMergedDatahasRealMergedData, Unicode string: writer, Unicode string: writer
name, Unicode string: reader name, 4 bytes file version. name, Unicode string: reader name, 4 bytes file version. 0
0xx00442222 11005588 (Photoshop 7.0) EXIF data 1(Photoshop 7.0) EXIF data 1
See
See http://www.pima.net/standards/it10/PIMA15740/exif.htmhttp://www.pima.net/standards/it10/PIMA15740/exif.htm
0
0xx00442233 11005599 (Photoshop 7.0) EXIF data 3(Photoshop 7.0) EXIF data 3
See
See http://www.pima.net/standards/it10/PIMA15740/exif.htmhttp://www.pima.net/standards/it10/PIMA15740/exif.htm
0
0xx00442244 11006600 (Photoshop 7.0) XMP metadata(Photoshop 7.0) XMP metadata
File info as XML description. See File info as XML description. See
http://Partners.adobe.com/asn/developer/xmp/main.html
http://Partners.adobe.com/asn/developer/xmp/main.html
0
0xx00442255 11006611 (Photoshop 7.0) Caption digest(Photoshop 7.0) Caption digest
16 bytes: RSA Data Security, MD5 message-digest algorithm 16 bytes: RSA Data Security, MD5 message-digest algorithm
T
T ABLE ABLE 11..66 IImmaagge re reessoouurrcce Ie IDDs s (Continued) (Continued)
ID ID Description Description H Heexx DDeecciimmaall
Image Resources Section Image Resources Section
1
1
The following sections describe some of the
The following sections describe some of the resource formats in more detail.resource formats in more detail.
Grid and guides
Grid and guides resource formatresource format
Photoshop stores grid and guides information for an image in an image resource Photoshop stores grid and guides information for an image in an image resource block. Each of these resource blocks consists of an initial 16-byte grid an
block. Each of these resource blocks consists of an initial 16-byte grid and guided guide
0
0xx00442266 11006622 (Photoshop 7.0) Print scale(Photoshop 7.0) Print scale
2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 bytes y location (floating point). 4 bytes scale location (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point)
(floating point) 0
0xx00442288 11006644 (Photoshop CS) Pixel Aspect Ratio(Photoshop CS) Pixel Aspect Ratio
4 bytes (version = 1), 8 bytes double, x / y of
4 bytes (version = 1), 8 bytes double, x / y of a pixela pixel
0
0xx00442299 11006655 (Photoshop CS) Layer Comps(Photoshop CS) Layer Comps
4 bytes (descriptor version = 16), Descriptor
4 bytes (descriptor version = 16), Descriptor (see(see “Descriptor structure”“Descriptor structure”
on p
on pagagee5757)) 0
0xx004422AA 11006666 (Photoshop CS) (Photoshop CS) Alternate Duotone ColorsAlternate Duotone Colors
2 bytes (version = 1), 2 bytes count, following is repeated for each count: 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2
[ Color: 2 bytes for space followed by 4 * 2 byte color component ],bytes for space followed by 4 * 2 byte color component ],
following this is another 2 byte count,
following this is another 2 byte count, usually 256, followed by Lab colorsusually 256, followed by Lab colors
one byte each for L, a, b one byte each for L, a, b This resource is not read o
This resource is not read or used by Photoshop.r used by Photoshop.
0
0xx004422BB 11006677 (Photoshop CS) (Photoshop CS) Alternate Spot ColorsAlternate Spot Colors
2 bytes (version = 1), 2 bytes channel count,
2 bytes (version = 1), 2 bytes channel count, following is repeated forfollowing is repeated for
each count: 4
each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * bytes channel ID, Color: 2 bytes for space followed by 4 * 22
byte color component byte color component This resource is not read o
This resource is not read or used by Photoshop.r used by Photoshop.
0x07D0-0x0BB6 0x0BB6 2000-2998 2998
Path Information (saved paths) Path Information (saved paths) See
See “Pa“Path resourth resource formce format” on pageat” on page2020..
0
0xx00BBBB77 22999999 NNaamme e oof f cclliippppiinng g ppaatthh
See
See “Pa“Path resourth resource formce format” on pageat” on page2020..
0
0xx22771100 1100000000 PPrriinnt t ffllaaggs s iinnffoorrmmaattiioonn
2 bytes version ( = 1), 1 byte cent
2 bytes version ( = 1), 1 byte center crop marks, 1 byte ( = 0), er crop marks, 1 byte ( = 0), 4 bytes4 bytes
bleed width value, 2 bytes bleed width scale. bleed width value, 2 bytes bleed width scale.
T
T ABLE ABLE 11..66 IImmaagge re reessoouurrcce Ie IDDs s (Continued) (Continued)
ID ID Description Description H Heexx DDeecciimmaall
Image Resources Section Image Resources Section
1
1
information for guide direction and location, which are present if there are guides information for guide direction and location, which are present if there are guides ((fGuideCountfGuideCount> 0) .> 0) .
T
T ABLE ABLE 11..77 GGrriid ad annd gd guuiidde he heeaaddeer r
L
Leennggtthh DDeessccrriippttiioonn
4
4 VVersion ersion ( ( = = 1)1)
8
8 Future Future implementation implementation of of document-specific document-specific grids grids (4 (4 bytes bytes horizontal, horizontal, 44
bytes vertical). Currently
bytes vertical). Currently, sets the grid , sets the grid cycle to every quarter cycle to every quarter inch, i.e. 576inch, i.e. 576
for both horizontal & vertical (at 72 dpi, that is 18 * 32 = 576) for both horizontal & vertical (at 72 dpi, that is 18 * 32 = 576) 4
Image Resources Section Image Resources Section
1
1
Grid and guide information may be modified using the Property suite. See the Grid and guide information may be modified using the Property suite. See the Callbacks chapter in
Callbacks chapter in
Photoshop API Guide.pdf
Photoshop API Guide.pdf
for more information.for more information.Thumbnail resource format Thumbnail resource format Adobe Photoshop (version 5.0 and
Adobe Photoshop (version 5.0 and later) stores thumbnail information for previewlater) stores thumbnail information for preview
display in an image
display in an image resource block that consists of resource block that consists of an initial 28-byte header, followedan initial 28-byte header, followed
by a JFIF thumbnail in RGB (red, green,
by a JFIF thumbnail in RGB (red, green, blue) order for both Macintosh and Windows.blue) order for both Macintosh and Windows.
N
NOOTTEE:: Adobe Photoshop 4.0 stored the thumbnail information in the same formatAdobe Photoshop 4.0 stored the thumbnail information in the same format
except the data section is BGR (blue, green, red). The 4.0 format is at resource except the data section is BGR (blue, green, red). The 4.0 format is at resource ID 1033 and the 5.0 format is at resource ID 1036.
ID 1033 and the 5.0 format is at resource ID 1036.
T
T ABLE ABLE 11..88 GGuuiidde re reessoouurrcce be blloocck k
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLooccaattiioon on of gf guuiidde ie in dn dooccuummeennt ct coooorrddiinnaatteess. S. Siinncce te thhe ge guuiidde ie is es eiitthheerr
vertical or horizontal, this only has to be one component of the vertical or horizontal, this only has to be one component of the coordinate. coordinate. 1 1 VHSelect VHSelect
Direction of guide. VHSelect is a system type of
Direction of guide. VHSelect is a system type ofunsigned charunsigned char
where 0 = vertical, 1 = horizontal. where 0 = vertical, 1 = horizontal.
T
T ABLE ABLE 11.9.9 TThuhummbbnanail il rresesoouurrcce e hheaeadder er
L
Leennggtthh DDeessccrriippttiioonn
4
4 Format. Format. 1 1 = = kJpegRGB kJpegRGB . . Also Also supports supports kRawRGB kRawRGB (0).(0).
4
4 WWiiddtth h oof f tthhuummbbnnaaiil l iin n ppiixxeellss..
4
4 Height Height of of thumbnail thumbnail in in pixels.pixels.
4
4 WWiiddththbbyytteess: : PPadadddeed rd roow w bbyytetes s = = ((wiwiddth th * * bibitts s peper r ppiixxeel l + + 3311) ) / 3/ 32 2 * * 4.4.
4
4 TToottaal l ssiizze e = = wwiiddtthhbbyyttees s * * hheeiigghht t * * ppllaanneess
4
4 SSiizze e aafftteer r ccoommpprreessssiioonn. . UUsseed d ffoor r ccoonnssiisstteennccy y cchheecckk..
2
2 BBiitts s ppeer r ppiixxeell. . = = 2244
2
2 NNuummbbeer r oof f ppllaanneess. . = = 11
V
Variariabablele JFJFIF dIF datata in Ra in RGB fGB formormat.at.
N
Image Resources Section Image Resources Section
1
1
Color samplers resource format Color samplers resource format Adobe Photoshop (version 5.0 and
Adobe Photoshop (version 5.0 and later) stores color samplers information for anlater) stores color samplers information for an
image in an image resource block that consists of an initial 8-byte color samplers image in an image resource block that consists of an initial 8-byte color samplers header followed by a variable length
header followed by a variable length block of specific color samplers information.block of specific color samplers information.
Path resource format Path resource format Photoshop stores the paths
Photoshop stores the paths saved with an image in an image saved with an image in an image resource block. Theseresource block. These
resource blocks consist of a series of 26
resource blocks consist of a series of 26-byte path point records, so the -byte path point records, so the resourceresource
length should always be a multiple of 26. length should always be a multiple of 26.
Photoshop stores its paths as resources of type
Photoshop stores its paths as resources of type8BIM8BIM, with IDs in the range 2000, with IDs in the range 2000
through 2999. These numbers should be reserved for Photoshop. The name of the through 2999. These numbers should be reserved for Photoshop. The name of the resource is the name given to
resource is the name given to the path when the path when it was saved.it was saved.
If the file contains a resource of type
If the file contains a resource of type8BIM8BIMwith an ID of 2999, then this resourcewith an ID of 2999, then this resource
contains a Pascal–style string containing the name of
contains a Pascal–style string containing the name of the clipping path to use the clipping path to use with thiswith this
image when saving it as an
image when saving it as an EPS file.EPS file.
The path format returned by
The path format returned byGetProperty()GetProperty()call is identical to what is describedcall is identical to what is described
below
below. Refer to th. Refer to thee
IllustratorExport
IllustratorExport
sample plug–in code to see how thissample plug–in code to see how thisresource data is constructed. resource data is constructed.
T
T ABLE ABLE 11.1.100 CoCololor Sr Samamplplerers hs heaeadeder r
L
Leennggtthh DDeessccrriippttiioonn
4
4 VVeerrssiioon n ( ( = = 11))
4
4 NNuummbbeer r oof f ccoolloor r ssaammpplleerrs s tto o ffoollllooww. . SSeeee TTablablee1.111.11..
T
T ABLE ABLE 1.1.1111 CoCololor Sr Samamplplerers res resosoururce bce blolock ck
L
Leennggtthh DDeessccrriippttiioonn
8
8 TThhe e vveertrtiiccaal l aannd d hhoorriizzoonnttaal l ppoossiittiioon n oof f tthhe e ppooiinnt t ((4 4 bbyyttees s eeaacchh))..
2
2 Color Space:Color Space:
enum { kDummySpace = -1, kRGBSpace, kHSBSpace,
enum { kDummySpace = -1, kRGBSpace, kHSBSpace,
kCMYKSpace, kPantoneSpace, kFocoltoneSpace,
kCMYKSpace, kPantoneSpace, kFocoltoneSpace,
kTrumatchSpace,kToyoSpace, kLabSpace, kGraySpace,
kTrumatchSpace,kToyoSpace, kLabSpace, kGraySpace,
kWideCMYKSpace,kHKSSpace, kDICSpace, kTotalInkSpace,
kWideCMYKSpace,kHKSSpace, kDICSpace, kTotalInkSpace,
kMonitorRGBSpace, kDuotoneSpace, kOpacitySpace};
kMonitorRGBSpace, kDuotoneSpace, kOpacitySpace};
Image Resources Section Image Resources Section
1
1
Path points Path points
All points used in defining a path are stored in eight bytes as a pair of 32–bit All points used in defining a path are stored in eight bytes as a pair of 32–bit components, vertical component first.
components, vertical component first.
The two components are signed, fixed point numbers with 8 bits before the binary The two components are signed, fixed point numbers with 8 bits before the binary point and 24 bits after the binary point. Three guard bits are reserved in the points to point and 24 bits after the binary point. Three guard bits are reserved in the points to eliminate most concerns
eliminate most concerns over arithmetic overflowover arithmetic overflow. Hence, the . Hence, the range for eachrange for each
component is
component is0xF00000000xF0000000toto 0x0FFFFFFF0x0FFFFFFFrepresenting a range of –16 to 16. Therepresenting a range of –16 to 16. The
lower bound is included, but not the upper bound. lower bound is included, but not the upper bound. This limited range is used because
This limited range is used because the points are expressed relative to the imagethe points are expressed relative to the image
size. The vertical component is given with respect to the image height, and the size. The vertical component is given with respect to the image height, and the horizontal component is given with respect to the image width. [
horizontal component is given with respect to the image width. [0,0,00] represents the] represents the
top–left corner of the image; [
top–left corner of the image; [1,1,11] ([] ([0x01000000,0x010000000x01000000,0x01000000]) represents the]) represents the
bottom–right. bottom–right.
In Windows, the byte order of the
In Windows, the byte order of the path point components apath point components are reversed; you shouldre reversed; you should
swap the bytes when accessing each 32–bit value. swap the bytes when accessing each 32–bit value. Path records
Path records
The data in a path resource consists of one or more 26-byte records. The first two The data in a path resource consists of one or more 26-byte records. The first two bytes of each record is a
bytes of each record is a selector to indicate what selector to indicate what kind of path it kind of path it is. For Windows, youis. For Windows, you
should swap the bytes before accessing it as a shor
should swap the bytes before accessing it as a shor t.t.
The first 26-byte path record contains a selector value of 6, path fill rule record. The The first 26-byte path record contains a selector value of 6, path fill rule record. The remaining 24 bytes of the first record are zeroes. Paths use even/odd ruling. Subpath remaining 24 bytes of the first record are zeroes. Paths use even/odd ruling. Subpath
T
T ABLE ABLE 11.1.122 PPatath dh datata ra rececorord td typypes es
S
Seelleeccttoorr DDeessccrriippttiioonn
0
0 CClloosseed d ssuubbppaatth h lleennggtth h rreeccoorrdd
1
1 CClloosseed d ssuubbppaatth h BBeezziieer r kknnoott, , lliinnkkeedd
2
2 CClloosseed d ssuubbppaatth h BBeezziieer r kknnoott, , uunnlliinnkkeedd
3
3 OOppeen n ssuubbppaatth h lleennggtth h rreeccoorrdd
4
4 OOppeen n ssuubbppaatth h BBeezziieer r kknnoott, , lliinnkkeedd
5
5 OOppeen n ssuubbppaatth h BBeezziieer r kknnoott, , uunnlliinnkkeedd
6
6 PPaatth h ffiilll l rruulle e rreeccoorrdd
7
7 CClliippbbooaarrd d rreeccoorrdd
8
Image Resources Section Image Resources Section
1
1
In Bezier knot records, the 24
In Bezier knot records, the 24 bytes following the selector field contain three pabytes following the selector field contain three pathth
points (described above) for: points (described above) for: 1.
1. the control point for the Bezier segment preceding the knot,the control point for the Bezier segment preceding the knot,
2.
2. the anchor point for the knot, andthe anchor point for the knot, and
3.
3. the control point for the Bezier segment leaving the knot.the control point for the Bezier segment leaving the knot.
Linked knots have their control points linked. Editing one point
Linked knots have their control points linked. Editing one point modifies the other tomodifies the other to
preserve collinearity
preserve collinearity. Knots should only be . Knots should only be marked as having linked controls if theirmarked as having linked controls if their
control points are collinear with their anchor. The control points on unlinked knots are control points are collinear with their anchor. The control points on unlinked knots are independent of each other. Refer to the
independent of each other. Refer to the Adobe Photoshop User Guide Adobe Photoshop User Guide for morefor more
information. information.
Clipboard records,
Clipboard records,selector=7selector=7, contain four fixed-point numbers for the bounding, contain four fixed-point numbers for the bounding
rectangle (top, left, bottom, right), and a single fixed-point number indicating the rectangle (top, left, bottom, right), and a single fixed-point number indicating the resolution.
resolution.
Initial fill records,
Initial fill records, selector=8selector=8, contain one two byte record. A value of 1 means that, contain one two byte record. A value of 1 means that
the fill starts
the fill starts with all pixels. The value will be either 0 or 1.with all pixels. The value will be either 0 or 1.
Slices resource format Slices resource format
Adobe Photoshop 6.0 and later stores slices information for an image in an image Adobe Photoshop 6.0 and later stores slices information for an image in an image resource block. .
resource block. .
T
T ABLE ABLE 11..1133 SSlliiccees s hheeaaddeer r
L
Leennggtthh DDeessccrriippttiioonn
4
4 VVeerrssiioon n ( ( = = 66))
4 * 4
4 * 4 BoBounundiding rng recectatanglngle fe for or alall of l of ththe se sliliceces: s: toptop, l, lefeft, bt, botottomtom, ri, righght of t of alall tl thehe
slices slices V
Variaariablblee NamName of ge of group roup of slof sliceices: Uns: Unicoicode stde strinringg
4
Image Resources Section Image Resources Section
1
1
TT ABLE ABLE 11.1.144 SlSlicices es reresosouurrce ce bblolocck k
L Leennggtthh DDeessccrriippttiioonn 4 4 IDID 4 4 GGrroouup p IIDD 4 4 OOrriiggiinn 4
4 AAssssoocciiaatteed d LLaayyeer r IIDD
N
NOOTTEE::Only present if Origin = 1Only present if Origin = 1
V
Variariabablele NaNameme: : UniUnicocode de ststrinringg
4
4 TTyyppee
4 *
4 * 44 LLeefftt, , ttoopp, , rriigghhtt, b, boottttoom m ppoossiittiioonnss
V
Varariaiablblee URURL: UL: Uninicocode sde strtriningg
V
Variariabablele TTarargeget: Ut: Uninicocode sde stritringng
V
Variariabablele MeMessssageage: U: Uninicocode de ststrinringg
V
Variariabablele AlAlt Tt Tag: ag: UniUnicocode sde stritringng
1
1 CCeelll l tteexxt t iis s HHTTMMLL: : BBoooolleeaann
V
Variariabablele CelCell tel textxt: Un: Unicicode ode ststrinringg
4
4 HHoorriizzoonnttaal l aalliiggnnmmeenntt
4
4 VVeerrttiiccaal l aalliiggnnmmeenntt
1
1 AAllpphha a ccoolloorr
1 1 RReedd 1 1 GGrreeeenn 1 1 BBlluuee
Layer and Mask Information Section Layer and Mask Information Section
1
1
Layer and Mask Information Section
Layer and Mask Information Section
The fourth section of a Photoshop file contains information about layers and masks. The fourth section of a Photoshop file contains information about layers and masks. This section of the d
This section of the document describes the formats of ocument describes the formats of layer and mask records.layer and mask records.
N
NOOTTEE:: The complete, merged image data is not stored here; it resides in the lastThe complete, merged image data is not stored here; it resides in the last
section of the file. See
section of the file. See “Image “Image Data SecData Section” otion” on pagen page4747..
T
Tablablee1.151.15shows the overall structure of this section. If shows the overall structure of this section. If there are no layers or masks,there are no layers or masks,
this section is just 4 bytes: the
this section is just 4 bytes: the length field, which is set length field, which is set to zero.to zero.
T
Tablablee1.161.16shows the high-level organization of shows the high-level organization of the layer information.the layer information.
T
T ABLE ABLE 1.1.1515 LaLayeyer anr and mad mask isk infnforormamatition son secectition on
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLeennggtth h oof f tthhe le laayyeer r aannd md maassk k iinnffoorrmmaattiioon n sseeccttiioonn.. (**PSB**(**PSB** length is 8length is 8
bytes.) bytes.) V
Varariaiabbllee LaLayyer er ininffo (o (seseee TTablablee1.161.16for details).for details).
V
Variariabablele GlGlobaobal ll layayer er mamask sk ininffo (o (seseee TTabablele1.211.21for details).for details).
T
T ABLE ABLE 11..1166 LLaayyeer r iinnffo o
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLeennggtth h oof tf thhe e llaayyeerrs s iinnffo o sseeccttiioonn, , rroouunnddeed d uup p tto o a a mmuullttiipplle e oof f 22.. (**PSB**(**PSB**
length is 8 bytes.) length is 8 bytes.) 2
2 LaLayyeer cr coouuntnt. I. If if it it is a s a nneegagattiivve ne nuummbeberr, i, its ts aabbssoolluutte ve vaalluue ie is ts thhe ne nuummbeber or off
layers and the first alpha channel contains
layers and the first alpha channel contains the transparency data for thethe transparency data for the
merged result. merged result. V
Variariabablele InInfoformarmatition aon aboubout eat each lch laayeyerr.. TTablablee1.171.17describes the structure of thisdescribes the structure of this
information for e
information for each layer.ach layer.
V
Variaariablblee ChanChannel inel imagmage datae data. Cont. Containains one or ms one or more iore imagmage data re data recorecords (sds (seeee
T
Tablablee 1.201.20for structure) for each for structure) for each layerlayer. The layers are in . The layers are in the same orderthe same order
as in the layer information (previous row of this table). as in the layer information (previous row of this table).
Layer and Mask Information Section Layer and Mask Information Section
1
1
TT ABLE ABLE 11..1177 LLaayyeer r rreeccoorrdds s
L
Leennggtthh DDeessccrriippttiioonn
4 * 4
4 * 4 ReRectctananglgle ce conontataininining tg the he cocontntenents ts of of ththe le laayyerer. S. Spepecicifified ed as as totopp, l, lefeft,t,
bottom, right coordinates bottom, right coordinates 2
2 NNuummbbeer r oof f cchhaannnneells s iin n tthhe e llaayyeerr
6 * 6 * number number of of channels channels
Channel information. Six bytes per channel, consisting of: Channel information. Six bytes per channel, consisting of: 2 bytes for Channel ID: 0 = red, 1 = green, etc.;
2 bytes for Channel ID: 0 = red, 1 = green, etc.; –1 = transparency mask; –2
–1 = transparency mask; –2 = user supplied layer mask= user supplied layer mask
4 bytes for length of corresponding channel data.
4 bytes for length of corresponding channel data. (**PSB**(**PSB** 8 bytes for8 bytes for
length of corresponding channel data.) See
length of corresponding channel data.) See TTablablee1.201.20for structure offor structure of
channel data. channel data. 4
4 BBlleennd d mmoodde e ssiiggnnaattuurree::'8BIM''8BIM'
4
4 BBlleennd d mmoodde e kkeeyy::
''normnorm' = normal, '' = normal, 'darkdark' = darken, '' = darken, 'litelite' = lighten, '' = lighten, 'huhuee ' = hue,' = hue,
''sasatt ' = saturation, '' = saturation, 'colrcolr' = color, '' = color, 'lulumm ' = luminosity, '' = luminosity, ' mul mul ' = multiply,' = multiply,
''scrnscrn' = screen, '' = screen, 'dissdiss' = dissolve, '' = dissolve, 'overover' = overlay, '' = overlay, 'hLithLit' = hard light,' = hard light,
''sLitsLit' = soft light, '' = soft light, 'diffdiff' = difference,' = difference,'smud''smud' == exclusion,exclusion,'div ' ='div' =
color dodge,
color dodge, 'idiv''idiv' == color burn,color burn,'lbrn''lbrn' = linear= linear burn,burn, 'lddg''lddg' ==
linear dodge,
linear dodge, 'vLit''vLit' = vivid light= vivid light,, 'lLit''lLit' = linear light= linear light,,'pLit' ='pLit'=
pin light
pin light,, 'hMix''hMix' = hard mix= hard mix
1
1 OOppaacciittyy. . 0 0 = = ttrraannssppaarreennt t ... . 22555 5 = = ooppaaqquuee
1
1 CClliippppiinngg: : 0 0 = = bbaassee, , 1 1 = = nnoonn––bbaassee
1
1 FFllaaggss::
bit 0 = transparency protected; bit 1 = visible; bit 2 = obsolete; bit 0 = transparency protected; bit 1 = visible; bit 2 = obsolete; bit 3 = 1 for Photoshop 5
bit 3 = 1 for Photoshop 5.0 and later, tells if bit 4 has u.0 and later, tells if bit 4 has useful information;seful information;
bit 4 = pixel data irrelevant to appearance of document bit 4 = pixel data irrelevant to appearance of document 1
1 FFiilllleer r ((zzeerroo))
4
4 LLenenggtth oh of tf thhe ee exxtrtra da daata ta ffiieelld ( d ( = t= thhe te toottal al lleengngtth oh of tf thhe ne neexxt ft fiivve fe fiieleldsds))..
V
Varariaiablblee LaLayyer er mamask sk dadatata: : SeSeee TTablablee1.181.18for structure. Can be 40 for structure. Can be 40 bytes, 24bytes, 24
bytes, or 4 bytes if
bytes, or 4 bytes if no layer mask.no layer mask.
V
Variariabablele LaLayeyer r blblenendiding ng rarangenges: s: SeSeee TTablablee1.191.19..
V
Layer and Mask Information Section Layer and Mask Information Section
1
1
Variable
Variable (Photoshop 4.0, 5.0, 6.0, 7.0) (Photoshop 4.0, 5.0, 6.0, 7.0)
Series of tagged blocks containing various types of data. See
Series of tagged blocks containing various types of data. See “Additional“Additional
Lay
Layer Infer Informationormation” on page” on page2828for the list of the types of data that can befor the list of the types of data that can be
included here. included here.
T
T ABLE ABLE 1.1.1818 LaLayeyer mar mask / ask / adjdjusustmtmenent lat layeyer dar data ta
L
Leennggtthh NNaammee
4
4 SSiizze oe of tf the he ddatataa: 3: 366, 2, 200, o, or 0r 0. I. If zf zeerroo, t, thhe fe folollloowwiinng fg fiieleldds as arre ne noot pt prreesseenntt
4 *
4 * 44 ReRectctananglgle e enenclclososining g lalayyer er mamasksk: T: Topop, l, lefeft, t, bobottttomom, , ririghghtt
1
1 DDeeffaauullt t ccoolloorr. . 0 0 oor r 225555
1
1 FFllaaggss..
bit 0 = position relative to layer bit 0 = position relative to layer bit 1 =
bit 1 = layer mask disabledlayer mask disabled
bit 2 = invert layer mask when blending bit 2 = invert layer mask when blending 2
2 PPaaddddiinng. g. OOnnlly y pprreesseennt it if sf siizze = e = 2200. . OOttheherrwwiisse te thhe fe folollloowwiing ng iis s pprreesseenntt
1
1 Real Real Flags. Flags. Same Same as as Flags Flags information information above.above.
1
1 Real Real user user mask mask background. background. 0 0 or or 255.255.
Same as Flags information above. Same as Flags information above. 4 *
4 * 44 ReRectctananglgle e enenclclososining g lalayyer er mamasksk: T: Topop, l, lefeft, t, bobottttomom, , ririghght.t.
T
T ABLE ABLE 1.1.1919 LaLayeyer r blblenendiding ng rarangnges es dadata ta
L
Leennggtthh NNaammee
4
4 LLeennggtth h oof f llaayyeer r bblleennddiinng g rraannggees s ddaattaa
4
4 CoCommpopossiitte e ggrraay y bbllenend d ssoouurrccee. . CCononttaaiinns s 2 2 bbllaacck k vvalalueues s ffolollloowweed d bby y 22
white values. Present but irrelevant for Lab &
white values. Present but irrelevant for Lab & GrayscaleGrayscale..
4
4 CCoommppoossiitte e ggrraay y bblleennd d ddeessttiinnaattiioon n rraannggee
4
4 FFiirrsst t cchhaannnneel l ssoouurrcce e rraannggee
4
4 FFiirrsst t cchhaannnneel l ddeessttiinnaattiioon n rraannggee
4
4 SSeeccoonnd d cchhaannnneel l ssoouurrcce e rraannggee
4
4 SSeeccoonnd d cchhaannnneel l ddeessttiinnaattiioon n rraannggee
... ...
T
T ABLE ABLE 11..1177 LLaayyeer r rreeccoorrdds s (Continued) (Continued)
L
Layer and Mask Information Section Layer and Mask Information Section
1
1
4
4 NNtth h cchhaannnneel l ssoouurrcce e rraannggee
4
4 NNtth h cchhaannnneel l ddeessttiinnaattiioonn rraannggee
T
T ABLE ABLE 11.2.200 CChhanannnel el iimmaage ge ddatata a
L
Leennggtthh DDeessccrriippttiioonn
2
2 CCoommpprreessssiioonn. . 0 0 = = RRaaw w DDaattaa, , 1 1 = = RRLLE E ccoommpprreesssseedd, , 2 2 = = ZZIIP P wwiitthhoouutt
prediction, 3 = ZIP with prediction. prediction, 3 = ZIP with prediction. V
Vaaririaabbllee IImmaage ge ddatataa..
If the compression code is 0, the image data is just the raw image data, If the compression code is 0, the image data is just the raw image data, whose size is calculated as
whose size is calculated as(LayerBottom–LayerTop)*(LayerBottom–LayerTop)*
(LayerRight–LayerLeft)
(LayerRight–LayerLeft)(from the first field in(from the first field in TTablablee 1.171.17).).
If the compression code is 1, the image data starts with the byte counts If the compression code is 1, the image data starts with the byte counts for all the scan lines in the channel
for all the scan lines in the channel(LayerBottom–LayerTop)(LayerBottom–LayerTop),, wwiitthh
each count stored as a two–byte value.(
each count stored as a two–byte value.(**PSB****PSB** each count stored as aeach count stored as a
four-byte value.) The RLE compressed data follows, with each scan line four-byte value.) The RLE compressed data follows, with each scan line compressed separately
compressed separately. The RLE compression . The RLE compression is the same compressionis the same compression
algorithm used by the
algorithm used by the Macintosh ROM routine PackBitsMacintosh ROM routine PackBits, and the TI, and the TIFFFF
standard. standard. If the layer’
If the layer’s size, and therefore the data, is s size, and therefore the data, is odd, a pad byte wodd, a pad byte will beill be
inserted at the end of the row. inserted at the end of the row.
If the layer is an adjustment layer, the channel data is undefined If the layer is an adjustment layer, the channel data is undefined (probably all white.)
(probably all white.)
T
T ABLE ABLE 11.2.211 GGlolobabal ll layayer er mamask sk ininfo fo
L
Leennggtthh DDeessccrriippttiioonn
4
4 LLeennggtth h oof f gglloobbaal l llaayyeer r mmaassk k iinnffo o sseeccttiioonn..
2
2 OOvveerrllaay y ccoolloor r ssppaacce e ((uunnddooccuummeenntteedd))..
8
8 4 4 * * 2 2 bbyytte e ccoolloor r ccoommppoonneennttss
2
2 OOppaacciittyy. . 0 0 = = ttrraannssppaarreenntt, , 11000 0 = = ooppaaqquuee..
1
1 KKiinndd. 0 . 0 = C= Coolloor sr seelleecctteedd——ii..ee. i. innvveertrteedd; 1 ; 1 = C= Coolloor pr prrootteecctteedd;;11228 = 8 = uussee
value stored per layer. This value is preferred. The oth
value stored per layer. This value is preferred. The others are forers are for
backward compatibility with beta
backward compatibility with beta versions.versions.
T
T ABLE ABLE 1.1.1919 LaLayeyer r blblenendiding ng rarangnges es dadata ta (Continued) (Continued)
L