color cycle (slow)

Kistaro Windrider, Reptillian Situation Assessor

Unfortunately, I Really Am That Nerdy

Previous Entry Share Next Entry
(no subject)
color cycle (slow)
kistaro
Would anybody happen to know of a utility that can take text as input and output an image such that it's got a different color assigned to each character, so each character gets one pixel? I wrote a nifty little C++ program that can create a pretty sort of fractal pattern in text, but I'd like that to become an image so I can make a userpic out of it. It's too labor-intensive to do by hand, but I don't know how to do visual coding in C++. Any leads?

If not, I'll write one myself in Java, but I'd really rather not bother.


...#*@$.#*@$.#*@$ $@*#.$@*#.$@*#...# @@ @@@$ $$.# #.$$ $@@@ @@ #...#*@$.#*@$.#*@$ $@*#.$@*#.$@*#...
.$                               $ # *   * $ @       @ $ *   * # $                               $.
. @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@$   *###*   @*** ***@   *###*   $@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ .
# @*   *   *   *   *   *   *   * $ #   . * $   #   #   $ * .   # $ *   *   *   *   *   *   *   *@ #
* @ ###*   *###*   *###*   *###* ..# $$. @@$ ..#   #.. $@@ .$$ #.. *###*   *###*   *###*   *### @ *
@   #.       . *   * .       . *   # @ .   $ $       $ $   . @ #   * .       . *   * .       .#   @
$ @ # $$$ $$$.       .$$$ $$$.   @***@       $@@@ @@@$       @***@   .$$$ $$$.       .$$$ $$$ # @ $
. @** $@   @ . *   * . @   @ . * @   @ .   $   *   *   $   . @   @ * . @   @ . *   * . @   @$ **@ .
# @   $ ***@ ##*   *## @***@ ##* $$ $$$. @@$ ##*   *## $@@ .$$$ $$ *## @***@ ##*   *## @*** $   @ #
*       *#               # @   *       . * $ .       . $ * .       *   @ #               #*       *
@ @   $ * ... ... ... ...#       #.. *###*   .$$$ $$$.   *###* ..#       #... ... ... ... * $   @ @
$ @** $@@ .$   $   $   $ # @   * # $ *   * $   @   @   $ *   * $ # *   @ # $   $   $   $. @@$ **@ $
. @ # $   . @@@$   $@@@$ **@ ##*   $@@@ @@@$ **@   @** $@@@ @@@$   *## @** $@@@$   $@@@ .   $ # @ .
#   #...#   @*       * $   @ . * # $       $ # @   @ # $       $ # * . @   $ *       *@   #...#   #
* @ #   # . @ ### ###*   .$$$.   #...#   #...#       #...#   #...#   .$$$.   *### ### @ . #   # @ *
@ @*** ** .$$ #.   . * $ .   . * #   #   #   # @   @ #   #   #   # * .   . $ * .   .# $$. ** ***@ @
$ @       .   # $$$. @@$ ## ###* ** *** *** ***@   @*** *** *** ** *### ## $@@ .$$$ #   .       @ $
                $@                                                               @$                
$ @       .   # $ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** $ #   .       @ $
@ @*** ** .$$ #.. *#   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #* ..# $$. ** ***@ @
* @ #   # . @ #   * ...#   #...#   #...#   #...#   #...#   #...#   #...#   #... *   # @ . #   # @ *
#   #...#   @***@   .$       $ #   # $       $ #   # $       $ #   # $       $.   @***@   #...#   #
. @ # $   . @   @ * . @@@ @@@$       $@@@ @@@$       $@@@ @@@$       $@@@ @@@ . * @   @ .   $ # @ .
$ @** $@@ .$$$ $$ *## @*   * $ #   # $ *   * $ #   # $ *   * $ #   # $ *   *@ ##* $$ $$$. @@$ **@ $
@ @   $ * .       *   @ ###* ..#   #.. *###* ..#   #.. *###* ..#   #.. *### @   *       . * $   @ @
*       *###* ..#       #.               . *   #   #   * .               .#       #.. *###*       *
# @   $ *   * $ # *   @ # $$$ $$$ $$$ $$$.               .$$$ $$$ $$$ $$$ # @   * # $ *   * $   @ #
. @** $@@@ @@@$   *## @** $@   @   @   @ . *   #   #   * . @   @   @   @$ **@ ##*   $@@@ @@@$ **@ .
$ @ # $       $ # * . @   $ ***@   @***@ ##* ..#   #.. *## @***@   @*** $   @ . * # $       $ # @ $
@   #...#   #...#   .$$$.   *#       # @   * $ #   # $ *   @ #       #*   .$$$.   #...#   #...#   @
* @ #   #   #   # * .   . $ * ... ...#   $@@@$       $@@@$   #... ... * $ .   . * #   #   #   # @ *
# @*** *** *** ** *### ## $@@ .$   $ # @ $   $ #   # $   $ @ # $   $. @@$ ## ###* ** *** *** ***@ #
. @               *       $   . @@@$ **@ .. ...#   #... .. @** $@@@ .   $       *               @ .
.$$$. @@$ ## ###*               @*                               *@               *### ## $@@ .$$$.
.   . * $ .   . * *       $   . @ ### ### ### ### ### ### ### ### @ .   $       * * .   . $ * .   .
## ###*   .$$$.   *### ## $@@ .$$ #.   .   .   .   .   .   .   .# $$. @@$ ## ###*   .$$$.   *### ##
      * $   @ . * * .   . $ * .   # $$$.   .$$$.   .$$$.   .$$$ #   . * $ .   . * * . @   $ *      
@** $@@@$ **@ ##*   .$$$.   *###*   $@       @ .   . @       @$   *###*   .$$$.   *## @** $@@@$ **@
@ # $   $ # @   * * . @   $ *   * # $ *** ***@       @*** *** $ # *   * $   @ . * *   @ # $   $ # @
  #... ...#       *## @** $@@@ @@ #.. *#   # @ .   . @ #   #* ..# @@ @@@$ **@ ##*       #... ...#  
@ #       # @   * *   @ # $       #   * ...# $$.   .$$ #... *   #       $ # @   * *   @ #       # @
@***@   @***@ ##*       #...# $$.       .$               $.       .$$ #...#       *## @***@   @***@
@   @   @   @ . * *   @ #   # @ . #   * . @@@ @@@ @@@ @@@ . *   # . @ #   # @   * * . @   @   @   @
$$ $$$ $$$ $$$.   *## @*** ***@   #.. *## @*   *   *   *@ ##* ..#   @*** ***@ ##*   .$$$ $$$ $$$ $$
              . * * . @       @ . # $ *   @ ###*   *### @   * $ # . @       @ . * * .              
$@@ .$$ #.. *###*   .$$$.   .$$$.   $@@@$   #.       .#   $@@@$   .$$$.   .$$$.   *###* ..# $$. @@$
$ * . @ # $ *   * * .   .   .   . # $   $ @ # $$$ $$$ # @ $   $ # .   .   .   . * *   * $ # @ . * $
. *## @** $@@@ @@ *### ### ### ## #... .. @** $@   @$ **@ .. ...# ## ### ### ###* @@ @@@$ **@ ##* .
# *   @   $       *               #       @   $ *** $   @       #               *       $   @   * #
                                                *#*                                                
# *   @   $       *               #       @   $ *** $   @       #               *       $   @   * #
. *## @** $@@@ @@ *### ### ### ## #... .. @** $@   @$ **@ .. ...# ## ### ### ###* @@ @@@$ **@ ##* .
$ * . @ # $ *   * * .   .   .   . # $   $ @ # $$$ $$$ # @ $   $ # .   .   .   . * *   * $ # @ . * $
$@@ .$$ #.. *###*   .$$$.   .$$$.   $@@@$   #.       .#   $@@@$   .$$$.   .$$$.   *###* ..# $$. @@$
              . * * . @       @ . # $ *   @ ###*   *### @   * $ # . @       @ . * * .              
$$ $$$ $$$ $$$.   *## @*** ***@   #.. *## @*   *   *   *@ ##* ..#   @*** ***@ ##*   .$$$ $$$ $$$ $$
@   @   @   @ . * *   @ #   # @ . #   * . @@@ @@@ @@@ @@@ . *   # . @ #   # @   * * . @   @   @   @
@***@   @***@ ##*       #...# $$.       .$               $.       .$$ #...#       *## @***@   @***@
@ #       # @   * *   @ # $       #   * ...# $$.   .$$ #... *   #       $ # @   * *   @ #       # @
  #... ...#       *## @** $@@@ @@ #.. *#   # @ .   . @ #   #* ..# @@ @@@$ **@ ##*       #... ...#  
@ # $   $ # @   * * . @   $ *   * # $ *** ***@       @*** *** $ # *   * $   @ . * *   @ # $   $ # @
@** $@@@$ **@ ##*   .$$$.   *###*   $@       @ .   . @       @$   *###*   .$$$.   *## @** $@@@$ **@
      * $   @ . * * .   . $ * .   # $$$.   .$$$.   .$$$.   .$$$ #   . * $ .   . * * . @   $ *      
## ###*   .$$$.   *### ## $@@ .$$ #.   .   .   .   .   .   .   .# $$. @@$ ## ###*   .$$$.   *### ##
.   . * $ .   . * *       $   . @ ### ### ### ### ### ### ### ### @ .   $       * * .   . $ * .   .
.$$$. @@$ ## ###*               @*                               *@               *### ## $@@ .$$$.
. @               *       $   . @@@$ **@ .. ...#   #... .. @** $@@@ .   $       *               @ .
# @*** *** *** ** *### ## $@@ .$   $ # @ $   $ #   # $   $ @ # $   $. @@$ ## ###* ** *** *** ***@ #
* @ #   #   #   # * .   . $ * ... ...#   $@@@$       $@@@$   #... ... * $ .   . * #   #   #   # @ *
@   #...#   #...#   .$$$.   *#       # @   * $ #   # $ *   @ #       #*   .$$$.   #...#   #...#   @
$ @ # $       $ # * . @   $ ***@   @***@ ##* ..#   #.. *## @***@   @*** $   @ . * # $       $ # @ $
. @** $@@@ @@@$   *## @** $@   @   @   @ . *   #   #   * . @   @   @   @$ **@ ##*   $@@@ @@@$ **@ .
# @   $ *   * $ # *   @ # $$$ $$$ $$$ $$$.               .$$$ $$$ $$$ $$$ # @   * # $ *   * $   @ #
*       *###* ..#       #.               . *   #   #   * .               .#       #.. *###*       *
@ @   $ * .       *   @ ###* ..#   #.. *###* ..#   #.. *###* ..#   #.. *### @   *       . * $   @ @
$ @** $@@ .$$$ $$ *## @*   * $ #   # $ *   * $ #   # $ *   * $ #   # $ *   *@ ##* $$ $$$. @@$ **@ $
. @ # $   . @   @ * . @@@ @@@$       $@@@ @@@$       $@@@ @@@$       $@@@ @@@ . * @   @ .   $ # @ .
#   #...#   @***@   .$       $ #   # $       $ #   # $       $ #   # $       $.   @***@   #...#   #
* @ #   # . @ #   * ...#   #...#   #...#   #...#   #...#   #...#   #...#   #... *   # @ . #   # @ *
@ @*** ** .$$ #.. *#   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #* ..# $$. ** ***@ @
$ @       .   # $ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** $ #   .       @ $
                $@                                                               @$                
$ @       .   # $$$. @@$ ## ###* ** *** *** ***@   @*** *** *** ** *### ## $@@ .$$$ #   .       @ $
@ @*** ** .$$ #.   . * $ .   . * #   #   #   # @   @ #   #   #   # * .   . $ * .   .# $$. ** ***@ @
* @ #   # . @ ### ###*   .$$$.   #...#   #...#       #...#   #...#   .$$$.   *### ### @ . #   # @ *
#   #...#   @*       * $   @ . * # $       $ # @   @ # $       $ # * . @   $ *       *@   #...#   #
. @ # $   . @@@$   $@@@$ **@ ##*   $@@@ @@@$ **@   @** $@@@ @@@$   *## @** $@@@$   $@@@ .   $ # @ .
$ @** $@@ .$   $   $   $ # @   * # $ *   * $   @   @   $ *   * $ # *   @ # $   $   $   $. @@$ **@ $
@ @   $ * ... ... ... ...#       #.. *###*   .$$$ $$$.   *###* ..#       #... ... ... ... * $   @ @
*       *#               # @   *       . * $ .       . $ * .       *   @ #               #*       *
# @   $ ***@ ##*   *## @***@ ##* $$ $$$. @@$ ##*   *## $@@ .$$$ $$ *## @***@ ##*   *## @*** $   @ #
. @** $@   @ . *   * . @   @ . * @   @ .   $   *   *   $   . @   @ * . @   @ . *   * . @   @$ **@ .
$ @ # $$$ $$$.       .$$$ $$$.   @***@       $@@@ @@@$       @***@   .$$$ $$$.       .$$$ $$$ # @ $
@   #.       . *   * .       . *   # @ .   $ $       $ $   . @ #   * .       . *   * .       .#   @
* @ ###*   *###*   *###*   *###* ..# $$. @@$ ..#   #.. $@@ .$$ #.. *###*   *###*   *###*   *### @ *
# @*   *   *   *   *   *   *   * $ #   . * $   #   #   $ * .   # $ *   *   *   *   *   *   *   *@ #
. @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@$   *###*   @*** ***@   *###*   $@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ .
.$                               $ # *   * $ @       @ $ *   * # $                               $.
...#*@$.#*@$.#*@$ $@*#.$@*#.$@*#...# @@ @@@$ $$.# #.$$ $@@@ @@ #...#*@$.#*@$.#*@$ $@*#.$@*#.$@*#...

....#*@$.#*@$.#*@$$@*#.$@*#.$@*#....#*@$.#*@$.#*@ @*#.$@*#.$@*#....#*@$.#*@$.#*@$$@*#.$@*#.$@*#.... .$$ $$. *@ .# @ .# @ @ #. @ #. @* .$$ $$. .$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$. @@ ##*@ ##*@ @*## @*## @@ .$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$. . @** **@@** **@@** **@@** **@ . @@ ***@ *** $ *** @*** @@ . @** **@@** **@@** **@@** **@ . # @*####*@@*####*@@*####*@@*####*@ . *@ @ *** $ *** @ @* . @*####*@@*####*@@*####*@@*####*@ # * @ #.. ..# @@ #.. ..# @$.#*@ ***@ ##*@ @*## @*** @*#.$@ #.. ..# @@ #.. ..# @ * @ @ #.$$$$$$$$.# #.$$$$$$$$.# $$ # @ ##*@ .# @ @ #. @*## @ # $$ #.$$$$$$$$.# #.$$$$$$$$.# @ @ $ @*# $@@ @@$ # @@ # $@@ @@$ # $$ # @ .# @$.# @ @ #.$@ #. @ # $$ # $@@ @@$ # @@ # $@@ @@$ #*@ $ . @** $@****@$.#*@@*#.$@****@$ # @$.#*@$.# $$ #*@ @*# $$ #.$@*#.$@ # $@****@$.#*@@*#.$@****@$ **@ . # @@@ $ *## ##* $.#*@ . * $ # $$ **@ @** $$ # $ * . @*#.$ *## ##* $ @@@ # * @@@ $ *#................#* .. *@ . * $ # @$ @@@ @@@ $@ # $ * . @* .. *#................#* $ @@@ * @ @** $@* .$$ $$..$$ $$. * .. @@$.#*@$.#*@$ @@@ @@@ $@*#.$@*#.$@@ .. * .$$ $$..$$ $$. *@$ **@ @ $ @*# $@@ .$@@@@$..$@@@@$. * $. $$$ # @ . * $ **@ @** $ * . @ # $$$ .$ * .$@@@@$..$@@@@$. @@$ #*@ $ . @ #.$$$ . @** **@ .#*@$. $$$ # @ . * $ #* $ *# $ * . @ # $$$ .$@*#. @** **@ . $$$.# @ . # @ #.. . . @*########*@ ## @ . @@$.#*@$.#*@$.#* . *#.$@*#.$@*#.$@@ . @ ## @*########*@ . . ..# @ # * @*##### .$@ #.. ..# @ .# @ . *@ . * $ # @ . * $ * . @ # $ * . @* . @ #. @ #.. ..# @$. #####*@ * @ @** * .$$ #.$$$$.#*@$.#*@$.#*@$.#*@$.#*@$.#*@$@*#.$@*#.$@*#.$@*#.$@*#.$@*#.$$$$.# $$. * **@ @ $ @@@@ @@ ... # $@@ @@$ # ... @@ @@@@ $ $ @@@@ @@ ... # $@***************************************************************@$ # ... @@ @@@@ $ @ @** * .$$ #.$ *## ##**## ##**## ##**## ## ## ##**## ##**## ##**## ##* $.# $$. * **@ @ * @*##### .$@ #.. *#....#**#....#**#....#**#....# #....#**#....#**#....#**#....#* ..# @$. #####*@ * # @ #.. . . @*### * .$$ $$. ** .$$ $$. * .$$ $$. ** .$$ $$. * ###*@ . . ..# @ # . @ #.$$$ . @** * * .$@@@@@@@@$. .$@@@@@@@@$. @ .$@@@@@@@@$. .$@@@@@@@@$. * * **@ . $$$.# @ . $ @*# $@@ .$@@@@@ *#. @** **@ . ** . @** **@ . @ . @** **@ . ** . @** **@ .#* @@@@@$. @@$ #*@ $ @ @** $@* .$$ $ *## @*####*@$.#**#.$@*####*@ . * . @*####*@$.#**#.$@*####*@ ##* $ $$. *@$ **@ @ * @@@ $ *#....#.. *** @ #.. ..# @$.# #.$@ #.. ..# @ *** ..#....#* $ @@@ * # @@@ $ *## #### *** @ #.$$$$$$$$$$$$$$$$.# $$ # # $$ #.$$$$$$$$$$$$$$$$.# @ *** #### ##* $ @@@ # . @** $@****** * *## @*# $@@ @@$$@@ @@$ # $$ *** $$ # $@@ @@$$@@ @@$ #*@ ##* * ******@$ **@ . $ @*# $@@ @@@@ *#. @** $@****@$$@****@$ # @$ @ @ $@ # $@****@$$@****@$ **@ .#* @@@@ @@$ #*@ $ @ @ #.$$$$..$$ $ * .$@@@ $ *## ##* $.#*@$ @ @ $@*#.$ *## ##* $ @@@$. * $ $$..$$$$.# @ @ * @ #.. ........ * .$$ $ $ *#........#* .. * $ *** $ * .. *#........#* $ $ $$. * ........ ..# @ * # @*###### # *#..... $@* .$$ $$. * $. * $ # # $ * .$ * .$$ $$. *@$ .....#* # ######*@ # . @** **@$$@** *## # $@@ .$@@@@$.#*@$.#*@$.# #.$@*#.$@*#.$@@@@$. @@$ # ##* **@$$@** **@ . .$@@@@$$@@@@$$@@@ **** ** $$$ . @** **@ . $$$ ** **** @@@$$@@@@$$@@@@$. .$$ $$$$ $$$$ $ **** ** $$$ . @*###############################*@ . $$$ ** **** $ $$$$ $$$$ $$. ...... .... ... *## # $@@ .$@ #.. ..##.. .. .. ..##.. ..# @$. @@$ # ##* ... .... ...... # #### #### # *#..... $@* .$$ #.$$$$.##.$$$$. .$$$$.##.$$$$.# $$. *@$ .....#* # #### #### # **@@** **** *** * .$$ $ $ *#... # $@@ @@$ # $@@ @@$ # ...#* $ $ $$. * *** **** **@@** @@@@@@@@@ @@@@ @ * .$@@@ $ *## # # $@********@$ * $@********@$ # # ##* $ @@@$. * @ @@@@ @@@@@@@@@ $ $$$$ $$$ *#. @** $@***** #.$ *## ##* $ # $ *## ##* $.# *****@$ **@ .#* $$$ $$$$ $ ..#* *#.. .... . *## @*# $@@ @ #.. *#....#*@$.#.$@*#....#* ..# @ @@$ #*@ ##* . .... ..#* *#.. ###* *###### ### *** @ #.$$$$.$$ ### * .$$ $$. * ### $$.$$$$.# @ *** ### ######* *### * ** ** **** * *** @ #.. .... ### * .$@@@@@@@@@@@@@@@$. * ### .... ..# @ *** * **** ** ** * @@@@@@@@$$@@ @@@ *## @*###### # #.. *#. @** ** ** **@ .#* ..# # ######*@ ##* @@@ @@$$@@@@@@@@ $ $$$$$$$$ $ *#. @** **** #.$ *## @*####* *####*@ ##* $.# **** **@ .#* $ $$$$$$$$ $ ..#**#.. ... * .$@@@@$$@@ @ # $@*** @ #.. ..# @ ***@$ # @ @@$$@@@@$. * ... ..#**#.. ###**####*@@*## # * .$$ $$$$$$$$ # $@@ @ @ #.$$$$$$$.# @ @ @@$ # $$$$$$$$ $$. * # ##*@@*####**### * **** **@@***** *#...... . #.$$$$$ @*# $@@ @@$ #*@ $$$$$.# . ......#* *****@@** **** * @@@ @@@@@@@@ @ *## ##*@@*## #.. . @** $@***@$ **@ . ..# ##*@@*## ##* @ @@@@@@@@ @@@ $$ $.$$ * *@@* * * # #*## @ $ *#* $ @ ##*# # * * *@@* * $$.$ $$ @@@ @@@@@@@@ @ *## ##*@@*## #.. . @** $@***@$ **@ . ..# ##*@@*## ##* @ @@@@@@@@ @@@ * **** **@@***** *#...... . #.$$$$$ @*# $@@ @@$ #*@ $$$$$.# . ......#* *****@@** **** * ###**####*@@*## # * .$$ $$$$$$$$ # $@@ @ @ #.$$$$$$$.# @ @ @@$ # $$$$$$$$ $$. * # ##*@@*####**### ..#**#.. ... * .$@@@@$$@@ @ # $@*** @ #.. ..# @ ***@$ # @ @@$$@@@@$. * ... ..#**#.. $ $$$$$$$$ $ *#. @** **** #.$ *## @*####* *####*@ ##* $.# **** **@ .#* $ $$$$$$$$ $ @@@@@@@@$$@@ @@@ *## @*###### # #.. *#. @** ** ** **@ .#* ..# # ######*@ ##* @@@ @@$$@@@@@@@@ * ** ** **** * *** @ #.. .... ### * .$@@@@@@@@@@@@@@@$. * ### .... ..# @ *** * **** ** ** * ###* *###### ### *** @ #.$$$$.$$ ### * .$$ $$. * ### $$.$$$$.# @ *** ### ######* *### ..#* *#.. .... . *## @*# $@@ @ #.. *#....#*@$.#.$@*#....#* ..# @ @@$ #*@ ##* . .... ..#* *#.. $ $$$$ $$$ *#. @** $@***** #.$ *## ##* $ # $ *## ##* $.# *****@$ **@ .#* $$$ $$$$ $ @@@@@@@@@ @@@@ @ * .$@@@ $ *## # # $@********@$ * $@********@$ # # ##* $ @@@$. * @ @@@@ @@@@@@@@@ **@@** **** *** * .$$ $ $ *#... # $@@ @@$ # $@@ @@$ # ...#* $ $ $$. * *** **** **@@** # #### #### # *#..... $@* .$$ #.$$$$.##.$$$$. .$$$$.##.$$$$.# $$. *@$ .....#* # #### #### # ...... .... ... *## # $@@ .$@ #.. ..##.. .. .. ..##.. ..# @$. @@$ # ##* ... .... ...... .$$ $$$$ $$$$ $ **** ** $$$ . @*###############################*@ . $$$ ** **** $ $$$$ $$$$ $$. .$@@@@$$@@@@$$@@@ **** ** $$$ . @** **@ . $$$ ** **** @@@$$@@@@$$@@@@$. . @** **@$$@** *## # $@@ .$@@@@$.#*@$.#*@$.# #.$@*#.$@*#.$@@@@$. @@$ # ##* **@$$@** **@ . # @*###### # *#..... $@* .$$ $$. * $. * $ # # $ * .$ * .$$ $$. *@$ .....#* # ######*@ # * @ #.. ........ * .$$ $ $ *#........#* .. * $ *** $ * .. *#........#* $ $ $$. * ........ ..# @ * @ @ #.$$$$..$$ $ * .$@@@ $ *## ##* $.#*@$ @ @ $@*#.$ *## ##* $ @@@$. * $ $$..$$$$.# @ @ $ @*# $@@ @@@@ *#. @** $@****@$$@****@$ # @$ @ @ $@ # $@****@$$@****@$ **@ .#* @@@@ @@$ #*@ $ . @** $@****** * *## @*# $@@ @@$$@@ @@$ # $$ *** $$ # $@@ @@$$@@ @@$ #*@ ##* * ******@$ **@ . # @@@ $ *## #### *** @ #.$$$$$$$$$$$$$$$$.# $$ # # $$ #.$$$$$$$$$$$$$$$$.# @ *** #### ##* $ @@@ # * @@@ $ *#....#.. *** @ #.. ..# @$.# #.$@ #.. ..# @ *** ..#....#* $ @@@ * @ @** $@* .$$ $ *## @*####*@$.#**#.$@*####*@ . * . @*####*@$.#**#.$@*####*@ ##* $ $$. *@$ **@ @ $ @*# $@@ .$@@@@@ *#. @** **@ . ** . @** **@ . @ . @** **@ . ** . @** **@ .#* @@@@@$. @@$ #*@ $ . @ #.$$$ . @** * * .$@@@@@@@@$. .$@@@@@@@@$. @ .$@@@@@@@@$. .$@@@@@@@@$. * * **@ . $$$.# @ . # @ #.. . . @*### * .$$ $$. ** .$$ $$. * .$$ $$. ** .$$ $$. * ###*@ . . ..# @ # * @*##### .$@ #.. *#....#**#....#**#....#**#....# #....#**#....#**#....#**#....#* ..# @$. #####*@ * @ @** * .$$ #.$ *## ##**## ##**## ##**## ## ## ##**## ##**## ##**## ##* $.# $$. * **@ @ $ @@@@ @@ ... # $@***************************************************************@$ # ... @@ @@@@ $ $ @@@@ @@ ... # $@@ @@$ # ... @@ @@@@ $ @ @** * .$$ #.$$$$.#*@$.#*@$.#*@$.#*@$.#*@$.#*@$@*#.$@*#.$@*#.$@*#.$@*#.$@*#.$$$$.# $$. * **@ @ * @*##### .$@ #.. ..# @ .# @ . *@ . * $ # @ . * $ * . @ # $ * . @* . @ #. @ #.. ..# @$. #####*@ * # @ #.. . . @*########*@ ## @ . @@$.#*@$.#*@$.#* . *#.$@*#.$@*#.$@@ . @ ## @*########*@ . . ..# @ # . @ #.$$$ . @** **@ .#*@$. $$$ # @ . * $ #* $ *# $ * . @ # $$$ .$@*#. @** **@ . $$$.# @ . $ @*# $@@ .$@@@@$..$@@@@$. * $. $$$ # @ . * $ **@ @** $ * . @ # $$$ .$ * .$@@@@$..$@@@@$. @@$ #*@ $ @ @** $@* .$$ $$..$$ $$. * .. @@$.#*@$.#*@$ @@@ @@@ $@*#.$@*#.$@@ .. * .$$ $$..$$ $$. *@$ **@ @ * @@@ $ *#................#* .. *@ . * $ # @$ @@@ @@@ $@ # $ * . @* .. *#................#* $ @@@ * # @@@ $ *## ##* $.#*@ . * $ # $$ **@ @** $$ # $ * . @*#.$ *## ##* $ @@@ # . @** $@****@$.#*@@*#.$@****@$ # @$.#*@$.# $$ #*@ @*# $$ #.$@*#.$@ # $@****@$.#*@@*#.$@****@$ **@ . $ @*# $@@ @@$ # @@ # $@@ @@$ # $$ # @ .# @$.# @ @ #.$@ #. @ # $$ # $@@ @@$ # @@ # $@@ @@$ #*@ $ @ @ #.$$$$$$$$.# #.$$$$$$$$.# $$ # @ ##*@ .# @ @ #. @*## @ # $$ #.$$$$$$$$.# #.$$$$$$$$.# @ @ * @ #.. ..# @@ #.. ..# @$.#*@ ***@ ##*@ @*## @*** @*#.$@ #.. ..# @@ #.. ..# @ * # @*####*@@*####*@@*####*@@*####*@ . *@ @ *** $ *** @ @* . @*####*@@*####*@@*####*@@*####*@ # . @** **@@** **@@** **@@** **@ . @@ ***@ *** $ *** @*** @@ . @** **@@** **@@** **@@** **@ . .$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$. @@ ##*@ ##*@ @*## @*## @@ .$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$. .$$ $$. *@ .# @ .# @ @ #. @ #. @* .$$ $$. ....#*@$.#*@$.#*@$$@*#.$@*#.$@*#....#*@$.#*@$.#*@ @*#.$@*#.$@*#....#*@$.#*@$.#*@$$@*#.$@*#.$@*#....


In that cut, if y'all didn't look, is the actual output of the program set to 99x99 and "One Adjacency" then "Two Adjacencies", respectively.

So, any leads?

  • 1
If you're on Unix, just strip the newlines, use rawtopgm with the desired dimensions, and finally run GIMP to change the resulting pgm to a HSV picture with saturation and value constant (just use two other pictures with a fill of the same grey value for each pixel). If you do this with the two other pictures being all white, you get this for the first text file.

If you want something that assigns colors randomly, cobble something together that uses a map to check if the char already read (use fstream.read() instead of fstream >> char so you get spaces too) has been encountered before; if it has, it just pulls the value out of the map, and if not, it selects a random 24 bit value and sets the corresponding map[char] to that value.

--

As for creating picture files with C++, a very simple format to implement is the aforementioned PGM (for greyscale, 1 char per pixel) or PNM (for true color, 3 chars per pixel). This is just a plain text header prefixing the raw data.

For PGM (greyscale), it is
P5
x y
255

where x and y is x size and y size, and for PNM, it is
P6
x y
255


Then follows a newline, and your raw data, so for a 100x100 PGM you'd have
P5
100 100
255
[raw data]

This is what I used for my Linux fractal rendering programs. Of course, when I later put up some of the renders of those, I used GIMP to convert the results to a compressed format like png afterwards. (Reading PNMs and PGMs is a bit more difficult, as comments are allowed.)

Ooh, that came out nicely. I'll hack together some sort of program to take the text and assign it colors from a hardwired lookup table- not elegant by any stretch of the imagination, but functional. I prefer shades of blue...

The 99x99 size was very deliberate. The fractal only really works with odd parameters- and 99x99 fits as an LJ user icon.

Thank you very much for the information!

*smiles* That should work too, though I would have chosen a lesser fractal and used a kernel density estimator or somesuch to represent it as an icon-sized picture. That way, the detail would be observable - it's kind of hard to see single pixel changes unless you change the program so they're always at high contrast wrt their neighbors.

What algorithm does your program use to generate the text? I'm curious as to why it only works with odd sizes.

"Fractal" isn't the proper term; it has many fractal-like properties (repetition, infinite sustaining pattern), but all locations are integers.

In pseudocode:

FractalThingie(int size)
char board[size][size]; //this is actually vector
[Error: Irreparable invalid markup ('<vector<char>') in entry. Owner must fix manually. Raw contents below.]

"Fractal" isn't the proper term; it has many fractal-like properties (repetition, infinite sustaining pattern), but all locations are integers.

In pseudocode:
<tt>
FractalThingie(int size)
char board[size][size]; //this is actually vector<vector<char> > in action
board[size/2][size/2] = first symbol;
while(board changed between steps){
copy new board into old board(two boards used to keep swaps from slowing access)
for each cell{
if it's got a mark, carry it over to the next step;
if it's blank, give it this round's mark if it has exactly one marked neighbor;
}
}
print the board;
return 0;

That's what created the first image. The second one was created by marking it if it had exactly one or two neighbors. A third one, which I personally think looks cooler than the other two, marks a location if it has exactly one or three neighbors, but not two. Haven't tried other combinations, although 1-2-3 just gives concentric squares for obvious reasons.

Of course, exactly what it will spit out is hard-wired into the code, because I was too lazy to do it properly. At least it takes board size as a parameter! If you're interested, the code (currently in 1-3 mode) is at http://students.cec.wustl.edu/~abn1/fractal.cc assuming you've waited long enough after I make this comment for it to be uploaded...

BLEAH! I'm not going to try to repost that, since I think it's still clear enough even without indentation. The C++ code isn't too hard to read, either...

This sounds more like a 2D cellular automaton than a fractal, if I understood you right.

As part of welcoming myself back to LJ (I've been on Hiatus), I just realized that both of those cuts could make really interesting throw rugs. Of course, I wouldn't know who might buy them - but you never know.

(Deleted comment)
If programmers from Microsoft are into making art out of colored water... no wonder why I use Linux. :)

  • 1
?

Log in

No account? Create an account