Class PSDImageReader


  • public final class PSDImageReader
    extends java.lang.Object
    Minimal reader for PSD format image files. The individual layers are made available as ImageLayer objects.
    See Also:
    PSD specification
    • Constructor Detail

      • PSDImageReader

        public PSDImageReader​(java.io.File input)
                       throws java.io.IOException
        Reads a PSD image from a file.
        Parameters:
        input - the non-null file to read
        Throws:
        java.io.IOException - if an error occurs while reading the image
    • Method Detail

      • getColorMode

        public PSDImageReader.ColorMode getColorMode()
        Returns the color mode used by the image file. This has no impact on the format of decoded images returned by this class, which are always 8-bit RGB.
        Returns:
        the color mode used by the file
      • getLayerCount

        public int getLayerCount()
        Returns the number of layers read from the image file.
        Returns:
        the number of layers in the image
      • getLayer

        public ImageLayer getLayer​(int index)
        Returns the layer at the requested index. The layer's index also indicates its Z-ordering in the layer stack. Higher indices are painted overtop of lower indices.
        Parameters:
        index - the 0-based index of the layer
        Returns:
        the layer at the requested index
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 or index >= getLayerCount()
      • createComposite

        public java.awt.image.BufferedImage createComposite()
        Returns a composite image of all of the layers.
        Returns:
        an image representing a composite view of the image layers