ASCII Mandelbrots - Post 'Em!

Here's your chance to show us what you can do. Write a program to create an ASCII Mandelbrot and post away!

@@@@@@@@@@@@@@@@@@@8888888888888888888888888888888888888888888888888888888888888
@@@@@@@@@@@@@@@@@888888888888888888888888888888888888888888888888888888888888888
@@@@@@@@@@@@@@@88888888888888888888888888888888888888888888888888888888888888888
@@@@@@@@@@@@@8888888888888888888#############################8888888888888888888
@@@@@@@@@@@@88888888888888#########################################8888888888888
@@@@@@@@@@888888888888#################################%%%%%############88888888
@@@@@@@@@8888888888##################################%%%%S%%%%%############88888
@@@@@@@@88888888###################################%%%%%%S=S%%S%%#############88
@@@@@@@888888####################################%%%%%%%%SS=SS%%%%##############
@@@@@@88888#####################################%%%%%%%SSS+ =S%%%%%%%###########
@@@@@8888####################################%%%%%%%%SS+=   .==S%%%%%%%%########
@@@@888###################################%%%%%%%%%%%S+-      =+%%%%%%%%%%######
@@@888#################################%%%%%%SS%%%%SSSS=      SSSSS%%%%%%%S%####
@@888#############################%%%%%%%%%S==S+SS=-= .        . S-=SS%SSS=%%%##
@@88#########################%%%%%%%%%%%%%%S-   =                    S=-+-=S%%%#
@88#####################%%%%%%%%%%%%%%%%%%SSS=-                           S%%%%#
@8##################%%%%%%%%%%%%%%%%%%%%=++--                           +SS%%%%%
8################%%%%%S%%%%%%S%%%%%%%%%SSS.                               SSS+%%
###############%%%%%%%SSSSSSSS=SS=SSSSSS=.                                  SS%%
############%%%%%%%%%%SSS= +== +=+SSSSSS.                                  +S%%%
###########%%%%%%%%%%SSS=+          =SS=                                   .=%%%
#########%%%%%%%%SSSSSS=              =                                    -%%%%
#%%%%%%%%%%%%%%%SS===-=                                                   =%%%%%
%%%%%S+SSSSS=SS===.                                                     SS%%%%%%
%%%%%%S%%%%%%%%SS==+  =                                                  +S%%%%%
########%%%%%%%%%SSS=S=               =                                   =S%%%%
##########%%%%%%%%%%SS+==            ==.                                   SS%%%
############%%%%%%%%%%SS++ +      =-SSS+                                   .S%%%
##############%%%%%%%%SSS=SSSS=+SSSSSSSS=                                  SS%%%
8###############%%%%%%SS%%%%%SS%%%%%%%%S++                                --SS%%
8##################%%%%%%%%%%%%%%%%%%%%%S=                               -=%%%%%
@8#####################%%%%%%%%%%%%%%%%%SSSS+.                         +.SS%%%%%
@88########################%%%%%%%%%%%%%%%%S=.                       ++  +SS%%%#
@@88############################%%%%%%%%%%%=S.=-SS+              + +SSS=SS=S%%##
@@@88################################%%%%%%SSSSSSS==SSSS.    =SS-SSS%%%%%%S%%###
@@@8888##################################%%%%%%%%%%%%SS=      -S%%%%%%%%%%%#####
@@@@8888####################################%%%%%%%%%SS+     +-S%%%%%%%%%#######
@@@@@88888#####################################%%%%%%%S=SS  -SSS%%%%%%##########
@@@@@@888888#####################################%%%%%%%%SS SS%%%%%#############
@@@@@@@88888888###################################%%%%%%%SSSS S%%##############8
Mandlebrots are cool but they're not furry, cute and deadly all at once.


                              _,add8ba,
                            ,d888888888b,
                           d8888888888888b                        _,ad8ba,_
                          d888888888888888)                     ,d888888888b,
                          I8888888888888888 _________          ,8888888888888b
                __________`Y88888888888888P"""""""""""baaa,__ ,888888888888888,
            ,adP"""""""""""9888888888P""^                 ^""Y8888888888888888I
         ,a8"^           ,d888P"888P^                           ^"Y8888888888P'
       ,a8^            ,d8888'                                     ^Y8888888P'
      a88'           ,d8888P'                                        I88P"^
    ,d88'           d88888P'                                          "b,
   ,d88'           d888888'                                            `b,
  ,d88'           d888888I                                              `b,
  d88I           ,8888888'            ___                                `b,
 ,888'           d8888888          ,d88888b,              ____            `b,
 d888           ,8888888I         d88888888b,           ,d8888b,           `b
,8888           I8888888I        d8888888888I          ,88888888b           8,
I8888           88888888b       d88888888888'          8888888888b          8I
d8886           888888888       Y888888888P'           Y8888888888,        ,8b
88888b          I88888888b      `Y8888888^             `Y888888888I        d88,
Y88888b         `888888888b,      `""""^                `Y8888888P'       d888I
`888888b         88888888888b,                           `Y8888P^        d88888
 Y888888b       ,8888888888888ba,_          _______        `""^        ,d888888
 I8888888b,    ,888888888888888888ba,_     d88888888b               ,ad8888888I
 `888888888b,  I8888888888888888888888b,    ^"Y888P"^      ____.,ad88888888888I
  88888888888b,`888888888888888888888888b,     ""      ad888888888888888888888'
  8888888888888698888888888888888888888888b_,ad88ba,_,d88888888888888888888888
  88888888888888888888888888888888888888888b,`"""^ d8888888888888888888888888I
  8888888888888888888888888888888888888888888baaad888888888888888888888888888'
  Y8888888888888888888888888888888888888888888888888888888888888888888888888P
  I888888888888888888888888888888888888888888888P^  ^Y8888888888888888888888'
  `Y88888888888888888P88888888888888888888888888'     ^88888888888888888888I
   `Y8888888888888888 `8888888888888888888888888       8888888888888888888P'
    `Y888888888888888  `888888888888888888888888,     ,888888888888888888P'
     `Y88888888888888b  `88888888888888888888888I     I888888888888888888'
       "Y8888888888888b  `8888888888888888888888I     I88888888888888888'
         "Y88888888888P   `888888888888888888888b     d8888888888888888'
            ^""""""""^     `Y88888888888888888888,    888888888888888P'
                             "8888888888888888888b,   Y888888888888P^
                              `Y888888888888888888b   `Y8888888P"^
                                "Y8888888888888888P     `""""^
                                  `"YY88888888888P'

Do we have to write the code to generate the fractal, then write the code to convert it to ASCII art? Or can we just write the code to take an existing fractal and convert it to ASCII art?
@quirkyusername

That's so cool! I'm actually laughing a bit.
No takers?
What's 1st place prize?
################################################################################
################################################################################
###########################################################P' ^#################
#########################################################P      J###############
##########################################################     .J###############
#####################################################PTP^^^    ^^^^#PT##########
################################################  '''                'T#P'^T####
###############################################T                       '  .J####
############################################L^^                           T#####
#############################################'                             T####
#############################T####T########L                                .J##
############################# ]^'' '^TT###^'                                 T##
###########################^^           T#'                                 .J##
###########################              T                                  T###
#######################'^'[              '                                ._####
###L___________________   .                                             '^T#####
#######################J#JL              ]                                  T###
###########################             .#                                  T###
############################# .      .._##'                                  ]##
#############################.J#JL.J#######L                                .###
###########################################L_                              ._J##
#############################################'                            .#####
############################################L##.                          T#####
################################################                      .J.  ]####
################################################__LLJ...           _.]###J######
##########################################################^    T################
#########################################################P      J###############
##########################################################_.   _J###############
############################################################L_##################
################################################################################

At first I just did it the primitive way and it looked somewhat hideous. Maybe I chose my constants poorly, maybe it was due to me spectrum of symbols used, maybe something else. Any way, I then decided to only work on the outline. I divide each position in four parts, check which of them are (not) in the set, and print an appropriate character. Though I still think yours looks better..
Nice! It can be tricky. I first wrote one using the complex type but it seemed to have "noise" around the set. The one above just uses doubles for the real and imaginary parts.

Making it adjust to center the viewing window on a single point and scaling was the part that I spent the most time on. I still don't think the zoom factor is* implemented right but I'm done messing with it for now.

I'm centered on (-0.3, -0.8) in this one:
88#############################################888888888888888888888888888888888
#########################################################88888888888888888888888
################################################################8888888888888888
######################################################################8888888888
############################################################################8888
################################################################################
#################################################%%%%%##########################
############################################%%%%%%%%%%%%%%%#####################
#########################################%%%%%%%=SSS%%%%%%%%%%##################
#######################################%%%%%%%%%%S=S%%%%%%%%%%%%################
#####################################%%%%%%%%%%%%SSSSS%%%%%%%%%%%%##############
####################################%%%%%%%%%%%%%S===S=%%%%%%%%S%%%%############
##################################%%%%%%%%%%%%%%%%SSSSSSSSS=SSSS %%%%###########
################################%%%%%%%%%%%%%%%%%%%SSSS=SS=SS=S%%%%%%%%#########
###############################%%%%%%%%%%%%%%%%%%%%SSSSS=SSSSS%%%%%%%%%%%#######
#############################%%%%%%%%%%%%%%%%%%%%%SSSS==+SSSSS%%%%%%%%%%%%%#####
###########################%%%%%%%%%%%%%%%%%%%SSSS==+=====S=SS%%%%%%%%%%%%%%%###
#########################%%%%%%%%%%%%%%%%%%SSSSSSSSS=-   +=SSSSSSSS%%%%%%%%%%%%%
#######################%%%%%%%%%%%%%%%%%S=S=+=SSS====+   +=S=SSSS=S%%%%%%%%%%%%%
#####################%%%%%%%%%%%%%%%%%%%SSSSS+=+=+.       ..-=S===SS%%%%%%%%%%%%
##################%%%%%%%%%%%%%%%%%%%%%%%SSSS=+              -.-=SSS%%%%%%%%%%%%
###############%%%%%%%%%%%%%%%%%%%%%%%%%%SS=-=+               ==SSSS%%%%%%%%%%%%
############%%%%%%%%%%%%%%%%%%%%%%%%%%%%SSS==.                +=+SSS%%%%%%%%%%%%
########%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SSSSSSS-+               +=SSSSS%%%%%%%%%%%
####%%%%%%%%%%%%%%%%%S=S%%%%%%%%%%SSSSSSSSSSSS.              +=SSSSSSSSSSS%%%%%%
%%%%%%%%%%%%%%S=SSS=SS=SSSSSSSSSS===SSSSSSSSSS==.           .=SSSSSS-SSSSSS=SS%%
%%%%%%%%%%%%%%SSS==++=SSSSSSSSSS--++=SS-.==+.+-++.---. .-....-..= +=+.-SSS=++SSS
%%%%%%%%%%%%%%S+S===+=++=+-+SSSSS..  +..+                            -+--  .=SSS
%%%%%%%%%%%%%%SSSSS=+     =+SS=+=-+                                        -=SSS
%%%%%%%%%%%%%%SSSS-=+      .=..                                              + =
%%%%%%%%%%%%%%SSSS=+.      +                                                    
%%%%%%%%%%%%%SSSSSSS=+..                                                        
%%%%%%%%%SSSS=SSSS+=++                                                          
%%%%%%%S=SS=+=SSS-.                                                             
%%%%%%SS=+++.+++=.-                                                             
%%%%%%SSSS==-   +                                                               
%%%%%%SSSSSS=-+                                                                 
%%%%%SSS====.+                                                                  
%%SSSS=-.. .                                                                    
SSSSSSSS=+.                                                                     
Last edited on
I still don't think the zoom factor isn't implemented right
So you mean you think it works correctly? Awesome! Now I have to go and figure out the best way to convert images to ASCII in C++...
Actually there is an easy way out from what I read from other forums. First you have the image converted into gray-scale. Then you use Color Filtering on those pixels in the image e.g certain pixel value is to replaced with which ASCII value etc.

So all you need is a imaging library (can be Java,C++ or whatever) to do that and viola you produce your image to ASCII objective. I have not tried it but on theory it sounds plausible.
That is a primitive approach.
If we're talking about images, surely you won't want to have one symbol for one pixel. You'll want to fit in a 80*something rectangle of the console screen. This means ludicrous downscaling. Some information might be lost or distorted during that.
Another thing, problematic for both images and Mandelbrot sets, is edges. If you looked at the panda, you'd notice that there is a large number of different symbols used to make the edges soft and curved, while the original (if it existed) might have had just two colours.

I suppose it's inevitable to have some sort of edge detection combined with a large set of well described symbols. And even then I don't know if it could compare to human work.

That is a primitive approach.
If we're talking about images, surely you won't want to have one symbol for one pixel. You'll want to fit in a 80*something rectangle of the console screen. This means ludicrous downscaling. Some information might be lost or distorted during that.


Agree but usually for ASCII art, we tend to look at the picture from a "fair" distance isn't it? All those distortion will look "small" in comparison to the overall image that is displayed. It is only when you zoom in will you see the distortion.

So a primitive way out does not mean it does not serve it's objective. It will serve at least a percentage of the target audience who are not that picky. After all, looking at a ASCII art is not like choosing your life-long partner isn't it ? :P
It would be easier and more flexible to just generate one; it's a fairly simple algorithm...

                                                   _q&
                                                  NNMM&g
                                                  #MMMMM
                                         ;g_, 4gpgpNMMNpgpyp  _ +
                                          QM#NMMMMMMMMMMMMMM&jQNf
                                       qgjpMMMMMMMMMMMMMMMMMMMMM`
                         .             `MMMMMMMMMMMMMMMMMMMMMMMNf_
                           _   y      jMMMMMMMMMMMMMMMMMMMMMMMMMMM^
                           NMpNMNNpg  NMMMMMMMMMMMMMMMMMMMMMMMMMMQ.
                         =NMMMMMMMMM&_MMMMMMMMMMMMMMMMMMMMMMMMMMM6
                      +pqjMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMM
        =====e========NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM`
                      ]MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNg
                         .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMf
                           NMMMMMMMV  MMMMMMMMMMMMMMMMMMMMMMMMMMMM\
                           ^^  P '    ZMMMMMMMMMMMMMMMMMMMMMMMMMMg,
                                       ^MMMMMMMMMMMMMMMMMMMMMMMMF'`
                                       ^PMMMMMMMMMMMMMMMMMMMMMMZ
                                          4MMMMMMMMMMMMMMMMMMMMMe
                                         )#^' M@MMMMMMMMMMM&  ^ |
                                                  #MMMM6
                                                  #MMMMN
                                                   `MM
                                                     '

Another attempt. While the principle is the same, this time instead of having each square as 4 booleans, I wrote it as 8*12 grid of floats. Then I matched this grid to all characters from 32 to 125 and printed the most similar one. Of course, my matching algorithm was the most primitive..
I'm not sure if this is any better. I guess a more sophisticated matching would be good, but I don't think I'll go that far..
Interesting approach. I like how you're trying to machine the character set to the result. Mine just picks a character based on the number of iterations.
Topic archived. No new replies allowed.