in reply to Add text to image

You set binmode STDOUT; when I think you meant to set binmode FILE;.