encode text into an image