The PNG Encoder
I was working with GroupSense and we were building tools for our security operatives. They’re on the dark web and they want to take screenshots on a sandbox machine. We just want to capture their screenshots in a safe way. So we built an endpoint that they could send screenshots to and that safe machine would just grab the screenshots — and of course the screenshots themselves would be pretty safe files but we just verify and then okay we can handle that.
The problem was we assigned a programmer to create the full page screenshot tool and they went and grabbed an open source full page screenshot tool and tried to adapt it just to send the URL to our server, which we had all agreed was a great plan.
But when the actual implementation started, turns out that the Canvas API is disabled — and all these tools use the Canvas API to stitch together the single page screenshots — so in the Tor browser, which is Firefox but you know Firefox changed, basically, if it is Firefox still I don’t know, but whatever it was at the time, this was years ago, the Canvas API was not available in the browser. So they had a Firefox browser plugin but you could not use the Canvas API. So they said there’s nothing we can do, we can’t take the full page screenshot.
A coworker was bringing it up at the daily standup as a blocker and I said I think I can resolve that blocker.
That’s when I brought up the idea of simply taking the single page screenshots and instead of pasting to the Canvas API to stitch them together, we could just write our own PNG decoder that would decode them and get the pixel arrays. And once we had all the single page screenshots and decoded them all to pixel arrays we could stitch the pixel arrays together and then re-encode it as a PNG file.
They all said that was insane. But actually I went and I did it the next day — it wasn’t very difficult to do. You just find the PNG documentation and write the encoder and decoder. Of course now with AI it’s like a 5-minute project, back then I had to do it with my hands so it took me like an afternoon. And I polished it up the next morning, showed it to them, and we were just fine.
That was just some kind of creative technical problem solving — something they thought couldn’t be done — just required thinking about it in a different kind of way and being willing to get your hands dirty a little bit.
