Skip to content
Image with logo, providing a link to the home page
  • United Stated of America flag, representing the option for the English language.
  • Bandeira do Brasil, simbolizando a opção pelo idioma Português do Brasil.

Text to PPM Image Converter

Text to PPM Image Converter

Online tool to convert ASCII encoded text into an image with random colors in the (text) PPM format.

The system implements a suggestion from the section Possible Improvements and Variations from the topic Learn Programming: Files and Serialization (Marshalling).

The file is processed locally, in the browser. Thus, the chosen file is not sent to a remote server.

Instructions

To use the converter, you must write a text in the field after the label Enter the text to convert to an image. The text may have line breaks.

Only characters presented in the topic will be converted from text to the image. In other words, only part of the values belonging to the ASCII table are accepted. Characters with accents or other special symbols will be replaced by spaces.

If the option Multi-line text? is checked, the resulting image will use the line breaks from the text to create an image with higher height. Otherwise, the lines will be replaced by spaces in the resulting image.

If the option Download the resulting image? is checked, the system will provide a download dialog with the generated PPM file. It is also possible to save the image in PNG format by choosing the option to save the image in the context menu (for instance, you can right-click the image and choose the option Save Image As...).

If you uncheck the option to download the file and keep the same text, it is possible to press the button Generate image repeatedly to generate new images in sequence. To perform this with greater ease, an alternative is keeping the focus on the button and holding the Enter (Return) key in the keyboard. As the result, the pixels in the image will change color every time the contents are recreated.

Program


Image

The created PPM image displayed in the canvas.

Scaled Image

A magnification of the created PPM image displayed in the canvas.