Use Cases for Aspose.PSD FOSS for Java
Overview
Aspose.PSD FOSS for Java loads, inspects and saves PSD and PSB files. These are the jobs it fits, and the jobs it does not.
Read and Catalog Design Files
Load each file with PsdImage.load and read the width, height, color mode, bit depth and layer count. A file with an invalid signature or header, or one that is cut off before the end of its image resources or layer sections, gives a PsdLoadException from load(InputStream) (load(String) wraps it in a RuntimeException) with a message that says what is wrong, so a batch job can report those files and carry on. The loader does not check the merged image data at the end of a file, so it does not detect a file that is cut off or damaged only there.
Audit Layer Structure
Read getName(), isVisible(), getOpacity() and getBlendModeKey() of every layer to produce a report for a design review, or to find hidden layers and layers with reduced opacity.
Change Layer Metadata in Batch
Rename layers, hide or show them, or set their opacity across many files, then save each file. Layer pixel data is not changed, and a document saved without changes is written back identically in the library’s tests. Layer names are saved as ASCII, and saving an edited document rewrites every layer name, so this suits files whose layer names are ASCII.
Check Files in a Build or Test Pipeline
The library is a plain Java dependency with no native code and no Photoshop, and its tests ran on Java 11, 17 and 21. It runs on a server or in a build job. Indexed-color documents need the java.desktop module.
What It Is Not For
- Rendering a PSD to an image or exporting it to PNG or JPEG.
- Decoding or editing pixels.
- Adding, removing or reordering layers.
Use another library for those jobs.