open O, '>:raw', $fname or die $!; print O $im->png; close O; system $fname;