

This will be ignored if Flags.Braille is not set Value provided must // be between 0 and 255. This overrides Flags.Complex and Flags.CustomMapīraille bool // Threshold for braille art if Flags.Braille is set to true. Otherwise, problems may be encountered with colored or even uncolored braille art. SaveBackgroundColor int // Use braille characters instead of ascii. This will be ignored if Flags.SaveImagePath or Flags.SaveGifPath are not set This will be ignored if Flags.SaveImagePath or Flags.SaveGifPath are not setįontFilePath string // Font RGB color for terminal display and saved png or gif files.ğontColor int // Background RGB color in saved png or gif files. ttf file to use when saving ascii art gif or png file. This overrides Flags.Dimensions, Flags.Width and Flags.Heightįull bool // File path to a font. " // This overrides Flags.ComplexĬustomMap string // Flip ascii art horizontallyğlipX bool // Flip ascii art verticallyğlipY bool // Use terminal width to calculate ascii art size while keeping aspect ratio. Grayscale bool // Pass custom ascii art characters as a string. gif files as well // This overrides Flags.FontColor This uses the True color // codes for the terminal and will work on saved. This overrides Flags.Grayscale and Flags.FontColorĬolored bool // If Flags.Colored, Flags.Grayscale or Flags.FontColor is set, use that color // on each character's background in the terminalĬharBackgroundColor bool // Keep grayscale colors from the original image. This uses the True color codes for // the terminal and will work on saved. gif file, if gif is passed SaveGifPath string // Invert ascii art character mapping as well as colors Negative bool // Keep colors from the original image. png file SaveImagePath string // Path to save ascii art. txt file SaveTxtPath string // Path to save ascii art. Height int // Use set of 69 characters instead of the default 10Ĝomplex bool // Path to save ascii art. Setting this along with Flags.Width will throw an error Width int // Set height of ascii art while calculating width from aspect ratio. Setting this along with Flags.Height will throw an error This overrides Flags.Width and Flags.Heightĭimensions int // Set width of ascii art while calculating height from aspect ratio. #! /bin/bashĬonvert -font Courier -pointsize 6 tmp.// Set dimensions of ascii art. This will then just fit on the default page size as pre-defined from convert. The source is rendered to 160 character width at 6 pt. jpg is for JPEG) from an input JPEG-image. Both applications are likely to be available from your distribution's repositories.īelow sample script will produce an ASCII-art image (format depending on the extension we give. Again there are many options to fine tune the result. We then further process the resulting ASCII text file to an image using convert from the ImageMagick suite. The example below makes use of jp2a, a powerfull JPG to ASCII-art converter with many options to achieve desired results (consult the manpage). This can then also be incorporated in your batch processing script. In case you seem to be running Linux you may stitch the applications easily together to get the desired result.
Ascii image converter full#
The reason for wanting a command-line program is to batch process a folder full of images. Made by converting the source image to greyscale and then with the following command: img2txt -W 70 -f tga input.jpg > output.tga I'm also aware that libcaca can save its output to an image, but it only outputs colourful ascii, like below. However, the former cannot be done via the command line and the latter only lets you view the output, not save it (I don't want to resort to taking a screenshot of the output). I'm aware that GIMP has the ability to save an image as ascii art and aview can also convert an image to ascii.

The output that I desire from a program should be similar to this one, which was created by taking a screenshot of the output of an image-to-ascii converter (the output was pure text) To illustrate what I'm in need of, I want to convert the image below into ascii art Is there a command-line program (for Linux) that can convert an image to ascii art and then save that output as an image e.g.
