added optional paletted png output