What is "img2txt"?

"img2txt" is a free web API. You can do the following:

How do you use it?

It is easy to use the "curl" command. Call WebAPI with the "curl" command.

WebAPI endpoint URL

https://img2txt.genzouw.com

"url" query string Required )

Specify the URL of the image file you want to convert.

This query string is required.


# If you want to convert the following image file URL to ASCII art
# * https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
          

The following ASCII art should be displayed in the terminal.

"tl" / "tr" / "tt" / "tb" query string

You can also trim the output.

"tl" query string : Specify a numeric value. Remove N columns from the left.

"tr" query string : Specify a numeric value. Remove N columns from the right.

"tt" query string : Specify a numeric value. Remove N lines from the top.

"tb" query string : Specify a numeric value. Remove N lines from the bottom.


# Delete 10 columns from the left
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png&tl=10'
          

# Delete 10 rows and 10 columns
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png&tl=10&tr=10&tt=10&tb=10'
          

"w" query string

You can also specify the “Zoom” of the ASCII art to be output.

You can specify a value between 1 and 200% for the magnification.


# Output in half size
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png&w=50'
          

# Output in 1.2 times the size
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png&w=120'
          

"c" query string

By default, "@" is used for the ASCII art string, but you can use any character with the "c" query string.


# Try using the "?" Character
$ curl -sS 'https://img2txt.genzouw.com?url=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png&c=?'