Class PsdFile | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class PsdFile

    Inheritance
    System.Object
    PsdFile
    Namespace: PhotoshopFile
    Syntax
    public class PsdFile

    Constructors

    PsdFile(PsdFileVersion)

    Declaration
    public PsdFile(PsdFileVersion version = PsdFileVersion.Psd)
    Parameters
    Type Name Description
    PsdFileVersion version

    PsdFile(Stream, LoadContext, ELoadFlag)

    Declaration
    public PsdFile(Stream stream, LoadContext loadContext, ELoadFlag loadFlag = ELoadFlag.Header | ELoadFlag.ColorMode | ELoadFlag.ImageData | ELoadFlag.All)
    Parameters
    Type Name Description
    System.IO.Stream stream
    LoadContext loadContext
    ELoadFlag loadFlag

    PsdFile(String, LoadContext, ELoadFlag)

    Declaration
    public PsdFile(string filename, LoadContext loadContext, ELoadFlag loadFlag = ELoadFlag.Header | ELoadFlag.ColorMode | ELoadFlag.ImageData | ELoadFlag.All)
    Parameters
    Type Name Description
    System.String filename
    LoadContext loadContext
    ELoadFlag loadFlag

    Fields

    ColorModeData

    If ColorMode is ColorModes.Indexed, the following 768 bytes will contain a 256-color palette. If the ColorMode is ColorModes.Duotone, the data following presumably consists of screen parameters and other related information. Unfortunately, it is intentionally not documented by Adobe, and non-Photoshop readers are advised to treat duotone images as gray-scale images.

    Declaration
    public byte[] ColorModeData
    Field Value
    Type Description
    System.Byte[]

    Properties

    AbsoluteAlpha

    Declaration
    public bool AbsoluteAlpha { get; set; }
    Property Value
    Type Description
    System.Boolean

    AdditionalInfo

    Declaration
    public List<LayerInfo> AdditionalInfo { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<LayerInfo>

    BaseLayer

    Represents the composite image.

    Declaration
    public Layer BaseLayer { get; set; }
    Property Value
    Type Description
    Layer

    BitDepth

    The number of bits per channel. Supported values are 1, 8, 16, and 32.

    Declaration
    public int BitDepth { get; set; }
    Property Value
    Type Description
    System.Int32

    ChannelCount

    The number of channels in the image, including any alpha channels.

    Declaration
    public short ChannelCount { get; set; }
    Property Value
    Type Description
    System.Int16

    ColorMode

    The color mode of the file.

    Declaration
    public PsdColorMode ColorMode { get; set; }
    Property Value
    Type Description
    PsdColorMode

    ColumnCount

    The width of the image in pixels.

    Declaration
    public int ColumnCount { get; set; }
    Property Value
    Type Description
    System.Int32

    globalLayerMaskData

    Declaration
    public byte[] globalLayerMaskData { get; }
    Property Value
    Type Description
    System.Byte[]

    ImageCompression

    Declaration
    public ImageCompression ImageCompression { get; set; }
    Property Value
    Type Description
    ImageCompression

    ImageResources

    The Image resource blocks for the file

    Declaration
    public ImageResources ImageResources { get; set; }
    Property Value
    Type Description
    ImageResources

    IsLargeDocument

    Declaration
    public bool IsLargeDocument { get; }
    Property Value
    Type Description
    System.Boolean

    Layers

    Declaration
    public List<Layer> Layers { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<Layer>

    Resolution

    Declaration
    public ResolutionInfo Resolution { get; set; }
    Property Value
    Type Description
    ResolutionInfo

    RowCount

    The height of the image in pixels.

    Declaration
    public int RowCount { get; set; }
    Property Value
    Type Description
    System.Int32

    Version

    Photoshop file format version.

    Declaration
    public PsdFileVersion Version { get; }
    Property Value
    Type Description
    PsdFileVersion

    Methods

    PrepareSave()

    Check the validity of the PSD file and generate necessary data.

    Declaration
    public void PrepareSave()

    Save(Stream, Encoding)

    Declaration
    public void Save(Stream stream, Encoding encoding)
    Parameters
    Type Name Description
    System.IO.Stream stream
    System.Text.Encoding encoding

    Save(String, Encoding)

    Declaration
    public void Save(string fileName, Encoding encoding)
    Parameters
    Type Name Description
    System.String fileName
    System.Text.Encoding encoding

    SetVersionInfo()

    Set the VersionInfo resource on the file.

    Declaration
    public void SetVersionInfo()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023