That Time I Recreated Photoshop in C++
44 comments
·March 15, 2025mrandish
thrdbndndn
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%!
klodolph
I’m really fond of the way macOS does this, which is to stick this information in the executable.
Back in the day, this worked via a flag in the metadata for each file. When you got a new executable, the flag was unset. The OS would see a file with an unset flag, ask “Is this an executable? What files can it open?” and then add this information to a database called the desktop database.
This is why file associations work on a Mac without an installer, and without writing any code (you just have to write the code for “open file in response to OS request”).
cosmic_cheese
Furthermore, the OS can pick up the extensions, services, etc the app carries within its app bundle and offer them to the user to enable this way. No need to copy files to obscure directories (be it manually or with an installer), and when you trash the app bundle they’re all gone.
This is why merely having a copy of an app is enough to make QuickLook able to preview the filetypes the app is capable of opening. The system picks up the QuickLook extension in the app bundle and enables it.
It’s not perfect since small .plist config files get left behind, but it’s a whole lot more clean by default compared to the Windows approach.
alt227
> which is to stick this information in the executable
This is neat, shame they went completely the other way with file metadata. It forces a hidden .ds_store file in every single folder a mac touches just to store info like access time. Every other system stores this in the file itself.
paulddraper
I mean…that’s just the same thing right?
pjmlp
If only everyone actually kept up with Windows development best practices, including Microsoft teams themselves[0].
Configuration via XML files, AppData, registry free COM activation, MSI installers, only to quote a few examples, are decades old by now, at very least since Windows XP.
[0] - To be fair, nowadays many young employees seem to only ever used Windows after joining Microsoft, so what else can we expect, if apparently they don't get the right mentoring.
vlovich123
What about a standalone executable that just offered the ability to install itself without having a dedicated separate installer?
delusional
After using Microsoft Intune I will never again complain about installers. At least installers mostly work, and when they don't you can run them again.
yndoendo
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.
airstrike
Obligatory comment saying you can do the same in Rust
IshKebab
It's not quite as seamless as in Go to be fair. But it does mean you can write Rust instead of Go.
delusional
You can in fact also do it in C
marcodiego
> no installers, no archives, no registry keys, no additional runtimes and a single executable file.
This is exactly the experience nowadays with AppImages.
dkga
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
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.
ryandrake
The license is one of many the tradeoffs you make when you choose whether or not to include third party libraries. You don't have to use them.
TingPing
The classic option is just a self extracting exe. I don’t really understand the fear of archives personally.
maccard
Pay for it, or open source your work (assuming you’re talking about QT).
gkbrk
Which license forbids static linking?
01HNNWZ0MV43FF
They might be referring to *GPL libraries not allowing proprietary / permissive exes to static-link them. e.g. I think Qt requires its DLLs to be separate on disk as part of the LGPL, unless you buy the commercial license.
chpatrick
Photoshop has a million features though, a couple of image filters doesn't really count as recreating.
JackFr
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.
Arainach
You could replace that year with any year since the start of the GIMP project and it would still be true. It's the epitome of an open source project run by people who care about technical features, not real world users.
77pt77
What's your opinion on Krita?
brnt
People say this, but I didnt have such issues using Gimp compared to PS. They are different, that's it.
The main thing I missed were stackable layers, but it was not a huge issue for me.
ForTheKidz
Still very, very impressive for undergraduate work.
airstrike
I don't think we're meant to take "recreating" literally
pacifika
The things people make and not tell the world about. Glad it’s on GitHub, this is so impressive.
aa_is_op
Did it crash every 30 minutes?
If not, how much are you selling it for?
StefanBatory
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
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.
StefanBatory
It seems to me like their tasks were way heavier. For us, most of us did basic CRUDs with some implemention twist, and our papers were your standard: do a short theoretical introduction to the domain, make a few UML diagrams, explain how it works + some code examples, then testing.
echelon
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!
IshKebab
> 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.
pessimizer
> 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.
bschmidt44
timnetworks
The native keyboard shortcuts
Findeton
[flagged]
nailer
A friend from Phonegap got acquired by Adobe a decade ago and ported Photoshop to JavaScript for entertainment purposes immediately afterwards.
nailer
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.
> "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.