Live data from Hacker News

Psd.rb

layervault.tumblr.com

41–50 of 94 posts

Re: Psd.rb

#41
post #27

Earlier quoted context omitted.

I suspect that you could probably also manage it with GIMP/guile, but I don't suspect it would be particularly pleasant.

If you want to script it, ImageMagick or GraphicsMagick are probably a better bet than trying to hack up something with GIMP batch processing: http://www.imagemagick.com/www/formats.html If you just want to do basic conversion ignoring layers, it's quite easy: for f in *.psd; do convert "$f" "${f%%.psd}.png" done

You can use find/xargs for this. It'll be faster because you can parallelize it with the -P option, for example, for a 4-core machine:

    find . -iname "*.psd" -print0 | xargs -0 -P 4 -n 1 -I I convert I I.png
For best results, change the number "4" in the above command to the number of cores you have.

Re: Psd.rb

#42

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.

I get this feeling with many open source projects, but merges happen much less often than forks.

Re: Psd.rb

#43
post #27

Earlier quoted context omitted.

I suspect that you could probably also manage it with GIMP/guile, but I don't suspect it would be particularly pleasant.

If you want to script it, ImageMagick or GraphicsMagick are probably a better bet than trying to hack up something with GIMP batch processing: http://www.imagemagick.com/www/formats.html If you just want to do basic conversion ignoring layers, it's quite easy: for f in *.psd; do convert "$f" "${f%%.psd}.png" done

Oh excellent, I didn't know ImageMagick did PSD.

Re: Psd.rb

#44
post #39
post #32

Earlier quoted context omitted.

> The problem is harder than it looks. markupwand.com is pivoting...

isn't that the point?

Thought that GP was not aware of the fact and just linked a relevant company from memory. Makes more sense this way, thanks.

Re: Psd.rb

#45
post #28

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.

Just use Ruby for this. I prefer Ruby, but there are times I will pick Python instead because it has better libs for what I need to do, e.g. numerical and scientific libs.

Re: Psd.rb

#46

>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.

The file spec released by Adobe ( http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/ ) is actually outdated, wrong in some places, and can be incredibly vague at times.

A bit off-topic, but is there a spec for Illustrator files? It seems the only one I see on Google is from an old version of AI...

Re: Psd.rb

#47

Earlier quoted context omitted.

The file spec released by Adobe ( http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/ ) is actually outdated, wrong in some places, and can be incredibly vague at times.

A bit off-topic, but is there a spec for Illustrator files? It seems the only one I see on Google is from an old version of AI...

Not yet, but there's always next week...

Re: Psd.rb

#48
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.

Re: Psd.rb

#50
post #28

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.

Just use Ruby for this. I prefer Ruby, but there are times I will pick Python instead because it has better libs for what I need to do, e.g. numerical and scientific libs.

"Just use Ruby" isn't always the best option; if you have a large base of Python code, it's probably preferable to use Python directly rather than using the subprocess module.

Also, a port would be fairly straightforward. Some combo of the struct/ctypes modules (depending on how complicated the data structures are) would make a transliteration pretty simple.

Post reply on HN