Fixed PNG encoder for all pixmap formats.

#2501