top | item 43374278

That Time I Recreated Photoshop in C++

303 points| f055 | 11 months ago |f055.net

144 comments

order

mrandish|11 months ago

> "It followed a set of five rules to benefit the end user: no installers, no archives, no registry keys, no additional runtimes and a single executable file."

Reading this sentence made me feel warm and happy. I get why the registry exists and things work the way they do today around the Windows software ecosystem but... damn, I really miss the days when most desktop software was more like this. These days I try to use portable installs whenever they're available, I just wish it was more common. The time, inconvenience and uncertainty I'll be able to fully restore all my preferences makes me actively avoid reinstalling Windows.

thrdbndndn|11 months ago

There are lots of useful actions an installer does that (some, if not most) end users actually want, including but not limited to adding shortcuts to start menu so you can find it or search for it, associating file formats, registering to Windows' program list, etc.

I was a big fan of "portable" software, but nowadays if a software offers both ways, I actually prefer using installer. Otherwise I have to manually add them to Start Menu to be able to search for it, to begin with.

I do hate registry keys, simply for the fact they are often lost after reinstalling the OS. Please just keep all the settings in %appdata%!

yndoendo|11 months ago

That is one of the reasons I like GO language. Single executable, which makes tooling easier for others to use. My alternative method is using single executable packaged with NSIS that extracts everything to a temp directory before running.

Sorry, Window Registry is a cornucopia of inconsistency and poor design. Gnome's Registry is well designed, comparatively. Key descriptions, value options with limitations and which is the default is a quality User Interface design. Just look at the Windows group policy to registry mappings, they are all over the place for the same logic layout with double negatives for keys.

Dwedit|11 months ago

The original purpose of the registry was to tell COM where to look for a DLL file given a GUID. Then COM could create instances of objects.

You still see that in there with HKEY_CLASSES_ROOT.

You can technically create objects without the registry, if you load up the DLL, then call the exported functions to create a Factory object, then use the factory object to create instances. It's what COM itself does.

dkga|11 months ago

That simplicity and lightness of design also resonated with me.

By the way, really cool read-off. The only thing I missed though was a deeper discussion of some of the challenges that the author alludes to in the beginning. But that’s just me being pedantic, the post is really nice and actually seems to be quite an impressive work.

dgfitz|11 months ago

I’m not sure what the best path forward is for making single-binary apps without static-compiling in of the libraries. Licensing usually makes that untenable.

marcodiego|11 months ago

> no installers, no archives, no registry keys, no additional runtimes and a single executable file.

This is exactly the experience nowadays with AppImages.

tonyhart7|11 months ago

only works with hobby project with barebones feature

chpatrick|11 months ago

Photoshop has a million features though, a couple of image filters doesn't really count as recreating.

JackFr|11 months ago

Nailing the UI though is both very difficult and very important.

In 2006, GIMP had a ton of features, but compared to Photoshop’s UI it was positively awful.

ForTheKidz|11 months ago

Still very, very impressive for undergraduate work.

airstrike|11 months ago

I don't think we're meant to take "recreating" literally

bufferoverflow|11 months ago

Exactly. I think Photopea is the closest replication attempt, but even it misses many features.

imoreno|11 months ago

If you say "I made basic image editor" it doesn't sound as impressive, of course. Not surprising given how it opens with:

>As I’m getting older I look back on all the things I’ve done as a creative developer, and I see so many cool projects!

Such modesty...

90s_dev|11 months ago

> But I didn’t promote it. A few months later, I landed a C++ job. So in the end all that effort paid off.

It's interesting how instinctively we know our hard work deserves to be paid off, but it's a shame how often open source developers put hard work into code that never really gets paid off, especially when it's widely used in production. I guess this explains why so often they look for reputation credits, or why NPM added the "maybe you should donate to the authors of these libs" feature, or why GitHub built in Patreon. There's got to be a better model than what we have now, that doesn't take advantage of naive but hard working young thinkers.

StefanBatory|11 months ago

Author of this article said he finished at Warsaw University of Technology - it was always considered to be one of the better ones here.

That being said, what also strikes me is how different the thesis were back in times. I did mine recently in another university of technology in some bigger city (without wanting to dox myself that much) and 90% of our engineering theses were of very subpar quality; mine included.

netsharc|11 months ago

Is it any different nowadays? AFAIK the goal isn't to advance the field, but to prove to the people giving you the Bachelor/Master's degree that you're able to create a "paper". Some theses stand out, but most of them are probably quite boring.

vijucat|11 months ago

This is why I love Windows. There is a TON of small, open source software that serves a niche. Used to browse sourceforge.net and freshmeat (is that what it was called?) to find them!

nailer|11 months ago

A friend from Phonegap got acquired by Adobe a decade ago and ported Photoshop to JavaScript for entertainment purposes immediately afterwards.

nailer|11 months ago

Not complaining about downvotes but it seems a very odd thing for Hacker News to dislike. I would have imagined an internal story about a SW eng’s hack project would be interesting. Oh well.

pacifika|11 months ago

The things people make and not tell the world about. Glad it’s on GitHub, this is so impressive.

NotAnOtter|11 months ago

Photoshop is a stretch.. that's more like MS paint in terms of feature parity.

DeathArrow|11 months ago

In my experience, when developing software the hard part is implementing the actual logic, not the UI.

In this case, replicating Photoshops UI seemed to be the hardest. Maybe using something like MFC, Qt, C++ Builder instead of straight Win API would have been easier.

I remember a long time ago when I was in high-school and tried to implement a paint program under DOS, that had windows using Borland C++ and BGI graphics library. How hard should it be to implement windows, buttons and dialogs, I thought? After all, with the power of OOP and C++, every problem is easy to solve, I thought.

iforgotpassword|11 months ago

I think most people will agree that ui is the hardest part for normal desktop software. Not getting any kind of ui going, but good ui. Consistency, how to group things, what goes where.

If your app needs two inputs and a button then this won't be so much of an issue, but I've wrestled with qt in the past for more complex layouts that I hate it with a passion.

aa_is_op|11 months ago

Did it crash every 30 minutes?

If not, how much are you selling it for?

DidYaWipe|11 months ago

"Straight from my previous project named Fiew I added a massive image library viewer. It really could quickly and easily scroll through massive amounts of pictures."

Which is now infuriatingly lacking in the entire domain of image editors. Thumbnail browsers used to be an expected feature of image editors, even shareware ones. Now? Fat chance. Good luck even finding a stand-alone one.

Recently one called FlowVision surfaced for Mac, and it's pretty much the lightweight browser that many of us have been looking for for years. It has some rough spots, but the developer is responsive to issues. https://github.com/netdcy/FlowVision

theodric|11 months ago

Slick. Runs pretty well under Wine!

echelon|11 months ago

It looks like you could have sold licenses to this or gone the startup route. Might have been slower and less glamorous than the gig you wound up getting, though.

The UX looks simple and reasonable. Frankly better than Gimp.

Really cool work!

pessimizer|11 months ago

> Frankly better than Gimp.

Only for people who think that things are good to the extent they "resemble Photoshop as much as possible." [direct quote] The Photoshop UI isn't ideal, it's fairly terrible (not as bad as Illustrator, but they're both just old), but people don't want to waste the huge effort it took to commit all of that to muscle memory.

Cloning Photoshop for a thesis is wild, though. From a comic book reader to most of Photoshop in one leap.

IshKebab|11 months ago

> It looks like you could have sold licenses to this

Doubt it. There are too many good free options on this level, e.g. Krita.

bschmidt44|11 months ago

[deleted]

brulard|11 months ago

Photopea is really nice. I was pleasantly surprise how many features they implemented to a free product. And even UI is not half bad. Kudos!

busymom0|11 months ago

I have used Photopea for so many of my projects. I make apps and I use it for every app icon and App Store screenshots I have built. Also used it to make memes. Not having to install it on my Mac and just easily accessing it from browser is immensely helpful.

urbandw311er|11 months ago

Yep. Have it as a desktop icon and use it like a native app.

timnetworks|11 months ago

The native keyboard shortcuts

promoterr|11 months ago

umm, what's wrong with: https://affinity.serif.com/en-us/ ? Adobe is out-of-everything for decades..

mjlee|11 months ago

It was released 7 years after this project, and downloading someone else's image editor is not a typical route to submitting a final thesis for a degree.