Open Source Ruby Library for Parsing Photoshop PSD File

Ruby API that supports converting PSD to canvas, exporting PSD data, access PSD slices data, and access PSD layer inside Ruby apps.  

PSD.rb is a lightweight, easy to use open source Ruby library that enables software developers to parse Adobe Photoshop PSD file or extract Metadata and other usable information using Ruby code. The library allows users to handle Photoshop document data in a manageable tree structure.  The aim behind developing PSD.rb was to provide better PSD scraping capabilities to developers working with Photoshop PSD files regularly.

The library handles all the major functionalities regarding accessing and opening the file and looking for the desired data and retrieve it in the operational form. The PSD.rb library is very easy to handle and enables developers to work with a Photoshop document in a manageable tree structure and search out important data such as document size, document structure, folder name and size, the opacity of the folder, folder visibility,  font name, font color or size, vector mask data, flattened image data and much more

Previous Next

Getting Started with PSD.rb

The recommended way to install PSD.rb is using RubyGems. Please use the following command for a smooth installation.

Install PSD.rb  via GitHub

$ gem install psd

Exporting PSD Data using Ruby API

The open source PSD.rb library enables software programmers to export data from a PSD file with ease using Ruby commands.  While working in the tree structure, we can recursively export any node to an object, which includes all the common information. It is also possible to export the PSD to a flattened image file with just a couple of lines of Ruby code. Please remember to save it with compatibility Mode enabled, otherwise an empty image will be produced

Convert PSD to Canvas using Ruby

The open source PSD.rb library has provided complete functionality for converting PSD to canvas inside Ruby applications.  The library supports parsing the imported PSD and converts it into canvas objects. After that, you can iterate the layers of the PSD objects and add the objects into the canvas with ease. After that order, the added objects and you are done. You can also export the canvas to PDF, SVG, PNG, PEG, and more.

Access PSD Slices Data

The PSD.rb library gives software developers the capability to access PSD slices directly inside their own applications.  It also supports getting an array of all slices in the document with just a couple of lines of Ruby code. It is also possible to search slices by their name or by their ID.  The library also provides support for export slices as a PNG.

Access PSD Layer Data

The open source PSD.rb library enables software professionals to access PSD layer data using Ruby commands. You can easily get a name as well as dimensions of the layer using a couple of lines of Ruby code. Developers can also access various other types of information store in layer info blocks such as size, color, fonts, and so on.

.