Zain Zain is a Java developer. His is a knowledge seeker who likes to try out and explore new things.

How to read PSD images in Java

54 sec read

In our ongoing series about reading and writing image files in Java we move our focus onto how we can read PSD images in Java.

What is PSD?

Photoshop filesPSD (Photoshop Document) is a format used by the popular Adobe Photoshop. The software which has its own format is used by many people for graphic designing and image editing. It uses the extension ‘.psd’.

A PSD file contains multiple objects including images, shapes, text, filters and other objects often used in graphic designing/editing. This allows Photoshop users to save, transfer and make further changes to their work in the future.

There are not many libraries out there that can read PSD images. Our JDeli Image library can read and write a very wide range of image formats, including PSD.

How to read PSD images in Java?

Below you will find an example of how to read PSD files using Java through JDeli.

JDeli:

//Read Image (can also be OutputStream or byte array)
File psdFile = new File("psdImage.psd"); 
BufferedImage image = JDeli.read(psdFile);

Or you can use the JDeli PsdDecoder directly:

PsdDecoder decoder = new PsdDecoder();
BufferedImage image = decoder.read(rawImageBytes);

Javadoc and Download

Why use JDeli?

JDeli offers a range of advantages over ImageIO and alternatives, including:

  • prevents heap related JVM crashes
  • implements unsupported image formats
  • reduce output file size
  • improve read/write performance
  • supports threading
  • superior image scaling algorithms

Learn more about JDeli, or download to try it yourself.

This article is part of our series on reading and writing image files in Java.

Zain Zain is a Java developer. His is a knowledge seeker who likes to try out and explore new things.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2019. All rights reserved.