I even wrote a DB to store PNG files more efficiently. It deduplicates blocks, and thus achieves much higher compression rates: https://github.com/albertz/png-db
The analytics were harder than I thought. I had OpenCV at hand, and tried using those SIFT features (if I remember correctly) (note, that was 12 years ago, before we had more powerful neural networks), and it took me lots of trial and error via a lot of ugly heuristics, and in the end I just tried to identify the Eclipse icon in the Mac Dock. But it worked more or less.
And the scripts to analyze the screenshots: https://github.com/albertz/screenshooting
Then, I developed some scripts which would collect such information more directly, about the app in foreground, including the opened file or URL, etc. This is still running, with many years of data now. But I never really had any use of that data. Maybe someday I will extract some interesting statistics out of it.
This script is here, with support for Linux and Mac: https://github.com/albertz/timecapture