implementing lib png, this will be fun