
Photoshop 1.0 Source Code - ConstantineXVI
http://computerhistory.org/atchm/adobe-photoshop-source-code/
======
ComputerGuru
Github repo/mirror of source code, for those so inclined:

<https://github.com/mqudsi/photoshop>

------
micheljansen
The site is down, but I mirrored the source code here:
<http://cl.ly/061Z0b463V2f>

(license: <https://gist.github.com/micheljansen/4949042>)

The article (cache:
[http://webcache.googleusercontent.com/search?hl=en&clien...](http://webcache.googleusercontent.com/search?hl=en&client=safari&tbo=d&rls=en&q=cache%3Ahttp%3A%2F%2Fcomputerhistory.org%2Fatchm%2Fadobe-
photoshop-source-
code%2F&oq=cache%3Ahttp%3A%2F%2Fcomputerhistory.org%2Fatchm%2Fadobe-photoshop-
source-
code%2F&gs_l=serp.3...8595.8595.0.8861.1.1.0.0.0.0.0.0..0.0.les%3B..0.1...1c.1.3.psy-
ab.WTAAqOxnFbo&pbx=1)) also has some cool screenshots of early Photoshop :)

~~~
networked
Could someone with an appropriate background analyze the license in-depth?

Looks like it allows you to produce derivative products, which is great,
however, it also forbids commercial use, meaning it's at least not at the same
level as FSF- and OSI-approved licenses.

~~~
adestefan
IMHO, the license is pretty clear that you can't even post the source on
GitHub.

~~~
chrisdevereux
Yeah, that and the the "It may not be distributed to third parties" bit at the
top of each file.

------
jgoney
What really blows me away is how comparatively little the interface has
changed over the years...not to sound dense, but it looks exactly like you'd
expect Photoshop to look.

~~~
leejoramo
Much of Photoshop's interface came from Apple's own MacPaint which shipped at
the launch of Macintosh:

<https://en.wikipedia.org/wiki/File:MacpaintWP.png>

[http://www.folklore.org/StoryView.py?project=Macintosh&s...](http://www.folklore.org/StoryView.py?project=Macintosh&story=MacPaint_Evolution.txt&topic=MacPaint&sortOrder=Sort%20by%20Date&detail=medium)

~~~
ConstantineXVI
Coincidentally, the CHM has MacPaint's source[0] as well.

(I've honestly not heard much about CHM before. Making sure to find my way
there next time I manage to end up in the Bay Area)

[0] [http://www.computerhistory.org/atchm/macpaint-and-
quickdraw-...](http://www.computerhistory.org/atchm/macpaint-and-quickdraw-
source-code/)

------
chris_wot
The first version of Photoshop was written in _Pascal_?!?

~~~
Someone
Pascal was the Mac OS programming language. The API had data types Str255
(Pascal string, maximum 255 character, in a 256-byte memory block), Str15
(same, max 15 characters, in a 16 byte block) and the like, and many of the
higher-level calls used Pascl calling conventions (lower-level calls used a
mish-mash of conventions for speed. For example, low-level file calls used a
register to pass pointers to parameter blocks.

In the rather unlikely case you want to know, read
[http://filibeto.org/unix/macos/lib/dev/documentation/Carbon/...](http://filibeto.org/unix/macos/lib/dev/documentation/Carbon/Reference/Mixed_Mode_Manager/Mixed_Mode_Manager.pdf),
which details how you (sort of) transparently could call 68K code from PPC
code and vice versa.

The section "Special Case Calling Conventions" lists all special cases. You
get such cases as "Parameters are passed to the routine in registers A3 and
D7, and output is returned in registers D2, D3, and D4".

~~~
lobster_johnson
Amazingly this looks a lot like Borland's Turbo Pascal (later Borland Pascal,
later Borland Delphi, then Embaradero something), which had lots of OO
extensions over the years, designed by Andreas Hejlsberg (who went on to make
C#).

In the golden age of Delphi, the language was pretty on par with today's
Objective-C: Classes, late binding, properties, reference counting, modern
strings, etc.

I wonder how much influence there was between the two.

~~~
pjmlp
Turbo Pascal 5.5 objects were based in Object Pascal done by Apple.

~~~
lobster_johnson
Makes sense. As far as I can see, it was not directly copied from the Mac
dialect; there are some differences, like how the Mac code requires methods in
the declaration to be declared fully qualified with the full class name
("PROCEDURE TEraseAll.IEraseAll (view: TImageView);").

------
leoh
Any hope of being able to compile this on a modern system? I wonder what it
would take...

~~~
masklinn
Likely rewriting the assembly sections.

The Pascal parts ought work, if you have a compiler for the same pascal
dialect.

~~~
Millennium
You'd also need the MacApp framework, which I don't think was ever ported to
OSX.

~~~
Millennium
Well I'll be damned; after some more research, it looks like it WAS ported
(unofficially) to OSX. That said, I'm not sure it works with the original
language anymore.

------
melling
100,000 lines. Wonder what it would take to crowd source a port? Best "modern"
language? Java? Javascript? Go?

~~~
adestefan
Why would you need to port it to anything? Pascal is still a useful language.

~~~
jlarocco
Even if the core logic were left in Pascal, the assembly language would need
porting to x86/x86_64 and the GUI code would need to be ported to a modern GUI
library.

------
dexterchief
For anyone interested in retro graphics programs, you should check out Wright
Design. I wrote up a post about it and it includes a zip file of the actual
program and tutorial files. I have always secretly hoped that someone would
make an FOSS version of this software since I have yet to see anything like it
even though it is now more than 15 years old. It seamlessly combined bitmap
and vector artwork and was twice as fast as Photoshop in its day. Sad that
Adobe was able to kill it off...

[http://mikewilliamson.wordpress.com/2010/02/16/12-years-
old-...](http://mikewilliamson.wordpress.com/2010/02/16/12-years-old-and-
still-the-future-of-design/)

------
nathell
The first call ever made by the main module (MPhotoshop.p) is

InitToolbox(8);

However, there is no other mention of InitToolbox in the sources. Is it part
of the Mac OS API? Which compiler were these sources meant for?

~~~
kalleboo
It's part of the MacApp framework, which isn't included in this source dump
since it's copyright Apple.

<http://en.wikipedia.org/wiki/MacApp> "MacApp was based on Object Pascal,
Apple’s object-oriented extension to Pascal, developed in consultation with
Pascal inventor Niklaus Wirth."

<http://c2.com/cgi/wiki?MacApp>

------
meaty
And for something a little more modern (OpenPDN - a fork of Paint.Net which is
comparable to photoshop in some ways):

<http://code.google.com/p/openpdn/source/browse/>

~~~
pserwylo
I'm curious, how does this compare to something like The Gimp, which I've
always considered comaprable to Photoshop in _almost every_ way)

~~~
dagw
Paint.Net has many fewer features then Gimp, but the features it does have are
fast, clean and simple to use (for reasonably small files). It's my go to tool
on Windows for basic editing tasks.

~~~
barrkel
It's missing fractional selection and per-layer alpha channels. With those two
features, it would be almost usable. Without them, most photo editing tasks
are highly difficult.

Fractional selection lets you apply adjustments and effects without harsh
boundaries between the adjusted part and the unaffected part. Per-layer alpha
channels are needed to blend together different layers smoothly. And actually,
you could implement the effect of the former with just the latter.

So yeah; Paint.NET needs editable per-layer transparency channels.

------
qompiler
This is hilarious! Gimp's interface (separate windows) is based on Photoshop
1.0?

~~~
mseepgood
Photoshop on Mac has separate windows up to the present day.

------
jakejake
Does anybody know how to build this, or if it's even possible on the current
Mac architecture and OS?

~~~
leledumbo
Nope, it will require porting. Only the pure Pascal part is portable. The
Assembly and MacApp parts are not, and MacApp no longer exists in OS X AFAIK.

------
gulbrandr
503 Service Unavailable No server is available to handle this request.

:/

------
avodonosov
old good Pascal

