Hacker News new | ask | show | jobs
by kylec 4184 days ago
Was PSD designed to be a portable format? My understanding is that it was only meant to be used directly by Adobe Photoshop, much like the original DOC was meant to be used only by Microsoft Word. As such, it's a little unfair to call it out as a bad format because it was never meant to be reverse engineered and reimplemented.
3 comments

As far as i'm aware PSD was never supposed to be a portable format. I believe Adobe did release some limited information on the format in the past and that's why there's a lot of apps that can read and write the format.

It's a complicated format but that i imagine is from the fact that it's highly backwards compatable. Not always with 100% success but i believe it's possible to open new PSD files in older versions of photoshop. It's rare to see compatability work both ways like that.

You seem to confuse "portable file format" with "horrible designed format". :-)
So, this is the justification for having a horrible file format?
Photoshop 1.0 is from 1988. This was the era of the Macintosh SE [1], the default configuration of which came with two floppy drives, but if you paid a lot more, you could a hard drive that had as much as 40 MB. And it could have an entire 4 MB of RAM.

There are watches today that are 100x more powerful than Macs of that era. Almost anything that was good in a file format from that era would be bad today. Every novel and innovative application feature from Photoshop 1.0 would be seen today as trivial. Many of today's features would have been inconceivable.

If you think you can do better, then I'd encourage you to try. Just start shipping an app with a file format today, get a lot of users, take it through 15 major versions [2], and come back to us in 25 years. Then you can lecture those of us left alive on the right way to do file formats.

[1] http://en.wikipedia.org/wiki/Macintosh_SE [2] http://en.wikipedia.org/wiki/Adobe_Photoshop_version_history

It's not that long ago. GIF certainly predates it. I think ZIP does as well, and probably EPS, just to name a few for scale.

None of these does exactly what PSD does of course, so it's impossible to compare them.

A better example is perhaps TeX, which predates it by far, has been extended a lot during the years, and can still render both original documents as well as modern ones.

GIF, EPS, and ZIP do the same thing as they did decades ago. PSD does radically different things. Things that were, as I said, completely unpredictable at the time the format was started.
If I were to take up your challenge, I would probably just use sqlite. Is that cheating?
Consider that one of the challenges to early Photoshop was be doing graphics manipulation that is right at the edge of what the hardware at the time is capable of, I don't think that stuffing a relational database engine between the raw bits and the drive would be helpful.

The challenge needs to add the condition of the app stretching the hardware capabilities so hard that a whole pile of not-so-clean optimization tricks are necessary to get the performance up to the acceptable level.

SQLite versions 1, 2 and 3 have completely different file formats as well as differing semantics especially around typing. Later versions cannot even read earlier versions.

The file format is also well documented and fairly complex. https://www.sqlite.org/fileformat.html

Considering SQLite is only 15 years old and implements a rigorous specification instead of an evolving set of product requirements, you're just over halfway to what he talked about.
Go to Adobe board room, tell them about your great format that will empower artists to use their documents in competing applications.
When engineering a file format, you have multiple competing priorities you need to balance, such as size of the resulting file, reading and writing efficiency, backward compatibility, etc. Since Adobe didn't anticipate using PSD as a generic file format for graphics applications, it wasn't necessary to design it that way, and I'm sure that other priorities prevailed instead. It's also a pretty old format, probably designed not just once but many times over the years by many people resulting in the inconsistencies the article talks about.