Fleshing out (still incomplete) PNG code