Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Psd.js: A Photoshop Document Parser in CoffeeScript (badassjs.com)
79 points by devongovett on Jan 31, 2012 | hide | past | favorite | 24 comments


"No one likes Photoshop..."

I fucking love Photoshop


I have a really hard time getting along with Photoshop as a web design tool. For touching up photos it's fantastic, but I far prefer Illustrator, or even better, Fireworks. Fireworks in particular has a great vector/raster hybrid that I love.

But I'm sure I would get used to Photoshop if I had to.


I’ve become used to Photoshop because I’ve had to (moved to a different company) but it’s seriously not as good as Fireworks for web.


I think the coolness about hating Photoshop comes from Photoshop on Mac being a 2nd class citizen. The Windows version of Photoshop is better in every way. It is very stable and has an excellent UI (though a few of the older dialogs could use an update).

The Mac version on the other hand is a pain in the ass to use. I operate at about 70% efficiency when using the Mac over Windows version.


Do you have any specifics? The UIs are very similar. They don't use the OS widgets on either platform to keep things consistent and if you know one you know the other. So much so that I'm not a fan of the Mac UI too much because it feels like a Windows app.


That is interesting, its the first time I've heard that. I've been using Photoshop on Windows since at least 1999 and can not imagine life without it. It never crashes (everything else I use does.)


Same here. I'm thankful for the brains that went into developing such a tool, just think about the amount of research, mathematics, and algorithms required to do even some of the simple tasks in Photoshop.


I tried out the demo, but it says "not a PSD file" for every PSD file I gave it.

If it works, I would really look forward to this.


Same problem. I'm using Safari on a Mac.


Won't work in Safari because Safari lacks FileReader support. Try in Chrome or Firefox.


Me too. Chrome 16.0.912.77


Same for me. What's up?


Well that's weird. I tried giving the demo a Photoshop CS5 file and it doesn't like that. I thought maybe it was a parsing problem, since I remember there being something about the latest Photoshops doing something to PSD's. PSD's made in Photoshop 7 do not seem to work either.

I wonder what is going on? I've tried this on Chrome 16 and Firefox 10.

Well that's weird. I tried giving the demo a Photoshop CS5 file and it doesn't like that. I thought maybe it was a parsing problem, since I remember there being something about the latest Photoshops doing something to PSD's. PSD's made in Photoshop 7 do not seem to work either.

I wonder what is going on? I've tried this on Chrome 16 and Firefox 10.

-- Edit:

Oh, it looks like browsers don't appear to be sending the MIME-type. In fact, there appears to be a lot of file types which I'm randomly throwing into filereader that don't appear to have any MIME-type attached to them. How very interesting indeed!


If I recall correctly, Adobe has not published PSD file-format specifications for anything past Photoshop 6, so supporting anything newer than that is likely to involve a lot of reverse-engineering and heartache.


Little known fact: Photoshop (and most other Adobe apps) comes with a JavaScript interpreter you can use to script it.


Unrelated to topic; Devon - the z-index of your static nav is below the discus comments. Add a "z-index: 2" for the #navigation CSS and it fixes it.


Thanks, fixed!


Well, it would appear that this is indeed "bad ass js". I can't for the life of me think of a way to use this, but it is very, very bad ass.


Love the idea and want to use this, but crashed the browser when I tried a simple psd.


Why CoffeeScript? Am I missing something or wouldn't have better performance with straight javascript?


Why do you think there would be a performance aspect? The JavaScript generated by the CoffeeScript compiler looks just like well written JavaScript. (But without the comments, grumble grumble.)


Try this:

  ###
  Your comment there
  ###


CoffeeScript can even be faster than hand-written JavaScript. See this comment I digged up by jashkenas: http://news.ycombinator.com/item?id=2443138

Also, from the CoffeeScript website:

The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript.

http://coffeescript.org/


It's equally possible to write CoffeeScript that's slower than the equivalent JavaScript: https://news.ycombinator.com/item?id=3371471

To get the most performance out of any language you need to understand it very well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: