Add overloaded encodeAsPNG with more options