Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Convert ASCII art to PNG.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data/block_characters
example
lib
spec
Gemfile
LICENSE
README.md
ascii_paint.gemspec
logo.gif
tmp.rb

README.md

ASCII paint

Convert ASCII art to PNG.

Usage

text = "
 !!!!! @@@@@ $$$$$ %%%%% ^^^^^       @@@@@ $$$$$ %%%%% ^   ^ !!!!! 
 !   ! @     $       %     ^         @   @ $   $   %   ^^  ^   !   
 !!!!! @@@@@ $       %     ^         @@@@@ $$$$$   %   ^ ^ ^   !   
 !   !     @ $       %     ^         @     $   $   %   ^  ^^   !   
 !   ! @@@@@ $$$$$ %%%%% ^^^^^ !!!!! @     $   $ %%%%% ^   ^   !   
"
AsciiPaint.paint(text, 'out.png')

Configuration

Use AsciiPaint.config to define your personal painting style.

AsciiPaint.config do |config|
  config.character_width = 10
  config.character_height = 10
  config.color_map = { '!' => :blue, '@' => :red, '$' => :yellow }
end

You can also customize individual paintings by passing options to AsciiPaint.paint

AsciiPaint.paint(text, 'out.png', character_width: 10, character_height: 10)

Demonstration

ASCII paint logo

License

MIT

Something went wrong with that request. Please try again.