Adobe Photoshop 源代码 (2013)
Adobe Photoshop Source Code (2013)

原始链接: https://computerhistory.org/blog/adobe-photoshop-source-code/

本文讲述了 20 世纪 80 年代末托马斯·诺尔 (Thomas Knoll) 和约翰·诺尔 (John Knoll) 兄弟如何使用自己设计的程序创建图像编辑软件“Photoshop”的故事。 它最初是为个人使用而开发的,由于其有效编辑数字图像的能力而受到欢迎。 在意识到其作为畅销产品的潜力后,他们将其重新命名为“Photoshop”并寻找经销商。 Adobe 获得了改进版本的发行权,标志着其广泛成功的开始。 在最初的形式中,Photoshop 主要是用 Pascal 为 Apple Macintosh 编写的,由大约 128,000 行代码组成,其中 75% 是 Pascal 语言,15% 是 68000 汇编语言。 如今,Photoshop 规模明显增大,代码数量达到数百万行。 专家 Grady Booch 赞扬了第一个 Photoshop 代码的结构和成熟度,尽管其规模不大。 为了鼓励人们学习和欣赏这一颇具影响力的软件的根源,计算机历史博物馆等组织已将 Photoshop 的某些历史版本(例如 1990 年版本 1.0.1)提供给非商业用途。

2000 年代初期,Adobe 的一名团队成员致力于归档 Photoshop、Illustrator、PostScript 等标志性应用程序的源代码。 他获得了 Thomas Knoll 的原始 Mac 备份磁盘,并将其内容转移到他的笔记本电脑上。 最古老的文件可以追溯到 1988 年,被确定为 Photoshop 的初始版本 (0.54)。 尽管面临诸多挑战,他还是设法在 Perforce 服务器上保存了这些无价的数字宝藏,包括古老的压缩存档格式。 不幸的是,由于外部磁盘驱动器出现故障,无法挽救 Illustrator 的最早备份。 软件专利的概念很复杂。 公开披露其内部运作确实可能会危及可专利性和潜在的许可义务。 然而,在开源编码披露之前提交专利申请仍然至关重要。 NAND闪存时代有一个有趣的故事——东芝最初在日本申请专利时遭到嘲笑,但最终成功获得了美国专利。 关于 Illustrator 和 Freehand,提供的信息有限。 尽管他对界面表示不满,但 Freehand 很快就流行起来,但最终还是倒闭了。 代码交易成为一个令人着迷的概念,使开发人员能够协作并改进现有软件。 我们的匿名解说员对这个想法表示赞赏,回顾了遗留的“兼容性”设置以及在新界面中保留它们的挑战。 他的个人经历涉及无缝登录他朋友的 Google TV 设置,维护旧功能和更新功能。 当 Adob​​e 应对不断发展的界面带来的复杂性时,他们可能会考虑过渡到新设计,同时确保兼容性,为教育机构提供激励,并为旧界面提供扩展支持。 可能需要数十年的调整。 用户对熟悉的用户界面有着强烈的依恋,尤其是在创意领域,做出重大改进时会遇到阻力和怀疑。 此外,本地化和语言偏好使 UI/UX 的更改进一步复杂化。 因此,进步往往是逐渐展开的。
相关文章

原文

Software Gems: The Computer History Museum Historical Source Code Series

pho·to·shop, transitive verb, often capitalized ˈfō-(ˌ)tō-ˌshäp to alter (a digital image) with Photoshop software or other image-editing software especially in a way that distorts reality (as for deliberately deceptive purposes)

— Merriam-Webster online dictionary, 2012

When brothers Thomas and John Knoll began designing and writing an image editing program in the late 1980s, they could not have imagined that they would be adding a word to the dictionary.

Thomas Knoll

John Knoll

 

Thomas Knoll, a PhD student in computer vision at the University of Michigan, had written a program in 1987 to display and modify digital images. His brother John, working at the movie visual effects company Industrial Light & Magic, found it useful for editing photos, but it wasn’t intended to be a product. Thomas said, “We developed it originally for our own personal use…it was a lot a fun to do.”

Gradually the program, called “Display”, became more sophisticated. In the summer of 1988 they realized that it indeed could be a credible commercial product. They renamed it “Photoshop” and began to search for a company to distribute it. About 200 copies of version 0.87 were bundled by slide scanner manufacturer Barneyscan as “Barneyscan XP”.

The fate of Photoshop was sealed when Adobe, encouraged by its art director Russell Brown, decided to buy a license to distribute an enhanced version of Photoshop. The deal was finalized in April 1989, and version 1.0 started shipping early in 1990.

Over the next ten years, more than 3 million copies of Photoshop were sold.

The box and disk for the original version of Photoshop on Mac.

 

That first version of Photoshop was written primarily in Pascal for the Apple Macintosh, with some machine language for the underlying Motorola 68000 microprocessor where execution efficiency was important. It wasn’t the effort of a huge team. Thomas said, “For version 1, I was the only engineer, and for version 2, we had two engineers.” While Thomas worked on the base application program, John wrote many of the image-processing plug-ins.

The splash screen of Photoshop 1.0.7.

 

With the permission of Adobe Systems Inc., the Computer History Museum is pleased to make available, for non-commercial use, the source code to the 1990 version 1.0.1 of Photoshop. All the code is here with the exception of the MacApp applications library that was licensed from Apple. There are 179 files in the zipped folder, comprising about 128,000 lines of mostly uncommented but well-structured code. By line count, about 75% of the code is in Pascal, about 15% is in 68000 assembler language, and the rest is data of various sorts.

To download the code you must agree to the terms of the license, which permits only non-commercial use and does not give you the right to license it to third parties by posting copies elsewhere on the web.

Download Photoshop version 1.0.1 Source Code

Commentary on the source code

Software architect Grady Booch is the Chief Scientist for Software Engineering at IBM Research Almaden and a trustee of the Computer History Museum. He offers the following observations about the Photoshop source code:

  • “Opening the files that constituted the source code for Photoshop 1.0, I felt a bit like Howard Carter as he first breached the tomb of King Tutankhamen. What wonders awaited me?
  • I was not disappointed by what I found. Indeed, it was a marvelous journey to open up the cunning machinery of an application I’d first used over 20 years ago.
  • Architecturally, this is a very well-structured system. There’s a consistent separation of interface and abstraction, and the design decisions made to componentize those abstractions – with generally one major type for each combination of interface and implementation – were easy to follow.
  • The abstractions are quite mature. The consistent naming, the granularity of methods, the almost breathtaking simplicity of the implementations because each type was so well abstracted, all combine to make it easy to discern the texture of the system.
  • Having the opportunity to examine Photoshop’s current architecture, I believe I see fundamental structures that have persisted, though certainly in more evolved forms, in the modern implementation. Tiles, filters, abstractions for virtual memory (to attend to images far larger than display buffers or main memory could normally handle) are all there in the first version. Yet it had just over 100,000 lines of code, compared to well over 10 million in the current version! Then and now, much of the code is related to input/output and the myriad of file formats that Photoshop has to attend to.
  • There are only a few comments in the version 1.0 source code, most of which are associated with assembly language snippets. That said, the lack of comments is simply not an issue. This code is so literate, so easy to read, that comments might even have gotten in the way.
  • It is delightful to find historical vestiges of the time: code to attend to Andy Herzfield’s software for the Thunderscan scanner, support of early TARGA raster graphics file types, and even a few passing references to Barneyscan lie scattered about in the code. These are very small elements of the overall code base, but their appearance reminds me that no code is an island.
  • This is the kind of code I aspire to write.”

And this is the kind of code we all can learn from. Software source code is the literature of computer scientists, and it deserves to be studied and appreciated. Enjoy a view of Photoshop from the inside.

Early Photoshop screenshots*

The home screen, showing the available tools.

Photoshop allowed you to select brush color as well as size and texture. (The first color Mac was the Macintosh II in 1987.)

There were some sophisticated selection tools, and a good assortment of image filters. One important missing feature, which came with version 3 in 1994, was the ability to divide an image into multiple layers.

The preferences page allowed for some customization of the features.

There was a limited choice of fonts, font sizes, and font styles. The text was entered into this dialog box, then moved into the image.

Historical Source Code Releases

联系我们 contact @ memedata.com