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

48 sec read

In this post of ‘How to’ articles I will be focusing on 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.

JDeli is one of a few libraries that can read PSD files. JDeli can read and write a very wide range of other image formats. Here is the full list on Image file conversions supported.

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);

You can find the javadocs for JDeli here. You can find out more about JDeli here.

You can find more tutorials in our series on handling common image formats in Java, JDeli and other image libraries.

IDRsolutions develop a Java PDF Viewer and SDK, an Adobe forms to HTML5 forms converter, a PDF to HTML5 converter and a Java ImageIO replacement. On the blog our team post anything interesting they learn about.

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.