ImageGear .NET - Updated
PSD
User Guide > File Formats and Compressions > File Formats > File Formats Reference > PSD

Full Name PSD (Adobe Photoshop)
Format ID ImGearFormats.PSD
File Extension(s) *.psd
Data Type Raster Image
Data Encoding Binary
Multi-Page Support No
Alpha Channel Support Supports pre-multiplied Alpha and additional Alpha mask channels as ImageGear Extra channels.
Metadata Update Support Page
ImageGear Platforms Support WIN32, WIN64, Unix, .NET, .NET64, .NET Compact Framework

ImageGear Supported Versions

ImageGear Supported Features

ImageGear Read Support

ImageGear Write Support

ImageGear Filter Control Parameters

Filter Control Parameter Type Default Value Available Values Description
LoadFirstExtraChannelAsAlpha bool false false, true This parameter specifies how ImageGear should load the first extra channel of a PSD image. If false , ImageGear loads all extra channels according to their descriptors in the file header. If the channel contains transparency information, ImageGear loads it as Alpha channel. Otherwise IG loads it as Extra channel.

If true, IG loads first extra channel as Alpha channel. This mode provides backward compatibility with previous versions of ImageGear.
ReadLayerIndex int -1 Any integer, but no more than number of layers When > -1 specifies a zero based index of layer mask image to load, otherwise reads the composition image.

Non-Image Data Structure

Adobe PSD file format has different non-image data that can be stored before and after an image data. The Adobe PSD metadata design allows reading and writing the following non-image data (exactly like in System.Windows.Media.Imaging.BitmapMetadata; strings by default):

Tag Name Tag ID Description
Signature ImGearPSDTagIDs.SIGNATURE Adobe Photoshop Signature: always equal to '8BPS'.
Version ImGearPSDTagIDs.VERSION Version: always equal to 1.
Rows ImGearPSDTagIDs.ROWS The height of the image in pixels. Supported range is 1 to 30,000.
Cols ImGearPSDTagIDs.COLS The width of the image in pixels. Supported range is 1 to 30,000.
Depth ImGearPSDTagIDs.DEPTH Depth: the number of bits per channel. Supported values are 1, 8, and 16.
ColorMode ImGearPSDTagIDs.MODE The color mode of the file. Supported values are: Bitmap = 0; Grayscale = 1; Indexed = 2; RGB = 3; CMYK = 4; Multichannel = 7; Duotone = 8; Lab = 9.
ColorModeLength ImGearPSDTagIDs.MODE_LEN The length of the following color data provided by tag ColorData.
ColorData ImGearPSDTagIDs.COLOR_DATA The color data.
PhotoshopResources ImGearPSDTagIDs.PHOTOSHOP_RESOURCES Photoshop Image Resource metadata group. Image resources are used to store non-pixel data associated with images.
Layers ImGearPSDTagIDs.LAYERS Photoshop Image Layer Info metadata group. Represents high-level organization of the layers information.
LayerCount ImGearPSDTagIDs.LAYER_COUNT Number of layers in the Photoshop Image.
Header ImGearPSDTagIDs.HEADER This section contains the basic properties of the image.
RESERVED_HDR ImGearPSDTagIDs.RESERVED_HDR Reserved: must be zero.
Channels ImGearPSDTagIDs.CHANNELS The number of channels in the image, including any alpha channels. Supported range is 1 to 56.
IPTC_NAA ImGearPSDTagIDs.IPTC_NAA File information (IPTC-NAA record 2).

Comments

The PSD file is considered by many in the computer graphics arts community as an industry standard.

The PSD is organized into 5 major segments of data: the header, 3 informational blocks, and the bitmap data. The short header always contains a "signature" of 8PPS, as well as these fields: width, height, and bit depth of the bitmap.

The first block of informational data is called the "Color Mode Data Block". It begins with a value for the length of the block. If the image has a palette, it is located here.

The next block is called the "Image Resources Block". Like the previous block, it first gives the length of the block. An ID field is filled with one of many possible values that indicate the structure where the data is stored. It may contain such parameters as resolution.

The last informational block is called the "Layer and Mask Instruction Block". After a value for the length of the block, it tells how many "layer records" follow. There is a record for each layer in the image. Each record begins with a channel ID and the length of the data in the record. After the records, a "Layer Mask" section may be stored, if applicable.

The bitmap data represents the last segment of a PSD file.

References Used

Murray, James D. and William vanRyper. Encyclopedia of Graphics File Formats, 2d ed. Sebastopol, CA: OaReilly & Associates, Inc., 1996.