_.;;;;I==II~. .~:;::`` ~I=++iI. .~;;II=I:~`` `.~Ii==I._ .~IiiiiII;~^` ``.~::::~:::;II:\ ``.:IIII~~¨``...~~.``` .~;io8EE#8E8oi=:~.``` ````````.:=i+Oo+iII:` _-^:OE##8=::E8OOE#88~ `~i8EE##E#EE###E+=;:.:` ^:iO++Oo` :..=iO+`~. ~=; :I ++i:= i##OO; ~+Ooi:~~=+OO=:i+OO. `I=.` ~IOo+oI:ii.-` \~Ii=+iiooOi=IIi+` I8+==ioooo++i=I;:;^ ``.~..~`.` `.`.~~~.~..`~` ^ ``` `````` Image to Ascii Art 1.0 Beta 1
About Image to Ascii Art
Using the program
2.1 Compiling (Optional)
2.2 Basic use
2.3 Left panel options
2.4 The top bar buttons
Configuration files
3.1 cfg.tx
3.2 Language files
3.3 cowlist, fontslist and emoteslist
Command line tool
License(s)
Changelist
Image to Ascii Art converts images to text using the original 127 ascii
characters. It also includes fonts, emotes lib and other tools used to create
new ascii Art.
I started writing this program one saturday morning, when I was trying Lazarus
in my (back then) new netbook. One hour later I had the first version (0.0.1).
I started to use it almost inmediately to send ascii pictures over IM
messages. Since then I've spent some time improving the program, correcting
mistakes and adding new features
The program is under the GPL, Version 2, that means you can run it, copy it,
modify it and even distribute modificatios (With some restrictions, read the
GPL License that should be distributed with it). Some parts of the program may
be under different licenses (Read the Licences chapter near the end of this
document).
This version doesn't need to be installed. To run the program just unzip it into
a folder and launch the exec. Right now there are two exec packages: Linux 32
bit and Windows 32 bits.
2.1 Compiling (Optional) ------------------------ To compile the program you will need the lazarus/ FreePascal Compiler. It can be fond at: http://lazarus.freepascal.org/ Lazarus requires Free Pascal and Free Pascal sources to work. Both packages are available at the same URl and should be installed first. The sources for Image to Ascii Art can be found at: http://imagetoasciiart.sourceforge.net/ Just download, open the project file with lazarus and run it. Version 1.0.12 of Lazarus was used, but later versions and some older versions should be able to compile the program too. There are two folders. One has the main program while the other one has the command line program. Each one has to be opened and compiled separatedly. 2.2 Basic use ------------- This program is most oftenly used in a few simple steps. a) First open an image file using the open file button, or by dragging it into the program window from the file explorer. b) Use the left panel to adjust the parameters like size, brigthness, contrast, character palette, etc... c) Use the tool palette and the text editor to perform some additional adjustments, like moving the image to the right, adding a frame or cropping the image. The tool palette can be made visible by using the tool palette button (c1). d) Save the results or copy them to the clipboard. Images can be saved both as text or as an image. The open file button is located at the top-left part of the window (a). The left panel controls the rendering options (b). The tool bar button (c1) shows/ hides the tool bar (c). The text editor with the rendered image is located at (d). When using html modes, this area will include an html viewer too.
|########################################################### | a) c1) | +-----------+--+-------------------------------------------+ | |c)| | | | | | | | | | | | | | | b) | | | | | | | | | | d) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------+--+-------------------------------------------+
2.3 Left panel options. ----------------------- Most of this options are the parameters used to render the image. Changing them will modify how the image is rendered: 2.3.1 Inverted display When checked changes background from white to black. Text palette is inverted too. 2.3.2 Max Width (x) This parameter limits the maximum width (In chars) of the text image we create. 2.3.3 Y factor While pixels are usually square (height=width), characters are usually taller than wider. This factor is used to correct that difference. 2.3.4 Palette. Choose the palette to use to render the image. There are different kind of palettes: Text modes. Different char palettes are used to represent different grayscales: 2 Shades text 2 Shades text (Binary, that is with "0" and "1") 4 Shades text 7 Shades text 9 Shades text 16 Shades text 70 Shades text
.+*#*: =#@@@@* @@@@@@@@@ *@@@@@@@@# @@@@@@@@@@@@ @@@@@@@@@@@# @@@=..+==+*: #@@@ .+*+:* .%= . +@ * *+ *@@@@@ *.: .*@@@@@: .+ +@%%#%+ =# *%#*@: * ..:**# @= .:@ *@@: #@ +@@@#* =@@# #@ @@@%+. %@@@@@ %@@@@@@@ %@@@@@@ @@@@@@@@ @@@@@@@@@ @ @@@@@@@@@ :@@@@@@@@ = #@@@@@@@@@ @@@@@@@@@@%+ @@@@@@@@@@ @@@@@@@@@:+. @@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@= :@@@@@@@@@@ :@@@@@@@@@@@ #@@@@@@@@@@@@@@@@@@@@@@@% @@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@+ *@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ :@@@@@@@@@@@@@@@@@@@@@@@@@ =@@@@@@@@@@@@@@@@@@@@@@# @@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@+ #@@@@@@@@@@@@@@@@@@@@@ *@@@@@@@@@@@@@@@@@@ :@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@= @@@@@@@@@@@@@@@@@@: @@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@= @@@@@@@@@@@@@@@@ *@@@@@@@@@@@@@@@ *@@@@@@@:@@@@@@@ @@@@@@@@:@@@@@@@ :@@@@@@@ @@@@@@* :%:@@@@@@ @@@@@@@ #@@@@@@@ %@@@@@ %= %@@@@@ @@@@@@ % @@@@@# @@@@@. % @@@@@ *@@@@@@ *: #@@@@. %@@@@@ %. %@@@@ @@@@@@ @ @@@@ @@@@@@ @ @@@@@+ @@@@@@ =+ %@@@@% +@@@@@ % @@@@@= @@@@@+ @ .@@@@* @@@@@ @ @@@@: @@@@@ =+ +@@@@ .@@@@ @ %@@@@: +@@@@@ % @@@@@ @@@@@: .% @@@@@ @@@@@#: .. ++ @@@@* @@@@@ .. @ @%@%@**%@@ @@*###%%%%% @@@@@#**@@% @@#*%#%%% Thompson and Thompson, 64 pixels width, 9 gray textmode
Edge detection. Use these to get a sharper picture: TEXT edge detection (Detects edges in the image) TEXT lines (Uses lines made of text to draw the picture) Emote modes Uses emote/emoji icons to render the image. These are experimental right now: Emoji UTF8 codes emoji Emote codes. Html table modes. Table cells are used to represent each pixel: HTML table (Color). Each pixel of the image is represented by a cell of a table. HTML table (Shorter). Same as HTML Table, but uses some methods to make the html code shorter. It uses 4096 colors only (Instead of 24 bits), and empties cells with the same color as the background. Html color text: HTML changing the color of the '#' character. Uses whitespaces to make the text shorter. 2.3.5 Brigthness & contrast controls You can adjust brightness and contrast to get sharper images. 2.3.6 Monospaced fonts only Changes the fonts available on the font dialog. This works only on some desktop enviroments. 2.3.7 Clipboard bg as in IM This only affects the background of the "copy as image option". 2.4 The top bar buttons ----------------------- Toolbar buttons perform basic actons, like opening and saving files, copy the text to the clipboard, showing the tool bar, showing the cowsay window, etc... 2.4.1 Open file button. Shows the 'Open file' dialog. 2.4.2 Select font button. Displays the 'Select font dialog'. 2.4.3 Save text as a text-file button. Opens the save image as text dialog. 2.4.4 Save text as image button. Opens the save as image dialog. The program saves files as BMP bitmap files. 2.4.5 Show/Hide the tools panel. This button shows or hides the tools bar. The tool bar buttos will perform additional operations with the text: a) Horizontal flip. Reflects the text image horizontally. b) Vertical flip. Reflects the text image vertically. c) Rotate 90º. It can be used more than one time to rotate the image 180º and 270º. d) Move text to the right. Adds a column of text, moving the text image to the right. e) Crop left. removes the first column of the text. f) Crop right Removes the last column of the text. g) Add a frame. Adds a frame to the image. There aren't any buttons to crop from the top / bottom or add rows, as this actions can be easily done from the text edit area.
/--------------------------------------\ |/------------------------------------\ | We've cropped out one of || || the Thompsons using the || || tool bar buttons. || .+*#*: || || @@@@@@@@@ || This tools should be used || @@@@@@@@@@@@ || with the text modes only, || @@@=..+==+*: || as html tags and emote || .%= . || codes would be broken || *+ *@@@@@ || if we start cropping. || .+ +@%%#%+ || || * ..:**# || || *@@: #@ +@@@#* || || %@@@@@ %@@@@@@@ || || @@@@@@@@@ @ @@@@@@@@@ || || @@@@@@@@@@%+ @@@@@@@@@@ || || @@@@@@@@@@@@@@@@@@@@@@@= || || #@@@@@@@@@@@@@@@@@@@@@@@% || || @@@@@@@@@@@@@@@@@@@@@@@@@+ || || +@@@@@@@@@@@@@@@@@@@@@@@@@@ || || @@@@@@@@@@@@@@@@@@@@@@@@@@ || || =@@@@@@@@@@@@@@@@@@@@@@# || || @@@@@@@@@@@@@@@@@@@@+ || || *@@@@@@@@@@@@@@@@@@ || || @@@@@@@@@@@@@@@@@@ || || @@@@@@@@@@@@@@@@@@: || || @@@@@@@@@@@@@@@@= || || *@@@@@@@@@@@@@@@ || || @@@@@@@@:@@@@@@@ || || :%:@@@@@@ @@@@@@@ || || %= %@@@@@ @@@@@@ || || % @@@@@ *@@@@@@ || || %. %@@@@ @@@@@@ || || @ @@@@@+ @@@@@@ || || % @@@@@= @@@@@+ || || @ @@@@: @@@@@ || || @ %@@@@: +@@@@@ || || .% @@@@@ @@@@@#: .. || || @ @%@%@**%@@ @@*###%%%% || || || |\------------------------------------/ | \--------------------------------------/
2.4.6 Copy text to clipboard button. Does exactly that. 2.4.7 Copy text as an image button. Creates an image with our text image, using the current font, font size and colors. The image stored in the clipboard should look exactly as the one shown in the text editor. 2.4.8 Cowsay button. Displays the cowsay dialog, that can be used to show a cow (and other creatures) saying or thinking whatever we want:
_______________________________ / This is an example of cowsay. \ | Text can have as many lines | \ as we want... / ------------------------------- \ ^__^ \ (oo)\\_______ (__)\\ )\\/\\ ||----w | || ||
Cowsay cows are from the original cowsay program (See the licenses chapter to know more about it. The engine has been re-written, so there is no need to install Perl+cowsay. 2.4.9 Emotes button. Shows the emotes library dialog. This are pre-defined images of emotes and symbols taken from the Gnome theme. Emotes will be rendered using the options from the left panel.
#MMMM# :MEEEEE#M: =MEE####EEM= OMEE######EEMO `M#E########E#M` MMEE####II####EEMM MMEE####IIII####EEMM MMEE####III;;;####EEMM MMEE####III;;;;;####EEMM MMEE####III;;;;;;;#####EMM MME#####III;;;;;;;;;#####EMM MME#####III;;;;;;;;;;;#####EMM `MMEE###iIII;;MMMMMM;;;::I###EEMM` .MMEE###III;;;;MMMMMM;;::::;####EMM. :MEEE###III;;;;;MMMMMM::::::::####E#M: iMEE####III;;;;;;+MMMM#::::::::~####EEMi M#E####iII;;;;;;;;MMMMi:::::::~~I####E#M .M#E####=II;;;;;;;;;MMMM:::::::~~~~:####E#M. :MEE####II;;;;;;;;;;;MMMM:::::~~~~~~~~####E#M: =MEE####II;;;;;;;;;;;:::::::::~~~~~~~~..E###EEM= MM#E####II;;;;;;;;;;;;:+MMi:::~~~~~~~~~...####E#MM MM#E####II;;;;;;;;;;;::MMMMMM:~~~~~~~~......####E#MM MMEE####II;;;;;;;;;;;:::MMMMMM~~~~~~~~........####EEMM MME#####I;;;;;;;;;;;;:::::::::~~~~~~~~........``E####EMM #MEE####II;;;;;;;;;;;:::::::::~~~~~~~~.........```#####EM# MMEE####I;;;;;;;;;;;;::::::::~~~~~~~~~........`````.#####EMM .MEE#######################################################EM. MMEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM One sign from the emotes library
2.4.10 FIGlet fonts dialog. Displays the figlets fonts dialog. Right now only a few fonts are available, and smushing doesn't work. To get better results use the original FIGlet program (See the licenses chapter).
______ _____ _____ _ _ | ____| |_ _| / ____| | | | | | |__ | | | | __ | | ___ | |_ | __| | | | | |_ | | | / _ \ | __| | | _| |_ | |__| | | | | __/ | |_ |_| |_____| \_____| |_| \___| \__| __ _ _ / _| | | | | | |_ ___ _ __ | |_ ___ | | | _| / _ \ | '_ \ | __| / __| | | | | | (_) | | | | | | |_ \__ \ |_| |_| \___/ |_| |_| \__| |___/ (_)
2.4.11 Display Ascii and Palettes button. This option shows an ascii table and the Ascii palettes used by the program in the text editor. 2.4.12 Show configuration button. This button loads the configuration file into the edit window. Don't worry, unless you save them with the "Save as text" button, any change won't be permanent. See next chapter to see how the configuration file works. 2.4.12 Show help button. Displays the helpfile on the text editor. 2.4.13 About button. Shows the 'About' dialog.
These files control how the program works. Do not touch them unless you don't
mind if the program malfunctions.
3.1 cfg.txt
This file has the following format:
a) Lines starting with '#' are comments.
b) Empty lines won't be interpreted.
c) Content lines have the following fomat:
parameter = value
An exammple of this config file would be:
/-------------------------------------\ | | | # C O W S | | cowdir = cows | | cowlist = cows.txt | | | | # H E L P | | helpfile=documentation/README.txt | | | | # F I G l e t | | fontsdir = fonts | | fontslist = fonts.txt | | | | # E M O T E S | | emotesdir = emotes | | emoteslist = emotes.txt | | | | # L A N G U A G E F I L E | | #langfile = documentation/espa.txt | | | | # C O L O R S | | #Background color (All windows) | | # $ for hex values (BBGGRR) | | bgcolor = $ED8C00 | | | \-------------------------------------/
Cowdir, fontsdir and emotes dir are set relative to the program's folder. The
list files and should be inside those folders. The program may not work
properly if these values are not set or have wrong values.
The helpfile includes the location path and the filename of the helpfile. It
needs to be set to a text file.
The language file is used to translate the program to different languages.
Right now, is English by default. To set it to Spanish uncomment the line:
# langfile = documentation/espa.txt
To use the translated help file you will also need to change the helpfile to:
helpfile = documentation/LEEME.txt
3.2 Language files
The language uses the same format as the configuration file to describe the
text strings in the program.
3.3 cowlist, fontslist and emotes list.
This files are just plain text files with the list of cows, fonts and emotes.
Image2txt is a command line program that has many of the features of the
program. The output goes directly to the console.
The options are the following:
-h or --help Displays the helpfile.
-f or --file selects the file to convert.
-w or --width selects the maximum width of the text output.
-m or --mode chooses the rendering mode (see modes below)
-y or --factor Chooses the aspect ratio between height and width
-i or --inverse Changes background to foreground.
The only value that is really needed is the file to convert. All other
parameters will be set to default if they are not specified. The default values
are: width=80, mode=4 and factor=0.5 . Inverse is disabled by default.
Examples
img2txt -f test.jpg
img2txt -f test.jpg -w 80 -m 5 -y 0.5 -i
img2txt --file=test.jpg --width=80 --mode=5 --factor=0.5
Modes and palettes
0> 2 shades : @
1> 2 shades(B): 01
2> 4 shades : @.
3> 7 shades : @8Oo:.
4> 9 shades : @%#+=:.
5> 16 shades : M#E8Oo+i=I;:~.6> 70 shades : $@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+
~<>i!lI;:,"^
.
Image to Ascii Art is under the GPL v2. Image to Ascii Art is (c) 2010-2013 by
Enrique Enrique González Alonso-Buenaposada. The GPL2 should be included
in the documentation of this program.
Source code and other files for this program can be found at:
http://imagetoasciiart.sourceforge.net/
Other programs, images, and code included in this project are under the same
license, or licenses that allow them to be used in this program:
Cowsay cows are from the program "Cowsay", Copyright (c) 1999 Tony Monroe.
Cowsay is under the GPL (Doesn't say which version).
FIGlet fonts are from FIGlet (http://www.figlet.org/), a program by John Cowan
and many contributors (http://www.figlet.org/contrib.html). The font files
should include the author name and other data. I am not using FIGlet, but the
fonts and specifications are probably under the same licenses as the program:
(Academic Free License 2.1 and The New BSD License)
Most icons and emotes are from the Gnome project(http://tango.freedesktop.org/),
which is also under the GPL (v2). Some other icons are from the Silk Icon Theme
(by Mark James http://www.famfamfam.com/lab/icons/silk/) which is under a
Creative commons Attribution License.
The Compiler and RAD used to write this program (Free Pascal and Lazarus) are
both under GPL licenses (GPL2 and LGPL).
Version 0.0.2
Version 0.0.1 Wouldn't compile in windows ¿Maybe some file was missing? Problems using function strToFloat in Laz Versions V> 0.9.28 README.txt added. Window title changed.
Version 0.0.3
Some minor modifications to the interface. Added some HTML modes. Added binary (0-1) mode. Added additional h/w ratios.
Version 0.0.4
Added Save text file button. Added hints on components, now in English. Minor text corrections on dialogs. More complete palette descriptions. Added html color text mode. Added <html> </html> tags to html modes. Controls are now disabled while rendering.
Version 0.0.5
Width Control edit bug solved. New widths added (16,48,64,80,96) Y Factor control bug solved: Now it's readonly. Palette control bug solved: Now it's readonly. Now the output text displays warnings and errors. Enabled hints on Y factor and Palette. Corrected hints on main bar buttons. Corrected bug on save dialog. Separation lines are now thicker. Added a 'show only monospaced fonts' option. Save text as image added (Works fine with monospace fonts) New version of the compiler used (1.04) Updates to the README.txt file Default font in memo is set to Courier New
Version 0.0.6
Changed icons to Gnome 3.8 icons slightly modified: Save as text and save as image icons are now different. Window title now includes last file opened name. Images don't need to be reloaded when settings are changed. Fixed bug: Save as image button now gets disabled while rendering. Hint added to Monospaced Fonts checkbox. Inverted (White over black) display option. Copy text to clipboard button added. Fixed bug: 2 shades text. Manual modified and slightly corrected. Cowsay added! Still on experimental stage.
Version 0.0.7
Images can be dropped into the main window. Check if there is a problem opening the file. Brightness & contrast adjust. Fix: Some controls were still enabled while rendering. Fix: Text doesn't move when redrawing (Selstart is put to 1). Text is created in memory (Faster). Readme file updated. Working interface redone (Requires less space). Corrected some project headers (Source code)
Version 0.0.8 - 0.0.9
This version(s) include a lot of improvements: Documentation translated into Spanish. Added instructions to compile using Lazarus in the Documentation. Switched to a more recent version of the compiler (from 1.0.4 to 1.0.12). Reset Brightness/Contrast when clicking on Bightness/Contrast icons. Luminosity method added for grayscaling. Added a display Ascii table / Palettes button. Added About window Added a GPL V2 License text file in the file folder. Fixed "Save as image" with the inverted display option enabled. Added a 7 shades palette. Added a detect-border text mode. Added a text-lines mode. Correction: 10 shades palette is really a 9 shades palette Added larger than 1 aspect ratios (1.1, 1.2, 1.5, 2.0) Added progressbar on rendering process. Changed window color to clBackground (Seems to work better on different platforms) Size of the executable has been reduced (40mb --> 6mb mb)
Version 1.0 beta.
Big release with many new features that need to be tested and fixed.
Fixed - Color is not clBackground anymore (Problems in win) Fixed - Transparent background mixes images on Transformed image. - Transparent backgrounds rendered as black on Transformed image. (PNG transparency) Fixed - Undesired borders on exported images. Fixed - Forgot to disable new buttons during the render process in V. 0.9 Fixed - Select all text button now uses the clipbrd unit (doesn't need text selection anymore, works better in Linux). Fixed - Comboboxes in cows window are now readonly Fixed - Save as image won't work in html and emoji modes. Not really useful and may create huge bitmaps. A message explaining this will be shown instead. Fixed - Copy text as image no longer works in html and emoji modes, as it creates huge bitmaps and it's not really useful. A message explaining this is displayed. Cleared the working directory: Moved cows to their own directory. Moved test images to their own dir. Moved documentation files to their own dir. Moved Icons to their own dir. Added demo images to their own dir. Added help button (Displays README.txt or other helpfile) Added Copy to clipboard as Image button. Added config file with program options. - Language suport - Background color - Helpfile selection. Added FIGlet fonts -> Incomplete / No smushing yet Added a command line tool that converts texts to txt. Modified cowsay button icon The image load picture is now hidden Added Emotes lib from Tango Icon Theme. Updated and Corrected documentation files, added new documentation. Added Clipboard background as in IM option. Added text manipulation options: - Flip horizontal. - Flip vertical. - Rotate 90º - Indent (Left side) - Crop (Left side, right side) - Add frame Added 0.2, 1.8 and 2.5 x/y zoom factors Added language suport. Right now it is set to English by default, with the possibility to change it to Spanish. Added a button to view/ Edit configuration file. Added a preview to HTML modes. HTML table mode uses style instead of bgcolor in table cells, as bgcolor is not valid in html5 HTML Text mode uses bold tags and style instead of font tags, it's Only 1 char per pixel longer, and font tag is (in theory) no longer valid in html 5. HTML Short table has further optimizations to make it shorter. Not HTML5 correct, but seems to work. HTML Colored text has some optimizations to shorten the generated code.