png packing put in function, use max_cores cpus