Psd.rb

by chamzaon 7/30/2013, 7:01 PMwith 92 comments

by artagnonon 7/30/2013, 8:27 PM

This programmer has written about the PSD format in colorful detail: "Trying to get data out of a PSD file is like trying to find something in the attic of your eccentric old uncle who died in a freak freshwater shark attack on his 58th birthday."

https://code.google.com/p/xee/source/browse/XeePhotoshopLoad...

(ref: first link in the article)

by mistercowon 7/30/2013, 8:01 PM

>Adobe has never produced an easy way for developers to work with the format.

That's not entirely fair. Adobe has openly released a comprehensive description of the format which is, as far as I know, accurate. The problem is that the format itself is a heap of features piled on year after year with apparently no regard for doing things consistently.

by tommooron 7/30/2013, 8:36 PM

Wow, fantastic work and a lot of respect for open sourcing this lib when it's clearly an important part of LayerVault.

by blton 7/30/2013, 11:20 PM

Does anyone else think it's weird that they decided to make this library in Ruby? It drastically cuts down on the audience. Why not C/C++ with wrappers for all the dynamic languages?

EDIT: nevermind, it makes sense now that I see their main product is a version control system for designers. Still, it would be nice to see this ported to native code some day.

by gburt2on 7/30/2013, 8:45 PM

I just wrote a script with this that takes a directory of PSDs and outputs PNGs for each one. It took about 2 minutes. This is great.

by mhdon 7/31/2013, 7:25 AM

Is this more feature complete (esp. regarding to newer PS versions) than e.g. libpsd?

http://sourceforge.net/projects/libpsd/

by adamwong246on 7/30/2013, 11:31 PM

Idea: Use this to dynamically "compile" photoshop files into png, jpgs, etc on the rails assets pipeline.

by tluyben2on 7/30/2013, 10:26 PM

Thank you very much for doing this! I wish all people hacking the PSD format would join forces and help with one project. There are too many partial implementations which scratch an itch instead of trying to be a full implementation.

by njaon 7/30/2013, 9:40 PM

Does anyone know of a similar tool for Python?

Not trying to start a Ruby/Python fight or anything; Python just happens to be my preferred language.

by freerobbyon 7/30/2013, 7:55 PM

Great work and thanks for building this. There's a lot of room for improvement in automating manipulative photoshop exports, and I look forward to seeing what people do with this, especially in terms of building command line tools.

by netforayon 7/31/2013, 2:40 AM

I have been trying to do this from last 3 months. But I intend to make modifications to layers (turn on or off, change colors) and export to PNG. When I saw Psd.rb I thought it is done. But it just exports the channel data saved by Photoshop. So our modifications wont reflect in it.

by captainbeniseson 7/31/2013, 4:08 AM

I reckon a good tool (that this psd.rd wouldn't actually help write, but), would be one that rendered an html/css page - and exported a layered PSD, so you could prototype an app, render it to .psd and send it to your designer friend to make it look rad.

by carlosdpon 7/30/2013, 9:05 PM

Thank you! There's quite a ton I can do to this. Will definitely be contributing soon.

by smickieon 7/31/2013, 8:55 AM

This is a great example of why open source is brilliant. Everybody wins. We get a PSD parser. LayerVault benefits from the world improving they're core product too.

by envexon 7/30/2013, 7:48 PM

I feel like this could be used to automatically convert a simple .psd web layout to non-shitty HTML and CSS.

by smtmon 7/30/2013, 7:49 PM

So, will there be writing .PSD files as well? This would be the über thing. Imagine: upload a .PSD and get back a clean HTML layout + bootstrap_overrides.css

by cveigton 7/31/2013, 12:46 PM

These are great news for developers and an easy way to communicate between designers with developers. Is the beginning of a solution for a big problem.

by primituron 8/3/2013, 9:24 AM

I'd pay for a Lua port of this. Anyone interested? Drop me a PM.

by isaacjohnwesleyon 7/30/2013, 8:48 PM

Truly awesome, cant wait to think of the possibilities with this.

by jherikoon 8/1/2013, 12:34 PM

nice. now if someone can port it to C so that everyone can benefit... :)

by aftermathvcon 7/30/2013, 8:29 PM

awesome!

by Radleon 7/31/2013, 7:29 PM

// PSD is not my favourite file format.

I see bro...