Archive for the 'games' Category

All Hail the Mighty PNGCRUSH

Among other things, I develop games for Flashbang Science. Earlier this week, I posted an update to our first game, Tubes.

Tubes

Tubes is Flash-based (written using the Flex SDK), but from very early on we wanted it to appear to integrate seamlessly with the web page in which it is embedded. This was fairly straightforwardly accomplished via CSS positioning and cutting the graphics to match.

But there was a problem under Safari for Windows, as well as both Safari and Google Chrome for OS X: the browser appeared to render the PNG (Portable Network Graphics) images on the page with less contrast than Flash rendered its graphics (which were cut from the same source, using the same tools, etc.), subtly but unmistakeably breaking the illusion of seamlessness.

After much searching, the solution was to use pngcrush to remove the gamma information, embedded ICC profile, and other ancillary colour information from the PNG images which surrounded the game on the page, as follows:

pngcrush -rem cHRM -rem gAMA -rem iCCP -rem sRGB input.png output.png

The above may seem self-evident to designers and others who spend a lot of time working with images on the Web, but this is the post for which I was looking when I searched for safari webkit flash colour difference.

Quit and start a new game. This counts as a loss in your statistics.

Playing around with the new version of Solitaire bundled with Windows Vista, and I find that, having saved a game (which I was fairly confident of winning – correctly so, it turns out), I find that everytime I restart the program, I am prompted to resume that same game. This, of course, results in a by-now-inevitable victory, each of which counts (seperately) to one’s overall running score.

This is the sort of .. ‘bug’ isn’t the word for it .. side-effect which can be difficult to unearth when you’re putting the software together but upon which a Random Other Person can land within minutes of using the product (if not instantly).



%d bloggers like this: