---
Product: psd
Platform: java
Page Type: kb
Canonical URL: https://kb.aspose.org/psd/java/how-to-work-with-resources-java
Last Updated: 2026-11-19
---

# How to Read Image Resources of a PSD Document in Java

Read the image resource blocks of a PSD or PSB document with PsdImage.getImageResources in Aspose.PSD FOSS for Java.

This guide shows how to read the image resource blocks of a document. The resource blocks are read-only data in this edition.

## Step-by-Step Guide

### Step 1: Add the Library

```xml
<dependency>
  <groupId>org.aspose</groupId>
  <artifactId>aspose-psd-foss</artifactId>
  <version>26.11.0</version>
</dependency>
```

---

### Step 2: Load the Document

Load the file with `PsdImage.load(String)`.

---

### Step 3: Get the Resource Blocks

Call `getImageResources()`. It returns an array of `ResourceBlock`. On the library's test files it returns 26 blocks for `basic-rgb.psd` and 28 for `resources.psd`.

---

### Step 4: Read a Block

Each `ResourceBlock` has `getId()`, `getName()`, `getSignature()`, `getSize()` and `getDataSize()`. The ids are the identifiers that the PSD format defines for image resources.

## Things to Know

- `PsdImage.setImageResources` is not supported and always throws `UnsupportedOperationException`; you cannot replace the resource blocks of a document.
- The other resource classes (`UnknownResource`, `PsdResourceInfo`, `PsdResourceKind`, `IndexedColorPalette`) are building blocks that the loader and writer use.

## See Also

- [Resources in the documentation](https://docs.aspose.org/psd/java/developer-guide/resources/)
- [ResourceBlock reference](https://reference.aspose.org/psd/java/resourceblock/)
- [Aspose.PSD for Java — Enterprise Knowledge Base](https://kb.aspose.com/psd/java/)