검색결과 리스트
psd 헤더에 해당되는 글 1건
글
Adobe Photoshop
File Formats
Specification
June 2012
Copyright © 1991-2012 Adobe Systems Incorporated. All rights reserved.
Portions Copyright © 1990-1991, Thomas Knoll.
이 문서에서 제공하는 정보들은 참고용으로 제공되는 것이며, 언제든지 통보없이 수정될 수 있습니다. Adobe Systems Incorporated 는 이에 대해서 어떠한 책임도 없습니다. Adobe Systems Incorporated 는 이 문서의 오류나 부정확한 부분에 대한 어떤 책임이나 법적 의무가 없습니다. 이 문서에서 언급하는 모든 소프트웨어는 저작권을 준수하며, 다음과 같은 저작권 아래 사용 되었습니다.
Adobe, After Effects, PhotoDeluxe, Adobe Premiere, Photoshop, Adobe Illustrator, Adobe Type Manager, ATM, PostScript 는 모두 미국과 다른 국가에 등록된 Adobe Systems Incorporated 의 상표입니다. Apple, Macintosh, Mac 는 미국과 다른 국가에 등록된 Apple Computer, Inc. 의 상표입니다. Microsoft 와 Windows 는 미국과 다른 국가에 등록된 Microsoft Corporation 의 상표입니다. 기타 모든 제품은 해당 소유자의 자산입니다.
Contents
Preface
Welcome to the Adobe Photoshop® File Format Specification!
이 문서는 Adebe Photoshop 에서 읽고 쓰는 Adobe Photoshop 파일 포맷과 그 밖에 관련된 다른 파일 형식에 대한 세부적인 스펙입니다.
Audience
이 문서는 Photoshop 고유의 파일 형식을 읽고 쓰려는 제 3자를 위해 제공 됩니다.
이 문서는 데이터를 어떻게 해석해야 하는지에 대해서 설명하지는 않습니다. 이 문서는 데이터 형식에 대해서만 기술할 뿐 입니다.
What Is In This Document
이 문서는 세가지 목차로 구성되어 있습니다.
The Photoshop File Format 는 Photoshop 의 PSD 와 PSB 고유 파일 포맷에 대한 세부정보를 다루고 있습니다.
Other Document File Formats 는 Photoshop 에서 생성하고 읽을 수 있는 EPS 와 TIFF 파일 형식에 대해서 다루고 있습니다.
Additional File Formats 에서는 컬러, 윤곽, 커브, 레벨 같은 아이템 정보를 저장하기 위해서 Photoshop 에서 사용하는 기타 파일 형식에 대해서 다루고 있습니다.
파일 형식에 대한 더 많은 정보는 아래 서적을 참고하시기 바랍니다.
Encyclopedia of Graphics File Formats by James D. Murray & William vanRyper (1994, O'Reilly & Associates, Inc., Sebastopol, CA, ISBN 1-56592-058-9).
The Photoshop File Format
Introduction
이 장에서는 Photoshop 고유 파일형식에 대해 다룹니다.
OS | Filetype/extension |
---|---|
Mac OS | 8BPS |
Windows | .PSD |
Large Document Format
Large Document Format (8BPB/PSB) 는 어떤 수치든 최대 300,000 픽셀까지 지원합니다.레이어, 이펙트, 필터와 같은 Photoshop 의 모든 기능은 PSB 포멧으로 되어 있습니다. PSB 형식은 Photoshop 고유 파일형식에서 다방면으로 동일하게 사용됩니다. This document will cover the differences found in the PSB format by donating a **PSB** marker. 이 문서에서는 **PSB** 표시를 사용해서 PSB 형식의 차이점을 커버 합니다.
Windows
모든 데이터는 빅-엔디안(big endian) 바이트 순서로 저장됩니다. 윈도우 플렛폼에서는 읽거나 기록할 때, short 와 long integer 를 자리바꿈 해야만 합니다.
Mac OS
크로스 플랫폼 간의 호환성을 위해서, Photoshop 에서 사용하는 모든 정보는 데이터 포크에 저장 됩니다. 그러나 다른 매킨토시 어플리케이션과의 호환성을 위해서, 일부 정보는 파일의 리소스 포크에 저장된 리소스와 중복되어 있기도 합니다.
이미지 카탈로그 어플리케이션과의 호환성을 위해서, 썸네일 레퍼런스, 키워드, 캡션(caption) 정보를 담고 있는 id 가 0 번인 'pnot' 리소스는 다른 리소스들에 저장되어 있습니다.
썸네일 이미지는 'PICT' 리소스에 , 128 키워드는 'STR$' 에 , 128 캡션(caption)은 'TEXT' 리소스에 각각 저장됩니다. 이들 리소스에 대한 더 많은 정보는 Inside Macintosh: QuickTime Components and the Extensis Fetch Awareness Developer's Toolkit 를 참고하시기 바랍니다.
또한 Photoshop 은 Mac OS Finder 에 표시할 썸네일 이미지를 저장하는 ' icl8 ' -16455 과 ' ICN# ' -16455 리소스를 생성합니다.
Photoshop 파일 정보 다이얼로그의 모든 데이터는 ' ANPA ' 리소스 10000 에 저장됩니다. 이 리소스의 데이터는 IPTC-NAA record 2 형태로 저장됩니다. 이 리소스의 형식에 대한 더 많은 정보가 필요하다면, Documentation 폴더에서 IPTC 폴더를 찾고 그 안에 있는 문서를 보시기 바랍니다.
Photoshop File Format
Photoshop 파일 형식은 Photoshop file structure 에 나와있는 것처럼 크게 5 개의 부분으로 나뉘어져 있습니다. Photoshop 파일 형식에는 수많은 길이 마커가 포함되어 있습니다. 이 길이 마커를 사용하면 한 섹션에서 다음 섹션까지 얼마나 이동해야 알 수 있습니다. 길이 마커는 일반적으로 가장 가까운 2 또는 4 바이트 간격으로, 바이트 형태로 패드되어 있습니다.
Photoshop file structure
File header (File Header Section).
Color mode data (Color Mode Data Section)
Image resources (Image Resources Section)
Layer and mask information (Layer and Mask Information Section)
Image data (Image Data Section).
파일 헤더의 길이는 고정되어 있습니다. 나머지 4 개의 섹션의 길이는 가변적입니다.
Photoshop 은 모든 섹션에 대해서 읽기를 시도하기 때문에, 이 섹션들을 기록할 때, 반드시 섹션 안의 모든 필드를 기록해 주어야 합니다. 파일을 쓰다가 생략할(skip) 바이트가 있다면, 반드시 생략하려는 필드의 값을 모두 0 으로 저장해야 합니다.
이와 같이 길이로 구분된 섹션 하나를 읽을 때, 길이 필드를 이용하면 어디까지 읽어야 하는지 알 수 있습니다. 대부분의 경우, 길이 필드는 몇 바이트인지 나타냅니다. 그 이외에는 다음과 같습니다.
이어서 나오는 모든 표에서 "Length" 열은 레코드 갯수가 아니라, 바이트 수를 나타냅니다.
유니코드 문자열이라고 된 모든 값들은 다음과 같습니다.
4 바이트의 길이 필드는 문자열의 문자 갯수(바이트 수가 아님)를 나타냅니다.
유니코드 문자열에서는 문자 한 개가 2 바이트입니다.
File Header Section
이미지의 기본 속성을 저장하고 있는 파일 헤더.
Color Mode Data Section
컬러 모드 데이터 섹션은 아래처럼 되어 있습니다.
Length | Description |
---|---|
4 | 이어서 나오는 컬러 데이터의 길이 |
Variable | 컬러 데이터 |
Indexed 컬러와 Duotone (File header section 에서 컬러모드 필드 참고)만 컬러 모드 데이터를 가지고 있습니다. 나머지 모드에서는 이 4 바이트 필드가 모두 0 으로 되어 있습니다.
Indexed color images: 길이는 768 입니다. non-interleaved order 형태로, 이미지를 위한 컬러 테이블을 가지고 있습니다.
Duotone images: 컬러 데이터는 doutone 스펙(문서화 되지 않은 형식)을 가지고 있습니다.
Photoshop 파일을 읽는 다른 어플리케이션은 duotone 이미지를 회색조 이미지(gray image)로 간주합니다. 그리고 파일을 읽고 쓸 때, duotone 정보 컨텐츠를 보존합니다.
Image Resources Section
The third section of the file contains image resources. It starts with a length field, followed by a series of resource blocks.
파일의 세번째 섹션은 이미지 리소스를 가지고 있습니다. 시작부분은 길이 필드입니다. 이어서 리소스 블럭의 시리즈가 나타납니다.
Length | Description |
---|---|
4 | 이미지 리소스 섹션의 길이. 길이는 0 이 될 수 있습니다. |
Variable | 이미지 리소스들 (Image Resource Blocks ). |
Image Resource Blocks
이미지 리소스 블럭은 포토샵 고유 파일 형식을 포함한 JPEG, TIFF 와 같은 파일 형식들에서 사용하는 기본 구성 단위입니다. 이미지 리소스들은 펜 툴 경로(pen tool paths)와 같은 이미지와 관련된 non-pixel 데이터를 저장하기 위해 사용됩니다.
이것들을 리소스 블럭이라고 합니다. 왜냐하면 Photoshop 이전 버젼에서 매킨토시 리소스 포크에 저장하던 데이터를 가지고 있기 때문입니다.
이미지 리소스 블럭의 기본 구조는 Image resource block 에 나와 있습니다. 마지막 필드는 데이터 영역이며, 이것은 리소스 타입에 따라 다릅니다. 각 리소스 타입에 따른 구성은 다음 섹션에 설명 되어 있습니다.
Length | Description |
---|---|
4 | 서명: '8BIM' |
2 | 리소스의 고유 식별자. Image resource IDs 는 Photoshop 에서 사용하는 리소스 ID 목록 입니다. |
Variable | 이름: 사이즈 표시만을 위해서도 패딩되어 있는 파스칼 문자열 형태(이름이 없는 경우, 0 으로 된 2 바이트) |
4 | 이어서 나오는 실제 리소스 데이터의 크기 |
Variable | 각 리소스 타입의 섹션에 설명된 리소스 데이터. 사이즈 크기가 짝수가 되도록 패딩이 들어갑니다.(역주. 예를들어 위 행에서 구한 실제 데이터 크기가 5 인 경우, 크기를 짝수로 만들기 위해서 패딩이 1 바이트 들어갑니다. 따라서 데이터 길이는 6 이 됩니다) |
Image Resource IDs
Image resource IDs 에 나와있는 이미지 리소스는 대부분 표준 ID 넘버 입니다. 모든 파일 형식이 모든 ID 를 사용하는 것은 아닙니다. 어떤 정보는 파일의 다른 섹션에 저장될 수 도 있습니다.
Photoshop 3.0 이후에 추가된 리소스 IDs 를 위해서는, 따로 추가되기 시작한 버전을 표시하도록 하겠습니다. 예. ( Photoshop 6.0).
ID | Description | |
---|---|---|
Hex | Decimal | |
0x03E8 | 1000 | (Obsolete--Photoshop 2.0 only ) 2 바이트로 된 값 5 개. 채널 수, 행, 열, 심도, 모드 |
0x03E9 | 1001 | 매킨토시 프린트 매니저의 프린트 정보 레코드 |
0x03EB | 1003 | (Obsolete--Photoshop 2.0 only ) Indexed color table |
0x03ED | 1005 | ResolutionInfo 구조체 Photoshop API Guide.pdf 의 부록 A 참고. |
0x03EE | 1006 | 파스칼 문자열로 된 연속된 알파 채널의 이름들 |
0x03EF | 1007 | (Obsolete) See ID 1077 DisplayInfo 구조체 Photoshop API Guide.pdf 의 부록 A 참고. |
0x03F0 | 1008 | 파스칼 문자열로 된 캡션(caption) |
0x03F1 | 1009 | 테두리(border) 정보 테두리 너비를 위한 고정된 수(실수 부분 2 바이트, 소수 부분 2 바이트), 그리고 테두리 단위를 표시하기 위한 2 바이트(1 = inches, 2 = cm, 3 = points, 4 = picas, 5 = columns). |
0x03F2 | 1010 | 배경색 |
0x03F3 | 1011 | 프린트 플래그 연속된 1 바이트 boolean 값들(Page Setup dialog 참고): 라벨들, crop marks, color bars, registration marks, negative, flip, interpolate, caption, print flags. |
0x03F4 | 1012 | 회색조(Grayscale) 과 multichannel halftoning 정보 |
0x03F5 | 1013 | Color halftoning 정보 |
0x03F6 | 1014 | Duotone halftoning 정보 |
0x03F7 | 1015 | Grayscale and multichannel 변환 함수들 |
0x03F8 | 1016 | Color 변환 함수들 |
0x03F9 | 1017 | Duotone 변환 함수들 |
0x03FA | 1018 | Duotone 이미지 정보 |
0x03FB | 1019 | Two bytes for the effective black and white values for the dot range |
0x03FC | 1020 | (Obsolete) |
0x03FD | 1021 | EPS 옵션 |
0x03FE | 1022 | Quick Mask 정보 Quick Mask 채널 ID 를 나타내는 2 바이트; 1- byte boolean 은 마스크가 초기에 비어 있는지 나타냅니다. |
0x03FF | 1023 | (Obsolete) |
0x0400 | 1024 | Layer 상태 정보 대상 레이어의 인덱스를 나타내는 2 바이트(0 = bottom 레이어) |
0x0401 | 1025 | Working path (not saved) |
0x0402 | 1026 | Layer 들의 그룹 정보 드래깅 그룹을 위한 그룹 ID. 레이어 마다 각 2 바이트. 동일한 그룹에 있는 레이어들은 같은 그룹 ID 를 가집니다. |
0x0403 | 1027 | (Obsolete) |
0x0404 | 1028 | IPTC-NAA 레코드 Contains the File Info... information. See the documentation in the IPTC folder of the Documentation folder. |
0x0405 | 1029 | Image mode for raw format files |
0x0406 | 1030 | JPEG quality. Private. |
0x0408 | 1032 | (Photoshop 4.0) Grid and guides information |
0x0409 | 1033 | (Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only |
0x040A | 1034 | (Photoshop 4.0) Copyright 플래그 Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in File Info... |
0x040B | 1035 | (Photoshop 4.0) URL Handle of a text string with uniform resource locator. Can be set via Property suite or by user in File Info... |
0x040C | 1036 | (Photoshop 5.0) Thumbnail resource (리소스 1033 를 대체) |
0x040D | 1037 | (Obsolete) ID 1073 참고. (Photoshop 5.0) Global Angle 효과 레이어(effects layer)의 전역 조명 각도로서 0 에서 359 사이의 4 바이트 정수값. 만약 없는 경우 30 으로 간주 합니다. |
0x040E | 1038 | (Obsolete) 아래 ID 1073 참고 (Photoshop 5.0) Color samplers resource |
0x040F | 1039 | (Photoshop 5.0) ICC Profile The raw bytes of an ICC (International Color Consortium) format profile. See ICC1v42_2006-05.pdf in the Documentation folder andicProfileHeader.h in Sample Code\Common\Includes . |
0x0410 | 1040 | (Photoshop 5.0) Watermark 1 바이트. |
0x0411 | 1041 | (Photoshop 5.0) ICC Untagged Profile 1 byte that disables any assumed profile handling when opening the file. 1 = intentionally untagged. |
0x0412 | 1042 | (Photoshop 5.0) Effects visible 1-byte global flag to show/hide all the effects layer. Only present when they are hidden. |
0x0413 | 1043 | (Photoshop 5.0) Spot Halftone 4 bytes for version, 4 bytes for length, and the variable length data. |
0x0414 | 1044 | (Photoshop 5.0) Document-specific IDs seed number 4 bytes: Base value, starting at which layer IDs will be generated (or a greater value if existing IDs already exceed it). Its purpose is to avoid the case where we add layers, flatten, save, open, and then add more layers that end up with the same IDs as the first set. |
0x0415 | 1045 | (Photoshop 5.0) Unicode Alpha Names Unicode string (4 bytes length followed by string). |
|
| (Photoshop 6.0) Indexed Color Table Count 2 bytes for the number of colors in table that are actually defined |
|
| (Photoshop 6.0) Transparency Index. 2 bytes for the index of transparent color, if any. |
|
| (Photoshop 6.0) Global Altitude 4 byte entry for altitude |
|
| (Photoshop 6.0) Slices |
|
| (Photoshop 6.0) Workflow URL Unicode string |
|
| (Photoshop 6.0) Jump To XPEP 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 = 'jtDd' , then next is a Boolean for the dirty flag; otherwise it's a 4 byte entry for the mod date. |
|
| (Photoshop 6.0) Alpha Identifiers 4 bytes of length, followed by 4 bytes each for every alpha identifier. |
|
| (Photoshop 6.0) URL List 4 byte count of URLs, followed by 4 byte long, 4 byte ID, and Unicode string for each count. |
|
| (Photoshop 6.0) Version Info 4 bytes version, 1 byte hasRealMergedData , Unicode string: writer name, Unicode string: reader name, 4 bytes file version. |
0x0422 | 1058 | (Photoshop 7.0) EXIF data 1 See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf |
0x0423 | 1059 | (Photoshop 7.0) EXIF data 3 See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf |
0x0424 | 1060 | (Photoshop 7.0) XMP metadata File info as XML description. See http://www.adobe.com/devnet/xmp/ |
0x0425 | 1061 | (Photoshop 7.0) Caption digest 16 bytes: RSA Data Security, MD5 message-digest algorithm |
0x0426 | 1062 | (Photoshop 7.0) Print scale 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 (floating point) |
0x0428 | 1064 | (Photoshop CS) Pixel Aspect Ratio 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%. |
0x0429 | 1065 | (Photoshop CS) Layer Comps 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) |
0x042A | 1066 | (Photoshop CS) Alternate Duotone Colors 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each for L, a, b This resource is not read or used by Photoshop. |
0x042B | 1067 | (Photoshop CS)Alternate Spot Colors 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component This resource is not read or used by Photoshop. |
0x042D | 1069 | (Photoshop CS2) Layer Selection ID(s) 2 bytes count, following is repeated for each count: 4 bytes layer ID |
0x042E | 1070 | (Photoshop CS2) HDR Toning information |
0x042F | 1071 | (Photoshop CS2) Print info |
0x0430 | 1072 | (Photoshop CS2) Layer Group(s) Enabled ID 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers |
0x0431 | 1073 | (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. |
0x0432 | 1074 | (Photoshop CS3) Measurement Scale 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) |
0x0433 | 1075 | (Photoshop CS3) Timeline Information 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) |
0x0434 | 1076 | (Photoshop CS3) Sheet Disclosure 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) |
0x0435 | 1077 | (Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf . |
0x0436 | 1078 | (Photoshop CS3) Onion Skins 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) |
0x0438 | 1080 | (Photoshop CS4) Count Information 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool. |
0x043A | 1082 | (Photoshop CS5) Print Information 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options. |
0x043B | 1083 | (Photoshop CS5) Print Style 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc. |
0x043C | 1084 | (Photoshop CS5) Macintosh NSPrintInfo Variable OS specific info for Macintosh. NSPrintInfo. It is recommened that you do not interpret or use this data. |
0x043D | 1085 | (Photoshop CS5) Windows DEVMODE Variable OS specific info for Windows. DEVMODE. It is recommened that you do not interpret or use this data. |
0x043E | 1086 | (Photoshop CS6) Auto Save File Path Unicode string. It is recommened that you do not interpret or use this data. |
0x043F | 1087 | (Photoshop CS6) Auto Save Format Unicode string. It is recommened that you do not interpret or use this data. |
0x07D0-0x0BB6 | 2000-2997 | Path Information (saved paths) |
0x0BB7 | 2999 | Name of clipping path |
0x0FA0-0x1387 | 4000-4999 | Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation |
0x1B58 | 7000 | Image Ready variables XML representation of variables definition |
0x1B59 | 7001 | Image Ready data sets |
0x1F40 | 8000 | (Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow. |
0x2710 | 10000 | Print 플래그 정보 2 bytes version ( = 1), 1 byte center crop marks, 1 byte ( = 0), 4 bytes bleed width value, 2 bytes bleed width scale. |
이어서 몇몇 리소스 형식에 대해서 좀 더 자세히 알아 보겠습니다.
Grid and guides resource format
Photoshop 은 이미지에 대한 그리드와 가이드 정보를 이미지 리소스 블럭에 저장합니다. 이 리소스 블럭들은 각각 초기 16 바이트 크기의 '그리드와 가이드 헤더'로 되어 있습니다. 이 값은 항상 존재합니다. 그리고 가이드가 존재할 경우(fGuideCount > 0) 가이드 방향과 위치 정보를 위한 5 바이트 블럭이 나타납니다.
Length | Description |
---|---|
4 | Version ( = 1) |
8 | Future implementation of document-specific grids (4 bytes horizontal, 4 bytes vertical). Currently, sets the grid cycle to every quarter inch, i.e. 576 for both horizontal & vertical (at 72 dpi, that is 18 * 32 = 576) |
4 | fGuideCount : 가이드 리소스 블럭의 수 (can be 0). |
Length | Description |
---|---|
4 | 문서 내의 각 가이드 위치 좌표. 가이드는 수직 또는 수평 중 하나이므로, 이 값은 좌표값 하나만을 가집니다. |
1 VHSelect | 가이드 방향. VHSelect is a system type of unsigned char where 0 = vertical, 1 = horizontal. |
그리드와 가이드 정보는 Property suite 를 사용하여 수정될 수 있습니다. 더 많은 정보를 위해서는 Photoshop API Guide.pdf 의 Callbacks 챕터를 참고 바랍니다.
Adobe Photoshop (version 5.0 과 이후 버전) 은 매킨토시와 윈도우 모두를 위해서, 28 바이트의 미리보기용 썸네일 정보 헤더를 이미지 리소스 블럭에 저장합니다 .이어서 RGB(red, green, blue)로 된 미리보기용 JFIF 썸네일이 나옵니다.
Adebe Photoshop 4.0 은 데이터 섹션이 BGR(blue, green, red) 인 것을 제외하고, 동일한 형식으로 썸네일 정보를 저장합니다. 4.0 포맷은 리소스 ID 1033, 그리고 5.0 포맷은 리소스 ID 1036 에 있습니다.
Length | Description |
---|---|
4 | Format. 1 = kJpegRGB . Also supports kRawRGB (0). |
4 | Width of thumbnail in pixels. |
4 | Height of thumbnail in pixels. |
4 | Widthbytes: Padded row bytes = (width * bits per pixel + 31) / 32 * 4. |
4 | Total size = widthbytes * height * planes |
4 | Size after compression. Used for consistency check. |
2 | Bits per pixel. = 24 |
2 | Number of planes. = 1 |
Variable | JFIF data in RGB format. For resource ID 1033 the data is in BGR format. |
Color samplers resource format
Adobe Photoshop (version 5.0 과 이후 버전) 은 이미지의 컬러 샘플러 정보를 위해서, 8 바이트 컬러 샘플러 헤더와 가변길이 블럭인 컬러 샘플러 정보를 이미지 리소스 블럭에 저장합니다.
Length | Description |
---|---|
4 | Version ( = 1, 2 or 3) |
4 | 이어서 나오는 컬러 샘플러의 갯수. See Color Samplers resource block 참고 |
Photoshop stores the paths saved with an image in an image resource block. These resource blocks consist of a series of 26-byte path point records, so the resource length should always be a multiple of 26.
Photoshop stores its paths as resources of type 8BIM , with IDs in the range 2000 through 2997. These numbers should be reserved for Photoshop. The name of the resource is the name given to the path when it was saved.
If the file contains a resource of type 8BIM with an ID of 2999, then this resource contains a Pascal-style string containing the name of the clipping path to use with this image when saving it as an EPS file. 4 byte fixed value for flatness and 2 byte fill rule. 0 = same fill rule, 1 = even odd fill rule, 2 = non zero winding fill rule. The fill rule is ignored by Photoshop.
The path format returned by GetProperty() call is identical to what is described below. Refer to the IllustratorExport sample plug-in code to see how this resource data is constructed.
Path points
All points used in defining a path are stored in eight bytes as a pair of 32-bit components, vertical component first.
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 eliminate most concerns over arithmetic overflow. Hence, the range for each component is 0xF0000000 to 0x0FFFFFFF representing a range of -16 to 16. The lower bound is included, but not the upper bound.
This limited range is used because the points are expressed relative to the image size. The vertical component is given with respect to the image height, and the horizontal component is given with respect to the image width. [ 0,0 ] represents the top-left corner of the image; [ 1,1 ] ([ 0x01000000,0x01000000 ]) represents the bottom-right.
In Windows, the byte order of the path point components are reversed; you should swap the bytes when accessing each 32-bit value.
Path records
The data in a path resource consists of one or more 26-byte records. The first two bytes of each record is a selector to indicate what kind of path it is. For Windows, you should swap the bytes before accessing it as a short.
Selector | Description |
---|---|
0 | Closed subpath length record |
1 | Closed subpath Bezier knot, linked |
2 | Closed subpath Bezier knot, unlinked |
3 | Open subpath length record |
4 | Open subpath Bezier knot, linked |
5 | Open subpath Bezier knot, unlinked |
6 | Path fill rule record |
7 | Clipboard record |
8 | Initial fill rule record |
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 length records, selector value 0 or 3, contain the number of Bezier knot records in bytes 2 and 3. The remaining 22 bytes are unused, and should be zeroes. Each length record is then immediately followed by the Bezier knot records describing the knots of the subpath.
In Bezier knot records, the 24 bytes following the selector field contain three path points (described above) for:
the control point for the Bezier segment preceding the knot,
the anchor point for the knot, and
the control point for the Bezier segment leaving the knot.
Linked knots have their control points linked. Editing one point modifies the other to preserve collinearity. Knots should only be marked as having linked controls if their control points are collinear with their anchor. The control points on unlinked knots are independent of each other. Refer to the Adobe Photoshop User Guide for more information.
Clipboard records, selector=7 , contain four fixed-point numbers for the bounding rectangle (top, left, bottom, right), and a single fixed-point number indicating the resolution.
Initial fill records, selector=8 , contain one two byte record. A value of 1 means that the fill starts with all pixels. The value will be either 0 or 1.
Adobe Photoshop 6.0 과 이후 버전에서는 이미지의 슬라이스(slice)들 정보를 이미지 리소스 블럭안에 저장합니다.
Length | Description |
---|---|
4 | Version ( = 6) |
4 * 4 | 모든 슬라이스들을 위한 바운딩 박스(Bounding rectangle): 모든 슬라이스들의 top, left, bottom, right |
Variable | 슬라이스들 그룹의 이름: 유니코드 문자열 |
4 | 이어서 나오는 슬라이스들의 갯수. 다음에 나오는 Slices 리소스 블럭표 참고. |
Length | Description |
---|---|
4 | ID |
4 | Group ID |
4 | Origin |
4 | Associated Layer ID Only present if Origin = 1 |
Variable | Name: Unicode string |
4 | Type |
4 * 4 | Left, top, right, bottom positions |
Variable | URL: Unicode string |
Variable | Target: Unicode string |
Variable | Message: Unicode string |
Variable | Alt Tag: Unicode string |
1 | Cell text is HTML: Boolean |
Variable | Cell text: Unicode string |
4 | Horizontal alignment |
4 | Vertical alignment |
1 | Alpha color |
1 | Red |
1 | Green |
1 | Blue |
Vanishing point resource format
Adobe Photoshop CS2 (9.0) 과 이후 버전에서는 이미지의 소실점 포인트(vanishing point) 정보를 이미지 리소스 블럭에 저장합니다. 이 리소스는 모두 문자열로 되어 있으며, Windows 는 'tnaF', 매킨토시는 'FaNt' 로 시작합니다. 이 리소스의 구조는 아래에서 설명합니다.
Vocabulary:
Relation - a set of related planes.
Root Plane - the first plane in a relation.
Calibration Order - an ordering of the planes in a relation starting with the root plane, depth first, recursive traversal of the planes that are attached to the given plane.
Basics:
A planes area is represented as a clipped area of vanish rays. A Ray defines one of the virtual sides of the plane's area. A Ray's structure keeps track of information needed for tearing off and orientation issues. Parallel rays must point at the same VPID. A Primary ray's origin represents the point on the plane that is farthest from both VPs. The two primary rays share an origin.
version = 101
number of relations to follow.
-- for each relation--
grid resolution for the root plane
number of planes to follow
-- for each plane in calibration order--
ID of the plane
ID of the plane that calibrates this plane 0 if none
-- for 4 rays --
origin position of the ray. Point
VP location - must be consistent across all planes in the relation unless it is an endpoint. Point
true if the VP location is an endpoint
ID that this ray points at.
Ray DI (see below)
++++++++++++++++++++
I/O appendix
Point - two doubles; h endl, v endl
VPID - int (enum value) 0,1,2 identifing 1 of 3 possible VPs
RayID - 1, One of the primary rays directly connected to the shared origin
3, a non-primary ray parallel to 7
5, a non-primary ray parallel to 1
7, One of the primary rays directly connected to the shared origin .
Layer and Mask Information Section
Photoshop 파일의 네번째 섹션은 레이어와 마스크 정보를 담고 있습니다. 문서의 이번 섹션에서는 레이어와 마스크 저장형식에 대해서 다룹니다.
병합(merged)된 최종 이미지 데이터는 이곳에 저장되지 않습니다. 최종적인 병합/반전된 이미지는 파일의 가장 마지막 섹션에 위치합니다. See Image Data Section 를 참고하시기 바랍니다. 만약 최대 호환성(maximize compatibility) 에 체크가 되어 있지 않으면, 병합/반전된 이미지는 따로 생성되지 않기 때문에, 최종 이미지를 얻기 위해서는 레이어 데이터를 읽어서 다시 만들어야 해야 합니다.
See Layer and mask information section 은 이 섹션의 전반적인 구조체를 보여 줍니다. 만약 레이어나 마스크가 따로 없는 경우, 이 섹션은 필드의 길이를 의미하는 값으로, 0 으로 된 4 바이트가 전부 입니다. (**PSB** 의 길이는8 바이트 입니다. See Layer info 에 나와있는 'Layr', 'Lr16', 'Lr32' 로 시작합니다. 참고: 섹션 길이는 이미 알려져 있습니다.)
이 섹션을 파싱할 때, 섹션의 길이에 매우 조심하시기 바랍니다.
Length | Description |
---|---|
4 | 레이어와 마스크 정보 섹션의 길이. (**PSB** 인 경우 8 바이트.) |
Variable | Layer info (자세한 내용은 See Layer info 참고). |
Variable | Global layer mask info (자세한 내용은 See Global layer mask info 참고). |
Variable | (Photoshop 4.0 and later) 다양한 데이터 타입을 포함하는 태그(tagged)된 블럭의 연속. 여기에 들어갈 수 있는 데이터 타입의 목록은 See Additional Layer Information 를 참고. |
See Layer info 는 레이어 정보(Layer info) 구성에 대해서 자세히 보여 줍니다.
Length | Description |
---|---|
4 | 레이어 정보 섹션의 길이. 2의 배수값.(**PSB** 의 경우 8 바이트) (역주: 실제로 확인해보니 2의 배수가 아니라 4의 배수) |
2 | 레이어 갯수. 만약 이 값이 음수라면, 이 값의 절대값이 레이어의 갯수이고, 첫번째 알파 채널이 병합(mergy)의 결과로 transparency 데이터를 가지고 있습니다. |
Variable | 각 레이어에 대한 정보. 각 레이어에 대한 이 정보의 구조체는 See Layer records 에 나와 있습니다. |
Variable | 채널 이미지 데이터. 각 레이어에 대해서 한개 또는 그 이상의 이미지 데이터(구조는 See Channel image data 를 참고) 를 가지고 있습니다. 레이어의 순서는 '레이어 정보'(이 표의 바로 위 행) 와 동일합니다. |
Length | Description |
---|---|
4 * 4 | 레이어의 컨텐츠를 가지고 있는 Rectangle. top, left, bottom, right 좌표값. |
2 | 레이어에 채널의 갯수 |
6 * number of channels | 채널 정보. 각 채널당 6 바이트며, 아래 정보를 담고 있습니다. 2 바이트는 Channel ID: 0 = red, 1 = green 등. -1 = transparency mask; -2 = user supplied layer mask, -3 real user supplied layer mask (when both a user mask and a vector mask are present) 4 바이트는 채널 데이터의 길이. (**PSB** 는 채널 데이터의 길이를 나타내기 위해서 8 바이트.) 채널 데이터의 구조는 See Channel image data 를 참고. |
4 | 블렌드(Blend) 모드 서명: '8BIM' |
4 | 블렌드(Blend) 모드 키: 'pass' = pass through, 'norm' = normal, 'diss' = dissolve, 'dark' = darken, 'mul ' = multiply, 'idiv' = color burn, 'lbrn' = linear burn, 'dkCl' = darker color, 'lite' = lighten, 'scrn' = screen, 'div ' = color dodge, 'lddg' = linear dodge, 'lgCl' = lighter color, 'over' = overlay, 'sLit' = soft light, 'hLit' = hard light, 'vLit' = vivid light, 'lLit' = linear light, 'pLit' = pin light, 'hMix' = hard mix, 'diff' = difference, 'smud' = exclusion, 'fsub' = subtract, 'fdiv' = divide 'hue ' = hue, 'sat ' = saturation, 'colr' = color, 'lum ' = luminosity, |
1 | Opacity. 0 = transparent ... 255 = opaque |
1 | Clipping: 0 = base, 1 = non-base |
1 | Flags: bit 0 = transparency protected; bit 1 = visible; bit 2 = obsolete; bit 3 = 1 for Photoshop 5.0 and later, tells if bit 4 has useful information; bit 4 = pixel data irrelevant to appearance of document |
1 | Filler (zero) |
4 | Length of the extra data field ( = the total length of the next five fields). |
Variable | 레이어 마스크 데이터: 구조는 See Layer mask / adjustment layer data 를 참고하시기 바랍니다. 데이터는 40 바이트, 24 바이트 혹은 레이어 마스크가 없는 경우 4 바이트 입니다. |
Variable | 레이어 블렌딩 영역들(ranges): See Layer blending ranges data. 참고. |
Variable | 레이어 이름: 파스칼 문자열. 4의 배수로 패딩되어 있습니다. (역주: 여기에 있는 이름은 Full Name 이 아닙니다. 31 byte 로 제한되어 있습니다. FullName 을 얻으려면, Additional Info 의 'luni' 를 참고해야 합니다.) 문자열 길이를 1 Byte 로 표현합니다. |
(역주: Additional Layer Information 은 Layer And Mask Information Section 뒤 뿐 아니라, Layer Record 뒤와 Layer mask/adjustment layer data 사이에도 존재합니다.)
Length | Description |
---|---|
2 | 압축. 0 = Raw Data, 1 = RLE compressed, 2 = ZIP without prediction, 3 = ZIP with prediction. |
Variable | 이미지 데이터. 만약 악축 코드가 0 이라면, 이미지 데이터는 로우한 이미지 데이터 입니다. 그리고 크기는 (LayerBottom-LayerTop)* (LayerRight-LayerLeft) 로 계산하면 됩니다. (See Layer records 에 나와있는 첫번째 필드) 만약 압축코드가 1 이라면, 이미지 데이터는 채널의 모든 스캔 라인들의 바이트 수(LayerBottom-LayerTop)로 시작합니다. 이 바이트 수를 나타내는데 2 바이트를 사용합니다.(**PSB** 는 바이트수를 나타내기 위해 4 바이트를 사용합니다.) 개별적으로 압축된 스캔 라인 데이터인 RLE 가 이어서 나옵니다. RLE 압축은 매킨토시 ROM 방식인 PackBits와 TIFF 표준과 동일한 압축 알고리즘을 사용합니다. 만약 레이어의 사이즈, 그러니까 데이터가 이상한 경우, 행의 마지막에 패드 바이트가 추가될 수 있습니다. 만약 레이어가 adjustment layer 인 경우, 채널 데이터는 미정의 됩니다.(아마도 모두 흰색) (역주: RLE 의 경우. { [Length (Height * 2 byte)] + [RLE] } 가 각 채널별(RGB)로 sequence 하게 나타납니다.) |
Additional Layer Information
Photoshop 4.0 과 그 이후 버젼에서 추가된 레이어 정보 타입이 몇 가지 있습니다.
이것들은 레이어 레코드 구조 뒷 부분에 위치합니다.(See Layer records 마지막 행을 참고). 구조는 아래처럼 되어 있습니다.
(역주: Additional Layer Information 은 Layer Record 뒤 뿐 아니라, Layer And Mask Information Section 뒤에도 존재합니다.)
Length | Description |
---|---|
4 | Signature: '8BIM' or '8B64' |
4 | Key: a 4-character code (See individual sections) |
4 | Length data below, rounded up to an even byte count. (역주: 짝수로 맞추기 위해 패딩이 들어갔다고 되어 있지만, 실제로 확인해 보니 패딩은 4 바이트 배수로 되어 있습니다.) (**PSB**, the following keys have a length count of 8 bytes: LMsk, Lr16, Lr32, Layr, Mt16, Mt32, Mtrn, Alph, FMsk, lnk2, FEid, FXid, PxSD. |
Variable | Data (See individual sections) |
다음 섹션에서 사용 가능한 데이터 타입들과 각각의 키와 형식에 대해서 설명합니다.
Adjustment layer (Photoshop 4.0)
Adjustment 레이어들은 다음 키 중 하나 입니다.
'SoCo' = Solid Color
'GdFl' = Gradient
'PtFl' = Pattern
'brit' = Brightness/Contrast
'levl' = Levels
'curv' = Curves
'expA' = Exposure
'vibA' = Vibrance
'hue ' = Old Hue/saturation, Photoshop 4.0
'hue2' = New Hue/saturation, Photoshop 5.0
'blnc' = Color Balance
'blwh' = Black and White
'phfl' = Photo Filter
'mixr' = Channel Mixer
'clrL' = Color Lookup
'nvrt' = Invert
'post' = Posterize
'thrs' = Threshold
'grdm' = Gradient Map
'selc' = Selective color
adjustment 레이어의 데이터는 불러오는 파일 형식의 각 포맷과 동일합니다. 더 많은 정보는 See Additional File Formats 를 참고하시기 바랍니다.
Effects Layer (Photoshop 5.0)
The key for the effects layer is 'lrFX' . The data has the following format:
Length | Description |
---|---|
2 | Version: 0 |
2 | Effects count: may be 6 (for the 6 effects in Photoshop 5 and 6) or 7 (for Photoshop 7.0) |
The next three items are repeated for each of the effects. | |
4 | Signature: '8BIM' |
4 | Effects signatures: OSType key for which effects type to use: 'cmnS' = common state (see See Effects layer, common state info) 'dsdw' = drop shadow (see See Effects layer, drop shadow and inner shadow info) 'isdw' = inner shadow (see See Effects layer, drop shadow and inner shadow info) 'oglw' = outer glow (see See Effects layer, outer glow info) 'iglw' = inner glow (see See Effects layer, inner glow info) 'bevl' = bevel (see See Effects layer, bevel info) 'sofi' = solid fill ( Photoshop 7.0) (see See Effects layer, solid fill (added in Photoshop 7.0)) |
Variable | See appropriate tables. |
Length | Description |
---|---|
4 | Size of next three items: 7 |
4 | Version: 0 |
1 | Visible: always true |
2 | Unused: always 0 |
Length | Description |
---|---|
4 | Size: 34 |
4 | Version: 2 |
4 | Key for blend mode |
10 | Color space |
1 | Opacity |
1 | Enabled |
10 | Native color space |
Type Tool Info (Photoshop 5.0 and 5.5 only)
Has been superseded in Photoshop 6.0 and beyond by a different structure with the key 'TySh' (see See Type tool object setting (Photoshop 6.0) See Type tool object setting ).
Key is ' tySh' . Data is as follows:
Unicode layer name (Photoshop 5.0)
Key is 'luni' . Data is as follows:
Length | Description |
---|---|
Variable | Unicode string (4 bytes length + string). |
Layer ID (Photoshop 5.0)
Key is 'lyid' .
Length | Description |
---|---|
4 | Signature: '8BIM' |
4 | Key: 'lyid' |
4 | Length: 4 |
4 | ID. |
Object-based effects layer info (Photoshop 6.0)
Key is 'lfx2' . Data is as follows:
Length | Description |
---|---|
4 | Object effects version: 0 |
4 | Descriptor version ( = 16 for Photoshop 6.0). |
Variable | Descriptor (see See Descriptor structure) |
Patterns (Photoshop 6.0 and CS (8.0))
This is a list of patterns. Key is 'Patt', 'Pat2' or 'Pat3' . Data is as follows:
Length | Description |
---|---|
The following is repeated for each pattern. | |
4 | Length of this pattern |
4 | Version ( =1) |
4 | The image mode of the file. Supported values are: Bitmap = 0; Grayscale = 1; Indexed = 2; RGB = 3; CMYK = 4; Multichannel = 7; Duotone = 8; Lab = 9. |
4 | Point: vertical, 2 bytes and horizontal, 2 bytes |
Variable | Name: Unicode string |
Variable | Unique ID for this pattern: Pascal string |
Variable | Index color table (256 * 3 RGB values): only present when image mode is indexed color |
Variable | Pattern data as Virtual Memory Array List |
Length | Description |
---|---|
4 | Version |
4 | Length |
32 | Rectangle: top, left, bottom, right |
4 | Max channels |
The following is a virtual memory array, repeated for the number of channels in the image mode, not to exceed the max channels. | |
4 | Boolean indicating whether array is written |
4 | Length |
4 | Pixel depth: 1, 8 or 16 |
1 | Compression mode of data to follow. 'Pat2' compression is zip. |
Variable | Actual data based on parameters and compression |
Annotations (Photoshop 6.0)
Key is 'Anno' . Data is as follows:
Length | Description |
---|---|
2 | Major version ( = 2) |
2 | Minor version. ( = 1) |
4 | Count of annotations to follow |
Following is repeated for each annotation | |
4 | Length of this annotation |
4 | Annotation type: either text( 'txtA' ) or sound ( 'sndA' ). |
1 | Is the annotation open |
1 | Flags. |
2 | Optional blocks. ( =1 for Photoshop 6.0) |
16 | Rectangle of icon location: top, left, bottom and right. |
16 | Rectangle of popup locations: top, left, bottom and right |
10 | 2 bytes for space followed by 4 * 2 byte color component |
Variable | Pascal string of author's name aligned to 2 bytes |
Variable | Pascal string of name aligned to 2 bytes |
Variable | Pascal string of the mod Date aligned to 2 bytes |
4 | Length of the following 3 fields including this field |
4 | ' txtC ' or ' sndM '. Either text or sound |
4 | Length of the next field |
Variable | Actual data for this annotation. The text is an ASCII or Unicode string; the sound annotation is documented in the PDF Reference , available athttp://Partners.adobe.com/asn/developer/acrosdk/docs.html#filefmtspecs |
Variable | Padding to align to multiple of 4 bytes |
Blend clipping elements (Photoshop 6.0)
Key is 'clbl' . Data is as follows:
Length | Description |
---|---|
1 | Blend clipped elements: boolean |
3 | Padding |
Blend interior elements (Photoshop 6.0)
Key is 'infx' . Data is as follows:
Length | Description |
---|---|
1 | Blend interior elements: boolean |
3 | Padding |
Knockout setting (Photoshop 6.0)
Key is 'knko' . Data is as follows:
Length | Description |
---|---|
1 | Knockout: boolean |
3 | Padding |
Protected setting (Photoshop 6.0)
Key is 'lspf' . Data is as follows:
Length | Description |
---|---|
4 | Protection flags: bits 0 - 2 are used for Photoshop 6.0. Transparency, composite and position respectively. |
Sheet color setting (Photoshop 6.0)
Key is 'lclr' . Data is as follows:
Length | Description |
---|---|
4 * 2 | Color. Only the first color setting is used for Photoshop 6.0; the rest are zeros |
Reference point (Photoshop 6.0)
Key is 'fxrp' . Data is as follows:
Length | Description |
---|---|
2 * 8 | 2 double values for the reference point |
Gradient settings (Photoshop 6.0)
Key is 'grdm' . Data is as follows:
Length | Description |
---|---|
2 | Version ( =1 for Photoshop 6.0) |
1 | Is gradient reversed |
1 | Is gradient dithered |
Variable | Name of the gradient: Unicode string, padded |
2 | Number of color stops to follow |
Following is repeated for each color stop | |
4 | Location of color stop |
4 | Midpoint of color stop |
2 | Mode for the color to follow |
4 * 2 | Actual color for the stop |
2 | Number of transparency stops to follow |
Following is repeated for each transparency stop | |
4 | Location of transparency stop |
4 | Midpoint of transparency stop |
2 | Opacity of transparency stop |
2 | Expansion count ( = 2 for Photoshop 6.0) |
2 | Interpolation if length above is non-zero |
2 | Length (= 32 for Photoshop 6.0) |
2 | Mode for this gradient |
4 | Random number seed |
2 | Flag for showing transparency |
2 | Flag for using vector color |
4 | Roughness factor |
2 | Color model |
4 * 2 | Minimum color values |
4 * 2 | Maximum color values |
2 | Dummy: not used in Photoshop 6.0 |
Section divider setting (Photoshop 6.0)
Key is 'lsct' . Data is as follows:
Length | Description |
---|---|
4 | Type. 4 possible values, 0 = any other type of layer, 1 = open "folder", 2 = closed "folder", 3 = bounding section divider, hidden in the UI |
Following is only present if length = 12 | |
4 | Signature: '8BIM' |
4 | Key. See blend mode keys in See Layer records. |
Channel blending restrictions setting (Photoshop 6.0)
Key is 'brst' . Data is as follows:
Length | Description |
---|---|
Following is repeated length / 4 times. | |
4 | Channel number that is restricted |
Solid color sheet setting (Photoshop 6.0)
Key is 'SoCo' . Data is as follows:
Length | Description |
---|---|
4 | Version ( = 16 for Photoshop 6.0) |
Variable | Descriptor. Based on the Action file format structure (see See Descriptor structure) |
Pattern fill setting (Photoshop 6.0)
Key is 'PtFl' . Data is as follows:
Length | Description |
---|---|
4 | Version ( =16 for Photoshop 6.0) |
Variable | Descriptor. Based on the Action file format structure (see See Descriptor structure) |
Gradient fill setting (Photoshop 6.0)
Key is 'GdFl' . Data is as follows:
Length | Description |
---|---|
4 bytes | Version ( = 16 for Photoshop 6.0) |
Variable | Descriptor. Based on the Action file format structure (see See Descriptor structure) |
Vector mask setting (Photoshop 6.0)
Key is 'vmsk' or 'vsms'. If key is 'vsms' then we are writing for (Photoshop CS6) and the document will have a 'vscg' key. Data is as follows:
Length | Description |
---|---|
4 | Version ( = 3 for Photoshop 6.0) |
4 | Flags. bit 1 = invert, bit 2 = not link, bit 3 = disable |
The rest of the data is path components, loop until end of the length. | |
Variable | Paths. See See Path resource format |
Type tool object setting (Photoshop 6.0)
This supersedes the type tool info in Photoshop 5.0 (see See Type tool Info).
Key is 'TySh' . Data is as follows:
Length | Description |
---|---|
2 | Version ( =1 for Photoshop 6.0) |
6 * 8 | Transform: xx, xy, yx, yy, tx, and ty respectively. |
2 | Text version ( = 50 for Photoshop 6.0) |
4 | Descriptor version ( = 16 for Photoshop 6.0) |
Variable | Text data (see See Descriptor structure) |
2 | Warp version ( = 1 for Photoshop 6.0) |
4 | Descriptor version ( = 16 for Photoshop 6.0) |
Variable | Warp data (see See Descriptor structure) |
4 * 8 (역주참고) | left, top, right, bottom respectively. (역주: 스펙상에는 4 * 8 로 명시되어 있지만, 이는 오류로 보이고 실제로는 4 * 4(integer * 4) 로 계산해야 합니다.) |
Foreign effect ID (Photoshop 6.0)
Key is 'ffxi' . Data is as follows:
Length | Description |
---|---|
4 | ID of the Foreign effect. |
Layer name source setting (Photoshop 6.0)
Key is 'lnsr' . Data is as follows:
Length | Description |
---|---|
4 | ID for the layer name |
Pattern data (Photoshop 6.0)
Key is 'shpa' . Data is as follows:
Length | Description |
---|---|
4 | Version ( = 0 for Photoshop 6.0) |
4 | Count of sets to follow |
The following is repeated for the count above. | |
4 | Pattern signature |
4 | Pattern key |
4 | Count of patterns in this set |
1 | Copy on sheet duplication |
3 | Padding |
The following is repeated for the count of patterns above. | |
4 | Color handling. Prefer convert = 'conv' , avoid conversion = 'avod' , luminance only = 'lumi' |
Variable | Pascal string name of the pattern |
Variable | Unicode string name of the pattern |
Variable | Pascal string of the unique identifier for the pattern |
Metadata setting (Photoshop 6.0)
Key is 'shmd' . Data is as follows:
Length | Description |
---|---|
4 | Count of metadata items to follow |
The following is repeated the number of times specified by the count above: | |
4 | Signature of the data |
4 | Key of the data |
1 | Copy on sheet duplication |
3 | Padding |
4 | Length of data to follow |
Variable | Undocumented data |
Layer version (Photoshop 7.0)
Key is 'lyvr' . Data is as follows:
Length | Description |
---|---|
4 | A 32-bit number representing the version of Photoshop needed to read and interpret the layer without data loss. 70 = 7.0, 80 = 8.0, etc. The minimum value is 70, because just having the field present in 6.0 triggers a warning. For the future, Photoshop 7 checks to see whether this number is larger than the current version -- i.e., 70 -- and if so, warns that it is ignoring some data. |
Transparency shapes layer (Photoshop 7.0)
Key is 'tsly' . Data is as follows:
Length | Description |
---|---|
1 | 1: the transparency of the layer is used in determining the shape of the effects. This is the default for behavior like previous versions. 0: treated in the same way as fill opacity including modulating blend modes, rather than acting as strict transparency. Using this feature is useful for achieving effects that otherwise would require complex use of clipping groups. |
3 | Padding |
Layer mask as global mask (Photoshop 7.0)
Key is 'lmgm' . Data is as follows:
Vector mask as global mask (Photoshop 7.0)
Key is 'vmgm' . Data is as follows:
Length | Description |
---|---|
1 | Same as in See Layer mask as global mask, but applying the vector mask. |
3 | Padding |
Brightness and Contrast
Key is 'brit' . Data is as follows:
Length | Description |
---|---|
2 | Brightness |
2 | Contrast |
2 | Mean value for brightness and contrast |
1 | Lab color only |
Channel Mixer
Key is 'mixr' . Data is as follows:
Length | Description |
---|---|
2 | Version ( = 1) |
2 | Monochrome |
20 | RGB or CMYK color plus constant for the mixer settings. 4 * 2 bytes of color with 2 bytes of constant. |
Color Lookup (Photoshop CS6)
Key is 'clrL' . Data is as follows:
Length | Description |
---|---|
2 | Version ( = 1) |
4 | Descriptor Version ( = 16) |
Variable | Descriptor of black and white information |
Placed Layer (replaced by SoLd in Photoshop CS3)
Key is 'plLd' . Data is as follows:
Length | Description |
---|---|
4 | Type ( = `plcL; ) |
4 | Version ( = 3 ) |
Variable | Unique ID as a pascal string |
4 | Page number |
4 | Total pages |
4 | Anit alias policy |
4 | Placed layer type: 0 = unknown, 1 = vector, 2 = raster |
4 * 8 | Transformation: 8 doubles for x,y location of transform points |
4 | Warp version ( = 0 ) |
4 | Warp descriptor version ( = 16 ) |
Variable | Descriptor for warping information |
Linked Layer
Key is 'lnkD' . Also keys 'lnk2' and 'lnk3' . Data is as follows:
Length | Description |
---|---|
8 | Length of the data to follow |
4 | Type ( = `liFD' ) |
4 | Version ( = 2 ) |
Variable | Pascal string. Unique ID. |
Variable | Unicode string of the original file name |
4 | File Type |
4 | File Creator |
8 | Length of the data to follow |
1 | File open descriptor |
Variable | Descriptor of open parameters. Only present when above is true. |
Variable | Raw bytes of the file. |
Photo Filter
Key is 'phfl' . Data is as follows:
Length | Description |
---|---|
2 | Version ( = 3) or ( = 2 ) |
12 | 4 bytes each for XYZ color (Only in Version 3) |
10 | 2 bytes color space followed by 4 * 2 bytes color component (Only in Version 2) |
4 | Density |
1 | Preserve Luminosity |
Black White (Photoshop CS3)
Key is 'blwh' . Data is as follows:
Length | Description |
---|---|
4 | Descriptor Version ( = 16) |
Variable | Descriptor of black and white information |
Content Generator Extra Data (Photoshop CS5)
Key is 'CgEd' . Data is as follows:
Length | Description |
---|---|
4 | Descriptor Version ( = 16) |
Variable | Descriptor of extra data |
Text Engine Data (Photoshop CS3)
Key is 'Txt2' . Data is as follows:
Length | Description |
---|---|
4 | Length of data to follow |
Variable | Raw bytes for text engine |
Vibrance (Photoshop CS3)
Key is 'vibA' . Data is as follows:
Length | Description |
---|---|
4 | Descriptor Version ( = 16) |
Variable | Descriptor of vibrance information |
Unicode Path Name (Photoshop CS6)
Key is 'pths' . Data is as follows:
Length | Description |
---|---|
4 | Descriptor Version ( = 16) |
Variable | Descriptor containing a list of unicode path names |
Animation Effects (Photoshop CS6)
Key is 'anFX' . Data is as follows:
Length | Description |
---|---|
4 | Descriptor Version ( = 16) |
Variable | Descriptor containing animation effects |
Filter Mask (Photoshop CS3)
Key is 'FMsk' . Data is as follows:
Length | Description |
---|---|
10 | Color space |
2 | Opacity |
Placed Layer Data (Photoshop CS3)
Key is 'SoLd' . See also 'PlLd' key. Data is as follows:
Length | Description |
---|---|
4 | Identifier ( = 'soLD' ) |
4 | Version ( = 4 ) |
4 | Descriptor Version ( = 16) |
Variable | Descriptor of placed layer information |
Vector Stroke Data (Photoshop CS6)
Key is 'vscg' . Data is as follows:
Length | Description |
---|---|
4 | Key ( = 'vsk' for Photoshop CS6) |
4 | Version ( = 16 ) |
Variable | Descriptor. Based on the Action file format structure (see See Descriptor structure) |
Using Aligned Rendering (Photoshop CS6)
Key is 'sn2P' . Data is as follows:
Length | Description |
---|---|
4 | Non zero is true for using aligned rendering |
Saving Merged Transparency
Key is 'Mtrn', 'Mt16' or 'Mt32' . There is no data associated with these keys.
User Mask
Key is 'LMsk' .
Length | Description |
---|---|
10 | Color space |
2 | Opacity |
1 | Flag ( = 128 ) |
Exposure
Key is 'expA' .
Length | Description |
---|---|
2 | Version (= 1) |
4 | Exposure |
4 | Offset |
4 | Gamma |
Filter Effects
Key is 'FXid' or 'FEid' .
Length | Description |
---|---|
4 | Version ( =1, 2 or 3) |
8 | Length of data to follow |
The following is repeated for the given length. | |
Variable | Pascal string as identifier |
4 | Version ( = 1 ) |
8 | Length |
16 | Rectangle: top, left, bottom, right |
4 | Depth |
4 | Max channels |
The following is repeated for number of channels + a user mask + a sheet mask. | |
4 | Boolean indicating whether array is written |
8 | Length |
2 | Compression mode of data to follow. |
Variable | Actual data based on compression |
End of repeating for channels | |
1 | Next two items present or not |
2 | Compression mode of data to follow |
Variable | Actual data based on compression |
Image Data Section
Photoshop 파일의 마지막 섹션에는 이미지 픽셀 데이터가 있습니다. 이미지 데이터는 순차적으로 저장됩니다. 모든 red 데이터가 처음에, 그리고 모든 green 데이터, 등. 각각의 면은 패딩 바이트 없이 scan-line 순서대로 저장됩니다.
(역주: Layer Image 와는 다르게, 가장 먼저 RGB 순서의 Line 별 Length(2byte)를 모아놓은 일종의 header 가 있습니다. 이후 RGB 별로 각 Line 의 실제 데이터(RLE)가 이어서 나옵니다.)
Length | Description |
---|---|
2 | 압축 방식: 0 = Raw image data 1 = RLE compressed the image data starts with the byte counts for all the scan lines (rows * channels), with each count stored as a two-byte value. The RLE compressed data follows, with each scan line compressed separately. The RLE compression is the same compression algorithm used by the Macintosh ROM routine PackBits , and the TIFF standard. 2 = ZIP without prediction 3 = ZIP with prediction. |
Variable | The image data. Planar order = RRR GGG BBB, etc. |
Other Document File Formats
Photoshop EPS files
The following summarizes the additional information Photoshop writes when creating EPS files:
Photoshop writes a high-resolution bounding box comment to the EPS file immediately following the traditional EPS bounding box comment. The comment begins with " %%HiResBoundingBox " and is followed by four numbers identical to those given for the bounding box except that they can have fractional components (i.e., a decimal point and digits after it). The traditional bounding box is written as the rounded version of the high resolution bounding box for compatibility.
Photoshop writes its image resources out to a block of data stored as follows:
%BeginPhotoshop: <length> <hex data>
Field | Definition |
---|---|
length | Length of the image resource data. |
hex data | Image resource data in hexadecimal. |
Photoshop includes a comment in the EPS files it writes so that it is able to read them back in again. Third party programs that write pixel-based EPS files may want to include this comment in their EPS files, so Photoshop can read their files.
The comment must follow immediately after the %% comment block at the start of the file. The comment is:
%ImageData: <columns> <rows> <depth> <mode> <pad channels> <block size> <binary/hex> "<data start>"
Field | Definition |
---|---|
columns | Width of the image in pixels. |
rows | Height of the image in pixels. |
depth | Number of bits per channel. Must be 1 or 8. |
mode | Image mode. Bitmap/grayscale = 1; Lab = 2; RGB = 3; CMYK = 4. |
pad channels | Number of other channels store in the file. Ignored when reading. Photoshop uses this to include a grayscale image that is printed on non-color PostScript printers. |
block size | Number of bytes per row per channel. Will be either 1 or formula (below): 1 = Data is interleaved. (columns*depth+7)/8 =Data is stored in line-interleaved format, or there is only one channel. |
binary/ascii | 1 = Data is in binary format. 2 = Data is in hex ascii format. |
data start | Entire PostScript line immediately preceding the image data. This entire line should not occur elsewhere in the PostScript header code, butit may occur at part of a line. |
TIFF files
See TIFF Tags describes the standard TIFF (version 6) tags and tag values that Photoshop is able to read and write. Photoshop reads the first Image File Directory (IFD) and writes one IFD per file.
In addition, Photoshop uses a set of tags that are not defined in the TIFF v6 specification to store specific information. See See Photoshop-specific TIFF Tags.
See See TIFF Files on Mac OS for information about how TIFF files are stored on Macintosh.
See Photoshop TIFF.pdf for additional information about tags 259 and 262.
Photoshop-specific TIFF Tags
Tag | Description |
---|---|
330 | tSubIFD . Documented in the TIFF-PM6.pdf file as a PageMaker extension |
437 | JPEG tables. See Photoshop TIFF.pdf for more information. |
700 | XMP metadata. See http://www.adobe.com/devnet/xmp/ |
33723 | File information (IPTC-NAA record 2: see the documents in the IPTC folder of the Documentation folder). |
34377 | Photoshop image resources (see See Image Resources Section) |
34665 | EXIF IFD pointer. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf |
34675 | ICC Profiles (see the ICC1v42_2006-05.pdf file from the International Color Consortium in the Documentation folder of the Photoshop SDK) |
34853 | EXIF GPS info. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf |
37724 | tImageSourceData . Begins with the null-terminated string " Adobe Photoshop Document Data Block ", (**PSB** " Adobe Photoshop Document Data V0002 "), followed by data of various types. See Photoshop TIFF.pdf for a list . |
50255 | tAnnotations . See See Annotations for details. |
TIFF Files on Mac OS
For cross-platform compatibility, all information in a Macintosh TIFF file is stored in the data fork. For interoperability with other Mac OS applications, however, some information is duplicated in resources stored in the resource fork of the file.
For compatibility with image cataloging applications, the 'pnot' resource id 0 contains references to thumbnail, keywords, and caption information stored in other resources.
The thumbnail picture is stored in a 'PICT' resource, the keywords are stored in 'STR#' resource 128 and the caption text is stored in 'TEXT' resource 128. For more information on the format of these resources see Inside Macintosh: QuickTime Components and the Extensis Fetch Awareness Developer's Toolkit .
All of the data from Photoshop's File Info dialog is stored in 'ANPA' resource 10000.
STR ' resource -16396 contains a string indicating the application that created the TIFF file.
Photoshop also creates 'icl8' -16455 and 'ICN#' -16455 resources containing thumbnail images which are shown in the Mac OS Finder.
Additional File Formats
In addition to documents that the user creates in Adobe Photoshop (discussed in See The Photoshop File Format), there are a number of additional files used by Photoshop to store information about such items as colors, contours, curves, levels and so forth. These are known as load files.
This chapter describes the format of each load file. Some of the files can saved by the user; others are load only, as indicated in the sections.
Each file has a unique file type and file extension associated with it. Photoshop for Macintosh recognizes either, but does not require the use of the extension. In the file dialogs, Photoshop for Windows looks for files with the given file extension automatically; this can be overridden.
Under Mac OS, all information is stored in the data forks of Photoshop's load files. The files are completely interchangable with Windows or any other platform.
Consistent byte ordering is required across platforms when reading and writing load files. Photoshop stores multi-byte values with the high-order bytes first, (big-endian), as on Mac OS., which is the opposite of Windows' standard byte order.. For more information, see "Macintosh and Windows development" in chapter 2 of Photoshop API Guide.pdf .
All values defined as Unicode strings consist of:
A 4-byte length field, representing the number of characters in the string (not bytes).
The string of Unicode values, two bytes per character.
Actions
Actions are accessed by means of the Actions palette. The object effects use the actions mechanism to output information to the PSD file format.
OS | Filetype/extension |
---|---|
Mac OS | 8BAC |
Windows | .ATN |
Each action file comprises an action set . The format of the action file is described in the table below:
Length | Description |
---|---|
4 | Version ( = 16) |
Variable | Unicode string: action set name |
1 | Boolean: true if set is expanded for the Actions palette |
4 | Number of actions in action set |
The following is repeated for each action in the set | |
2 | Index of action |
1 | Boolean: true if Shift key needed for keyboard shortcut |
1 | Boolean: true if Command key needed for keyboard shortcut |
2 | Color index information |
Variable | Unicode string: action name |
1 | Boolean: true if action is expanded in the Actions palette |
4 | Number of items in action |
The following is repeated for each item | |
1 | Boolean: true if action is expanded in the Actions palette |
1 | Boolean: true if action is enabled |
1 | Boolean: true if dialogs should be displayed |
1 | Options for displaying dialogs |
4 | Identifier: 'TEXT' or 'long' |
Variable | Event: if identifier is 'TEXT' ,4 bytes of length followed by the string; if identifier is 'long' , 4 bytes of itemID |
Variable | Dictionary name: 4 bytes of length followed by the string |
4 | -1 if a descriptor follows or 0 for none. |
Variable | Descriptor: see Descriptor structure (See Descriptor structure) for details |
Length | Description |
---|---|
4 | Number of items |
The following is repeated for each item in reference | |
4 | OSType key for type to use: 'prop' = Property 'Clss' = Class 'Enmr' = Enumerated Reference 'rele' = Offset 'Idnt' = Identifier 'indx' = Index 'name' =Name |
Variable | Item type: see the tables below for each possible Reference type |
Length | Description |
---|---|
Variable | Unicode string: name from classID |
Variable | classID: 4 bytes (length), followed either by string or (if length is zero) 4-byte classID |
Variable | KeyID: 4 bytes (length), followed either by string or (if length is zero) 4-byte keyID |
Length | Description |
---|---|
4 | Units the following value is in. One of the following: '#Ang' = angle: base degrees '#Rsl' = density: base per inch '#Rlt' = distance: base 72ppi '#Nne' = none: coerced. '#Prc'= percent: unit value '#Pxl' = pixels: tagged unit value |
8 | Actual value (double) |
Length | Description |
---|---|
8 | Actual value (double) |
Length | Description |
---|---|
Variable | Unicode string: name from classID |
Variable | ClassID: 4 bytes (length), followed either by string or (if length is zero) 4-byte classID |
Length | Description |
---|---|
Variable | String value as Unicode string |
Length | Description |
---|---|
Variable | Unicode string: name from ClassID. |
Variable | ClassID: 4 bytes (length), followed either by string or (if length is zero) 4-byte classID |
Variable | TypeID: 4 bytes (length), followed either by string or (if length is zero) 4-byte typeID |
Variable | enum: 4 bytes (length), followed either by string or (if length is zero) 4-byte enum |
Length | Description |
---|---|
Variable | Unicode string: name from ClassID |
Variable | ClassID: 4 bytes (length), followed either by string or (if length is zero) 4-byte classID |
4 | Value of the offset |
Length | Description |
---|---|
1 | Boolean value |
Length | Description |
---|---|
4 | Length of data to follow |
Variable | FSSpec for Macintosh or a handle to a string to the full path on Windows |
Length | Description |
---|---|
4 | Number of items in the list |
The following is repeated for each item in list | |
4 | OSType key for type to use. See See Descriptor structure for types. |
Variable | See the tables above for each possible type |
Length | Description |
---|---|
4 | Value |
Length | Description |
---|---|
Variable | Type: 4 bytes (length), followed either by string or (if length is zero) 4-byte typeID |
Variable | Enum: 4 bytes (length), followed either by string or (if length is zero) 4-byte enum |
Length | Description |
---|---|
Variable | Value |
Arbitrary Map
Arbitrary Map files are accessed by means of the Curves dialog ( load only ).
OS | Filetype/extension |
---|---|
Mac OS | 8BLT |
Windows | .AMP |
There is no version number written in the file.
The files are an even multiple of 256 bytes long. Each 256 bytes is a lookup table, where:
The first byte of the table corresponds to byte zero of the image.
The last byte of the table corresponds to byte 255 of the image.
A NULL table that has no effect on an image is a linear table of bytes from 0 to 255.
If the file has one table, it is applied to the image's channels according to these priorities:
If the image has a master composite channel, the table is applied to it. If not, then:
If the image has a single active channel, the table is applied to it. If not, then:
If the image has no composite channel and more than one active channel, the table is not applied.
If the file has exactly three tables, it is applied to the image's channels according to these priorities:
The tables are assumed to represent RGB lookups. They are applied to the first three channels in the image, leaving the master composite untouched. Or:
If the image has a single active channel, the tables are converted to grayscale and the result is applied to the active channel. Or:
The first table is treated as a master. The remaining tables are applied to the image channels in turn (second table is applied to first channel, third table is applied to second channel, etc.).
Single active channels
Photoshop handles single active channels in a special fashion. When saving a map applied to a single channel, only one table is written to the file. Similarly, when reading a file for application to a single active channel, the master table is the one that will be used on that channel. This allows easy application of a single file to both composite and grayscale images.
CMYK Setup
CMYK settings files are accessed in Photoshop's Color Settings dialog (load only) .
OS | Filetype/extension |
---|---|
Mac OS | 8BIC |
Windows | .API |
Length | Description |
---|---|
2 | Version ( = 7) |
27*2 | Nine sets of three short integers specifying th\e xyY (CIE) values for the inks and their combinations. The inks are specified in the order cyan, magenta, yellow, magenta-yellow (red), cyan-yellow (green), cyan-magenta (blue), cyan-magenta-yellow, followed by the white and black points. Each set is written in the order xyY where: x = 0...10000, representing 0.0...1.0000. y = 1...10000, representing 0.0001...1.0000. Y = 0...20000, representing 0.00...200.00. |
2 | Dot gain. Short integer from -10...40, representing -10%...40%. |
1 | Use curves. = 1 if curves table present. |
1 | Filler: zero |
13*4*2 | Only present if "use curves" = 1. 4 sets of 13 short integers specifyting the cyan, magenta, yellow, and black curve percentages from the Dot Gain Curves dialog. 0...1000, representing 0.0...100.0 % |
Variable | Separation setup: see See Separation file format |
Length | Description |
---|---|
2 | Version ( = 300) |
2 | Separation type. 0 = UCR separations; 1 = GCR separations |
2 | Blank ink limit (0...100) |
2 | Total ink limit (200...400) |
2 | Undercolor addition for GCR separations (0...100) |
Variable | Black generation (spline) curve detailed in See Black generation curve data structure. See also the Curves data format in See Curves file format. |
Color Books
Color book files (Photoshop 7.0) are automatically loaded by Photoshop; they cannot be saved or loaded via a menu item. You can place custom color books into thePresets\Color Books folder. Use the Custom button on the Adobe color picker to access them.
OS | Filetype/extension |
---|---|
Mac OS | 8BCB |
Windows | .ACB |
Length | Description |
---|---|
4 | Signature: 8BCB |
2 | Version ( =1 ) |
2 | Book ID. Existing IDs: 3000 (ANPA), 3001 (Focoltone), 3002 (PantoneCoated), 3003 (PantoneProcess), 3004 (PantoneProSlim), 3005 (PantoneUncoated), 3006 (Toyo), 3007 (Trumatch), 3008 (HKSE), 3009 (HKSK), 3010 (HKSN), 3011 (HKSZ), 3012 (DIC), 3020 (PantonePastelCoated), 3021 (PantonePastelUncoated), 3022 (PantoneMetallic) |
Variable | Unicode string: title |
Variable | Unicode string: prefix |
Variable | Unicode string: postfix |
Variable | Unicode string: description |
2 | Number of colors (<= 8000) |
2 | Colors per page (<= 9) |
2 | Key color page; must be less than or equal to colers per page |
2 | Color type. 0 = RGB; 2 = CMYK; 7 = Lab |
The following are repeated for the number of colors | |
Variable | Unicode string: name |
6 | Unique key for the color |
4 | Color values: 4 bytes for CMYK; 3 bytes for RGB and Lab |
Color Table
Color Table files are accessed using the Colors palette (load only) .
OS | Filetype/extension |
---|---|
Mac OS | 8BCT |
Windows | .ACT |
There is no version number written in the file. The file is exactly 76
long, and contains 256 RGB colors:
The first color in the table is index zero.
There are three bytes per color in the order Red, Green, Blue.
If loaded into the Colors palette, the colors will be installed in the color swatch list as RGB colors.
Color Swatches
Color swatch files are loaded and saved in Photoshop's Color Swatches palette. These are typically stored in the Color Swatches sub-directory in the Presetsdirectory.
OS | Filetype/extension |
---|---|
Mac OS | 8BCO |
Windows | .ACO |
Length | Description |
---|---|
2 | Version ( =1 ) |
2 | Count of colors in the file. |
count *10 | Colors. Each color is 10 bytes, as described in See Color structure. |
At the end of a version 1 file is the version 2 information. | |
2 | Version ( = 2 ) |
2 | Count of colors in the file. The next two fields are repeated for each count. |
count *10 | Colors. Each color is 10 bytes, as described in See Color structure. |
Variable | Unicode string: color name. |
Length | Description |
---|---|
2 | The color space the color belongs to (see See Color space IDs). |
8 | Four short unsigned integers with the actual color data. If the color does not require four values, the extra values are undefined and should be written as zeros. See See Color space IDs. |
Photoshop allows the specification of custom colors, such as those colors that are defined in a set of custom inks provided by a printing ink manufacturer. These colors can be stored in the Colors palette and streamed to and from load files. The details of a custom color's color data fields are not public and should be treated as a black box.
See Custom color spaces gives the color space IDs currently defined by Photoshop for some custom color spaces.
Color ID | Name |
---|---|
3 | Pantone matching system |
4 | Focoltone colour system |
5 | Trumatch color |
6 | Toyo 88 colorfinder 1050 |
10 | HKS colors |
Contours
Contour settings files (Photoshop 6.0) are loaded and saved in Photoshop's Layer Effects dialog.
OS | Filetype/extension |
---|---|
Mac OS | 8BFS |
Windows | .SHC |
Length | Description |
---|---|
4 | Type ( = '8BFS' ) |
2 | Version ( = 1 ) |
4 | Count of contours |
The following is repeated for each contour | |
4 | Version ( = 1 or 2) |
Variable | Unicode string: contour name |
Variable | version 1 or 2 data follows. See See Contours Version 1 for version 1 and See Contours Version 2 for version 2. |
Curves
Curves settings files are loaded in Photoshop's Curves dialog and Black Generation curve dialog (from within Separation Setup Preferences). Curves files can also be loaded into any of Photoshop's transfer function dialogs, such as the Duotone Curve dialog from within Duotone Options, and Print transfer dialog. Curves are saved as.ATF and .ACV files.
When loaded into a transfer function dialog, only the first curve in a Curves file is used.
OS | Filetype/extension |
---|---|
Mac OS | 8BSC |
Windows | .CRV |
Length | Description |
---|---|
2 | Version ( = 1 or = 4) |
2 | Count of curves in the file. |
The following is the data for each curve specified by count above | |
2 | Count of points in the curve (short integer from 2...19) |
point count * 4 | Curve points. Each curve point is a pair of short integers where the first number is the output value (vertical coordinate on the Curves dialog graph) and the second is the input value. All coordinates have range 0 to 255. See also See Null curves below. |
A NULL curve (no change to image data) is represented by the following five-number, ten-byte sequence in a file:
2 0 0 255 255
Displaying ink percentages
Photoshop allows the option of displaying ink percentages instead of pixel values; this is a display option only and the internal data is unchanged, with 100% ink equal to image data of 0 and 0% ink equal to image data of 255.
Curves data order
The first curve is a master curve that applies to all the composite channels (RGB) when in composite image mode.
The remaining curves apply to the active channels in order: curve two applies to channel one, curve three applies to channel two, etc., up until curve 17, which applies to channel 16.
Indexed color
The exception to the normal order, and the reason there are up to 19 curves, is when the mode is Indexed color. In this case:
The first curve is a master curve.
The next three curves are created for the Red, Green, and Blue portions of the image's color table, and they are applied to the first channel.
The remaining curves apply to any remaining alpha channel that is active: for instance, if channel two is active, curve five applies to it; if channel three is active, curve six applies to it, etc., up until curve 19, which applies to channel 16.
Single active channels
Photoshop handles single active channels in a special fashion. When saving the curves applied to a single channel, the settings are stored into the master curve, at the beginning of the file. Similarly, when reading a curves file for application to a single active channel, the master curve is the one that will be used on that channel. This allows easy application of a single file to both RGB and grayscale images.
Additional information
At the end of the Version 1 file is the following information:
Extra level record info marker 'Crv '
Length | Description |
---|---|
4 | = 'Crv ' for extra curve information |
2 | Version ( = 4) |
2 | Count of items to follow. |
The following is the data for each curve specified by count above | |
2 | Before each curve is a channel index. |
2 | Count of points in the curve (short integer from 2...19) |
point count * 4 | Curve points. Each curve point is a pair of short integers where the first number is the output value (vertical coordinate on the Curves dialog graph) and the second is the input value. All coordinates have range 0 to 255. See also See Null curves below. |
Custom Kernel
Kernel settings files are loaded and saved in Photoshop's Custom Filter dialog. .
OS | Filetype/extension |
---|---|
Mac OS | 8BCK |
Windows | .ACF |
Length | Description |
---|---|
50 | Weights. The first 25 values are the custom weights from -999...999, applied to pixels offset from each pixel by [-2,-2] to [2,2]. The values progress through horizontal offsets first, as follows: {[-2,-2],[-1,-2],[ 0,-2],[ 1,-2],[ 2,-2], [-2,-1],[-1,-1],[ 0,-1],[ 1,-1],[ 2,-1], [-2, 0],[-1, 0],[ 0, 0],[ 1, 0],[ 2, 0], [-2, 1],[-1, 1],[ 0, 1],[ 1, 1],[ 2, 1], [-2, 2],[-1, 2],[ 0, 2],[ 1, 2],[ 2, 2]} |
27*2 | Ink colors. Nine sets of three short integers specifying the xyY (CIE) values for the inks and their combinations. The inks are specified in the order cyan, magenta, yellow, magenta-yellow (red), cyan-yellow (green), cyan-magenta (blue), cyan-magenta-yellow, followed by the white and black points. Each set is written in the order xyY where: x = 0...10000, representing 0.0...1.0000. y = 1...10000, representing 0.0001...1.0000. Y = 0...20000, representing 0.00...200.00. |
2 | Scale. Short integer from 1...9999. |
2 | Offset. Short integer from -9999...9999. |
Duotone Options
Duotone settings files are loaded and saved in the Duotone Options dialog..
OS | Filetype/extension |
---|---|
Mac OS | 8BDT |
Windows | .ADO |
Length | Description |
---|---|
2 | Version ( = 1) |
2 | Count . Number of plates in duotone spec (short integer). 1 = Monotone; 2 = Duotone; 3 = Tritone; 4 = Quadtone. |
4*10 | Four ink colors, regardless of the number of plates. The contents of the colors beyond the last plate specified by Count are undefined. Each color is 10 bytes and described in See Duotone color structure. It is identical to the format in a Colors load file. |
4*64 | Four ink names, regardless of the number of plates. Each name is streamed as a Pascal-style string with a length byte followed by the string name. Names may not be more than 63 characters. Each name is padded to occupy 64 bytes, including the length byte. Any names beyond the last plate specified byCount should be empty, size = 0. |
4*28 | Four ink curves, regardless of the number of plates. Described in See Ink curves structure. |
2 | Dot gain ( = 20). Kept for compatability with Photoshop 2.0. Ignored. |
11*10 | Eleven overprint colorscolors, regardless of the number of plates. The number of defined overprints depends on Count . Monotones = no overprint colors. Duotones = one overprint color. Tritones = four overprint colors. Quadtones = 11 overprint colors. The contents of the colors beyond the last defined overprint are undefined. Each color is 10 bytes and described in See Duotone color structure. It is identical to the format in a Colors load file. |
Length | Description |
---|---|
2 | The color space the color belongs to (see See Color space IDs). |
8 | Four short unsigned integers with the actual color data. If the color does not require four values to specify, the extra values are undefined and should be written as zeros. |
Halftone Screens
Halftone Screens settings files are loaded and saved in Photoshop's Halftone Screens dialog (available from Edit > Print with Preview in Photoshop 7, or Page Setup orPrint Options in previous versions).
OS | Filetype/extension |
---|---|
Mac OS | 8BHS |
Windows | .AHS |
Length | Description |
---|---|
2 | Version ( = 5) |
4*18 | Four screen descriptions. See See Halftone screen parameter structure. |
Variable | For every screen that has a custom spot function, the PostScript function text is written here, one after the other, with no header information, in the same order as the screen settings. The size of each custom spot is the absolute value of its negative shape code. |
Length | Description |
---|---|
4 | Ink's screen frequency, in lines per inch. Binary fixed point value ;16 bits representing the integer and fractional parts from 1.0...999.999. |
2 | Units for the screen frequency. Lines per inch = 1; lines per centimeter = 2. Only affects display, not screen frequency. |
4 | Angle for screen. Binary fixed point value with 16 bits representing the integer and fractional parts from -180.0000 ... 180.0000, measured in degrees. |
2 | Code representing the shape of the halftone dots. 0 = Round; 1 = Ellipse; 2 = Line; 3 = Square; 4 = Cross; 6 = Diamond. Negative numbers represent custom shapes; the absolute value is the size in bytes of the custom spot function described in See Halftone screens file format. |
4 | = 0. Not currently used by Photoshop. |
1 | Boolean. 1 = Use accurate screens; 0 = Use other. |
1 | Boolean. 1 = Use printer's default screens; 0 = Use other. |
Hue/Saturation
Hue/Saturation settings files are loaded and saved in Photoshop's Hue/Saturation dialog /
OS | Filetype/extension |
---|---|
Mac OS | 8BHA |
Windows | .AHV |
Length | Description |
---|---|
2 | Version ( = 2) |
1 | 0 = Use settings for hue-adjustment; 1 = Use settings for colorization. |
1 | Padding byte; must be present but is ignored by Photoshop. |
6 | Colorization. Photoshop 5.0: The actual values are stored for the new version. Hue is -180...180, Saturation is 0...100, and Lightness is -100...100. Photoshop 4.0: Three short integers Hue, Saturation, and Lightness from -100...100. The user interface represents hue as -180...180, saturation as 0...100, and Lightness as -100...1000, as the traditional HSB color wheel, with red = 0. |
6 | Master hue, saturation and lightness values. |
6 sets of the following 14 bytes (4 range values followed by 3 settings values) | |
8: range values | For RGB and CMYK, those values apply to each of the six hextants in the HSB color wheel: those image pixels nearest to red, yellow, green, cyan, blue, or magenta. These numbers appear in the user interface from -60...60, however the slider will reflect each of the possible 201 values from -100...100. For Lab, the first four of the six values are applied to image pixels in the four Lab color quadrants, yellow, green, blue, and magenta. The other two values are ignored ( = 0). The values appear in the user interface from -90 to 90. |
6:settings values |
Levels
Levels settings files are loaded and saved in the Levels dialog.
OS | Filetype/extension |
---|---|
Mac OS | 8BLS |
Windows | .ALV |
Length | Description |
---|---|
2 | Version ( = 2) |
29 * 10 | 29 sets of level records, each level containing 5 short integers (see See Level record structure). |
Level record sets order
The first set of levels is the master set that applies to all of the composite channels (RGB) when in composite image mode.
The remaining sets apply to the active channels individually; set two applies to channel one, the set three to channel two, etc., up until set 25, which applies to channel 24.
Sets 28 and 29 are reserved and should be set to zeros.
Indexed color
The exception to the normal order is when the mode is Indexed:
The first set is a master set.
The next three sets are created for the Red, Green, and Blue portions of the image's color table, and they are applied to the first channel.
The remaining sets apply to any remaining alpha channels that are active: for instance, if channel two is active, set five applies to it; if channel three is active, set six applies to it, etc., up until channel 27, which applies to channel 24.
Sets 28 and 29 are reserved and should be set to zeros.
Single active channels
Photoshop handles single active channels in a special fashion. When saving the levels applied to a single channel, the settings are stored into the master set, at the beginning of the file. Similarly, when reading a levels file for application to a single active channel, the master levels are the ones that will be used on that channel. This allows easy application of a single file to both RGB and grayscale images.
Photoshop CS (8.0) Additional information
At the end of the Version 2 file is the following information:
Extra level record info marker 'Lvls'
Length | Description |
---|---|
4 | = 'Lvls' for extra level information |
2 | Version ( = 3) |
2 | Count of total level record structures. Subtract the legacy number of level record structures, 29, to determine how many are remaining in the file for reading. |
Variable | Additianol level records according to count. See Level record structure |
Monitor Setup
This format has been superseded by ICC profiles. See ICC1v42_2006-05.pdf for details.
Monitor settings files are accessed in Photoshop's Color Settings dialog, via the Edit menu (load only) .
OS | Filetype/extension |
---|---|
Mac OS | 8BMS |
Windows | .AMS |
Length | Description |
---|---|
2 | Version ( = 2.) |
2 | Gamma. Short integer from 75...300 representing 0.75...3.00. |
2*2 | White point. Two short integers as CIE chromaticity coordinates: x,y . x = 0...10000 representing 0.0...1.0000. y = 1...10000 representing 0.0001...1.0000. |
6*2 | Phosphors. Three sets of two integers giving x,y coordinates of the red, green, and blue phosphors. x = 0...10000 representing 0.0...1.0000. y = 1...10000 representing 0.0001...1.0000. In the order red x , red y ; green x , green y ; blue x , blue y . |
Replace Color/Color Range
Replace Color settings files are loaded and saved in the Color Range dialog (available via the Select menu).
OS | Filetype/extension |
---|---|
Mac OS | 8BXT |
Windows | .AXT |
Length | Description |
---|---|
2 | Version ( = 1) |
2 | Short integer indicating what space the color components are in. 7 = Lab color, 8 = grayscale. No other values are supported. |
6 | Component ranges. Six unsigned byte values representing the range of colors within which a pixel's color must fall to be considered selected for color replacement, or color range selecting. Described in See Component range structure. |
2 | Fuzziness. Short integer from 0...200 controlling how colors close to selected colors are affected. |
6 | Transform settings. When used with Replace Color: Three short integers from -100...100. Described in See Replace color transform settings. When used with Color Range: Writes zeros into the three short integers and ignores. |
Length | Description |
---|---|
2 | Hue change. Short integer from -100...100. |
2 | Saturation change. Short integer from -100...100. |
2 | Lightness change Short integer from -100...100. . |
Selective Color
Selective Color settings files are loaded and saved in Photoshop's Selective Color dialog.
OS | Filetype/extension |
---|---|
Mac OS | 8BSV |
Windows | .ASV |
Length | Description |
---|---|
2 | Version ( = 1) |
2 | Correction method.. 0 = Apply color correction in relative mode; 1 = Apply color correction in absolute mode. |
80 | Ten eight-byte plate correction records, described in See Plate correction structure. The first record is ignored by Photoshop and is reserved for future use. It should be set to all zeroes. The rest of the records apply to specific areas of colors or lightness values in the image, in the following order: reds, yellows, greens, cyans, blues, magentas, whites, neutrals, blacks. |
Separation Tables
This format has been superseded by ICC profiles. See ICC1v42_2006-05.pdf for details.
Separation Table files are accessed in the Separation Tables dialog (load only) .
OS | Filetype/extension |
---|---|
Mac OS | 8BST |
Windows | .AST |
Format:
If the size of the file is 33 * 33 * 33 * 4 , then the file consists only of a
Lab->CMYK table as currently documented.
If the size of the file is ( 33 * 33 * 33 + 256 ) * 3 , then the file consists only of a CMYK->Lab table as currently documented.
Otherwise, the file has the format listed in See Separation table file format.
Length | Description |
---|---|
2 | Version ( = 300) |
1 | Boolean. True if contains Lab->CMYK table. |
1 | Boolean. True if contains CMYK->Lab table. |
33*33*33*4 | If file contains Lab->CMYK table, this section contains CMYK colors for 33*33*33 Lab colors. The CMYK colors are written in interleaved order, one byte each ink. 0 = 100%, 255 = 0%. See See Generating Lab source colors below. |
(33*33*33 +256)*3 | If file contains CMYK->Lab table, this section contains Lab colors for 33*33*33+256 CMYK colors. The Lab colors are written in interleaved order, one byte per component. See See Generating CMYK source colors below. |
1 | Boolean. True if gamut table follows. |
1 | If entry above is false , this byte will not be present. If true, this byte should be set to 1 for compatibility. |
(((33*33*33L)+7)>>3) if gamut table present, zero otherwise | Gamut table, if present. The gamut table is a bit table indexed in the same way as the Lab->CMYK table with the high bit of the first byte at index 0. See See Testing for bits in the gamut table below. |
The Lab colors that are the source colors can be generated from the Lab->CMYK table with the following routine:
for (i = 0; i < 33; i++)
for (j = 0; j < 33; j++)
for (n = 0; n < 33; n++)
{
L = Min (i * 8, 255);
a = Min (j * 8, 255);
b = Min (n * 8, 255);
}
The CMYK colors that are the source colors can be generated from the CMYK->Lab table with the following routine:
for (i = 0; i < 33; i++)
for (j = 0; j < 33; j++)
for (n = 0; n < 33; n++)
{
c = Min (i * 8, 255);
m = Min (j * 8, 255);
y = Min (n * 8, 255);
k = 255;
}
for (i = 0; i < 256; i++)
{
c = 255;
m = 255;
y = 255;
k = i;
}
Testing for bits in the gamut table
To test the bit at bitIndex , use table:
([bitIndex >> 3] & (0x0080 >> (bitIndex & 0x07))) != 0.
bitIndex itself is calculated in the same way you would calculate an index into the Lab->CMYK table.
A result of 1 indicates that the color is in gamut and 0 indicates that it is out of gamut.
Transfer Function
Transfer Function settings files are accessed (load only) in Photoshop's Duotone Curve dialog from within Duotone Options and Transfer Function dialogs (available from Edit > Print with Preview in Photoshop 7, or Page Setup or Print Options in previous versions).Transfer Function files can also be loaded into any of Photoshop's curves dialogs, such as the Curves color adjustment dialog.
OS | Filetype/extension |
---|---|
Mac OS | 8BTF |
Windows | .ATF |
Length | Description |
---|---|
2 | Version ( = 4) |
112 (= 28*4) | Four transfer functions , described in See Transfer function structure. The file always contains four functions. When writing the printer transfer functions for grayscale images, for instance, Photoshop writes four copies of the single transfer function specified in the user interface. |
'개발관련 > Specification' 카테고리의 다른 글
wav 파일 헤더구조 (29) | 2012.09.14 |
---|
RECENT COMMENT