All this thinking off about PNG files is because I have been modifying Johann C. Rocholl’s png.py file to create…
png.py
but now it can cope with palettes, bit depths < 8, yadda yadda. Basically all PNG formats.
Download it from Google code. It even has documentation (as Python docstrings), and examples.
I would like to see this used for all your PNG needs in Python. So if it sucks, tell me!
PS: Dear lazyweb, where else should I announce this fine piece of hand-crafted software?
2009-03-16 at 12:49:23
pypi?
2009-03-16 at 13:17:39
Nice work! As a lazyuser, I’d be interested any advantages pypng has over PIL (which I currently use for most of my PNG needs).
2009-03-16 at 13:47:34
@Thomas: Well for me, it has the advantage that I do not need to install PIL. Which I have tried to do in the past and failed. PyPNG is intended to be as simple as possible to install and deploy, hence pure Python.
2009-03-16 at 13:49:08
@Nick: Ah yes, I actually did the pypi thing. Shortly after writing this article. Probably would not have bothered if distutils didn’t have a command to do it.
2009-03-16 at 14:13:50
@Thomas: I have noted your concerns in Issue 9.
2009-03-16 at 14:15:37
I just added it as a comment to the 7th most “popular” issue for Google appengine. I.E. PIL being missing:
http://code.google.com/p/googleappengine/issues/detail?id=38
2009-03-16 at 14:19:45
@Drj11: Yes, I have found myself having to fiddle around to get PIL support for (e.g.) font rendering, but actually it too has pure Python support for PNGs. I’ll give pypng a try next time I’m poking around with PNGs.
2009-03-16 at 16:54:23
@Pádraig: Ouch, isn’t reading app-engine issues painful? Lots of people want thumbnails. I suppose I would too. Obviously I am intending to write a resize engine in pure Python (as a sister to png.py probably). But in pure Python it will be 200 to 1000 times slower than C (at a rough guess). Way too slow for production use.
2009-03-24 at 16:57:02
Would love to see it running under PyS60…