A Ruby library for parsing Adobe Photoshop (PSD) files into a manageable tree structure to extract document and layer data.
PSD.rb is a Ruby library that parses Adobe Photoshop (PSD) files, allowing developers to programmatically read and extract data from Photoshop documents. It converts PSD files into a tree structure, enabling access to layers, groups, text information, and image data. This solves the problem of automating design-related tasks, such as extracting assets, generating previews, or integrating design data into applications.
Ruby developers working on design automation tools, asset pipelines, or applications that need to process Photoshop files without manual intervention. It's also useful for designers who want to script interactions with PSDs.
Developers choose PSD.rb because it provides a pure Ruby solution for parsing PSDs with a clean API, extensive feature support (like layer comps and slices), and the ability to export images. It's actively maintained and offers performance enhancements via optional native extensions.
Parse Photoshop files in Ruby with ease
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a clean Ruby API with methods like children and descendants for easy navigation of layer hierarchies, as demonstrated in the traversal examples for accessing document structure.
Extracts detailed text data including font names, sizes, colors, and CSS styling from layers, enabling automated content management, as shown in the layer info block examples.
Supports exporting flattened PNGs, layer comp previews, and slices directly to disk or as PNG data, with methods like save_as_png for automated asset generation.
Allows filtering and exporting based on saved Photoshop layer comps using filter_by_comp, facilitating version control and multi-variant asset workflows without manual toggling.
The README's to-do list admits missing features for certain image modes, depths, and layer styles, which can limit accuracy for complex designs and exports.
Without the optional psd_native extension, parsing is slower in pure Ruby, making it less ideal for large files or high-throughput scenarios, as noted in the speed-up recommendation.
Requires enabling debug mode via environment variables like PSD_DEBUG for troubleshooting parsing issues, adding complexity to deployment and maintenance.