Add PNG writer code

To replace DevIL dependency