Imagem do Google para texto

perhaps the question asks to convert an image into binary encoded as text.

in that case, please refer to the question
 
or Google "image to base64 javascript"
ruperto2770