in reply to Re^2: working with png data
in thread working with png data

the time is wasted in :
$pdata |= ~$png->wbmp($_) foreach (@col);
the while loop with the sprintf is not the bottleneck. (maybe not optimal, but contribute less)