Free Online Image Optimizer What it's for

Turning a photograph into ASCII art

ASCII art puts a picture where a picture cannot go: a README, a commit message, a server's login banner, an issue tracker that strips attachments. This walks through the three settings that matter, what the colour option really does to the text, and — the part most guides leave out — why some photographs come back as mush no matter what you choose.

Turn a picture into ASCII art →

Start with a picture that has somewhere to go

Drop one photograph on the ASCII page and press the button. There is no batch here on purpose: the result is text you read and paste, not a folder of files you collect, and twenty of them at once would be twenty things to scroll past rather than twenty things to use.

What you get back is a grid of characters, each one standing for a small square of the original. Darker squares get the heavier characters and lighter squares the sparser ones, so the picture is rebuilt out of density rather than colour. That is the whole trick, and it is also the limit: a hundred characters across is a hundred samples of information per row, and everything finer than that is gone.

The conversion happens on our servers rather than in your browser, which is different from the editing tools here. Your picture is sent, converted and deleted automatically after a short period.

The WURFL logo staged on the page, shown at full size beside the button that converts it, with its filename and dimensions underneath.
The picture before it becomes text. The same logo appears as characters further down, so you can see what the conversion actually did.

Width is counted in characters, and it is the setting that matters most

Every other width on this site is in pixels. This one is not: it counts characters across, and the height follows from the shape of your picture. A hundred suits a README comfortably. Forty is about right for a chat message. Three hundred holds real detail and is far too wide for most places you would paste it.

There is a trap here worth knowing before it bites you. Each line comes out exactly as many characters as you asked for, so a line wider than the window you paste it into wraps onto the row beneath — and once one row is split in half, every row after it is offset and the picture shears into nonsense. If it is going into a terminal, keep the width at or below what tput cols reports.

The character set beneath the slider changes the texture rather than the detail. Classic is the ramp you have seen in ASCII art before. Simple uses a shorter set that survives being pasted almost anywhere. Blocks uses shaded block characters and reads more like a picture than like text. Two characters is a stencil. The picture beside this is a logo, which is close to the ideal case: two flat colours, hard edges, and a shape that still reads when it is only sixty characters wide.

The WURFL logo rendered as coloured ASCII art at sixty characters wide, with the settings above it in two groups.
A logo is close to the ideal subject: flat colours, hard edges, and the shape survives at sixty characters. Colour is ticked here, which is why the figure says 41 KB.

The contrast slider, and why it is not automatic

A photograph with clear light and dark areas rebuilds well. One where the subject occupies a narrow band of brightness does not — a white building against a pale sky lands on two or three characters of a twenty-three character ramp, and the building disappears. The contrast slider spreads the tones apart so more of the ramp gets used.

It is a slider rather than something we decide for you because the trade is real and it goes both ways. Spreading the tones rescues a flat subject; on a photograph whose sky was already smooth, the same spreading turns that sky grainy. There is no single setting that is right for both, so the control is yours and the default is a middle that helps more pictures than it hurts.

What it deliberately does not do is change how bright the picture is. Spreading the tones normally darkens everything as a side effect, which reads as the picture getting dimmer rather than clearer — so the curve is shifted back to the brightness it started at, and the slider changes only the separation.

Getting it out, and into a terminal in colour

Copy hands you the plain text. Download gives you the same thing as a file named after your picture, and there is an HTML version as well.

The colour checkbox is the one that surprises people. It does not make the box prettier — it wraps every character in terminal escape codes. In a terminal those are invisible and each character is painted; anywhere that does not understand them, such as a README or an issue, they appear as litter like [38;2;140;98;71m, and the text becomes roughly twenty times longer. Leave it off unless a terminal is where this is going.

That is why the HTML download exists. Of the three ways this can leave the page, it is the only one where colour survives usefully: plain text has no colour to lose, escape codes only work in a terminal, and the HTML opens in any browser and can be sent to somebody. The file is self-contained, so it works from a disk with no network.

If a terminal is the destination, download the text and use cat. Plain less refuses the file as binary — you would need less -R. Tick the dark background option too, since a terminal is dark and without it you get the negative.

The terminal instructions expanded, with one command for Linux, one for macOS and one for Windows, each naming the downloaded file.
The command per platform, with your file's real name in it — and the warning about width, which is the thing most likely to look broken.

Worth knowing

When a picture simply will not work

Some photographs cannot be rescued by any setting, and it is worth knowing why rather than working through the sliders looking for the one that fixes it. A busy scene, an evenly lit one, or anything whose subject is separated from its background by colour rather than by brightness has nothing for a density ramp to hold on to. Faces close up, strong silhouettes and simple objects on plain backgrounds all read well; a crowd, a landscape at midday and a flat-lit product shot generally do not.

Widening helps up to a point and then stops helping, because past a couple of hundred characters the block of text is too wide to paste anywhere it would be read.

Turn a picture into ASCII art →

Next: How to turn a PDF into images · How to convert JPG to WebP · How to put a caption on a picture