Tips for golfing ASCII art I think the ASCII art questions on PPCG are fun to do, but personally I think it can be pretty hard, especially when the question is tagged as code-golf.

I wonder if anyone here might have some tips that will be useful for producing ASCII art.

Simply arranging characters is easy, but with (short) algorithms, things will become more complicated.

I'm talking about ASCII art like:  


Text to ASCII art (characters)  
Images (logos or icons)


I'm just looking for general tips, but language-specific is allowed since most of them can be translated anyhow.
Compression algorithms

You can apply LZMA compression to the string.
Many languages support it.

Run-length encoding

You can use processing instructions such as [char][number] (e.g. b12).
This compression algorithm is used here: https://codegolf.stackexchange.com/a/20589/10920

Further reading: http://en.wikipedia.org/wiki/Run-length_encoding

Integer packing

You can use arrays of integers to store small shapes such as:

// This is an invader!
// (SE line height makes it looks awful)
// ~158 characters

    ##          ##    
      ##      ##      
    ##############    
  ####  ######  ####  
######################
##  ##############  ##
##  ##          ##  ##
      ####  ####       


Each space will be translated into a 0.
Each sharp will be translated into a 1.

// ~58 characters
// Saved ~100 bytes!
[
  196656,  49344,   262128,  999228,
  4194303, 3407859, 3342387, 62400
]


Each bit is then read using bitwise operator &amp;.

The above algorithm could be improved by using a bigger integer base:

// ~44 characters
// Integers are in base 36.
// Use `_` as a separator (or a line break).
"47qo_122o_5m9c_lf0c_2hwcf_211ir_1zn03_1c5c"