Fix R/B swap with as_png(); support as_png() for any pixel format.