Updated for direct png output