PNG turned out to be pretty simple to parse directly from the specs. I was expecting much worse. Less than 12 hours on Handmade Hero, which includes all the time live coding, debugging, and all the explanations of everything as I did it:https://www.youtube.com/watch?v=lkEWbIUEuN0&list=PLEMXAbCVnmY5y4dSkKf297tJqwMxJOk7e …
-
Show this thread
-
Since live coding is usually a lot slower (and more error-prone) than regular coding, it seems like it might be reasonable to say that coding a PNG reader from scratch takes only about one work day of time, two at most, even if you have never looked at PNGs before (I had not).
1 reply 3 retweets 19 likesShow this thread -
However I would caveat that we didn't bother with multiple bit depths and index palettes, so it is definitely true that an extra day would probably be warranted if one wanted a complete PNG reader that did non-game-style PNGs (eg., not only true-color RGBA).
3 replies 1 retweet 12 likesShow this thread -
Replying to @cmuratori
Those features are good to have if you want to support crushed PNGs optimized with something like ImageOptim.
1 reply 0 retweets 0 likes -
Replying to @phort99
Yes, and they wouldn't be hard to add - they look pretty simple from the spec. But they're definitely not something we need for Handmade Hero. We want lossless data in :)
1 reply 0 retweets 0 likes -
Replying to @cmuratori
ImageOptim is designed for lossless PNG optimization. It removes useless metadata and iterates hard on the compression algorithm. I think data loss can happen but only in 0% Alpha areas.
1 reply 0 retweets 0 likes -
Replying to @phort99
I am just speaking generally about what we want for HH. We don't have any need to run some kind of compressor, whether lossless or otherwise. The only reason we're reading PNGs is because we were supporting quick Photoshop export. It is not our data storage format!
2 replies 0 retweets 0 likes
So we literally have no need for something like ImageOptim, and thus no need to support reading what it might write.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.