[Question]
  [
I always used a [Mandelbrot](http://en.wikipedia.org/wiki/Mandelbrot_set) image as the 'graphical' version of Hello World in any graphical application I got my hands on. Now it's your guys' turn.
* Language must be capable of graphical output or drawing charts (saving files disallowed)
* Render a square image or graph. The size at least 128 and at most 640 across\*
* The fractal coordinates range from approximately -2-2i to 2+2i
* The pixels outside of the Mandelbrot set should be colored according to the number of iterations before the magnitude exceeds 2 (excluding\* black & white)
* Each iteration count must have a unique color\*, and neighboring colors should preferably be easily distinguishable by the eye
* The other pixels (presumably inside the Mandelbrot set) must be colored either black or white
* At least 99 iterations
* ASCII art not allowed
\* unless limited by the platform, *e.g.* graphical calculator
Allowed:  
![Allowed](https://i.stack.imgur.com/5CQ3j.png)  
Disallowed:  
![Disallowed](https://i.stack.imgur.com/3NPX6.png)  
(shrunken images)
**Winning conditions:**
Shortest version (size in bytes) for each language will get a mention in this post, ordered by size.  
No answer will ever be 'accepted' with the button.
**Leaderboard:**
```
/* Configuration */
var QUESTION_ID = 23423; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 17419; // This should be the user ID of the challenge author.
/* App */
var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;
function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}
function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}
function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}
function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var OVERRIDE_REG = /^Override\s*header:\s*/i;
function getAuthorName(a) {
  return a.owner.display_name;
}
function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });
    
    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });
  
  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });
  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);
    var lang = a.language;
    lang = jQuery('<a>'+lang+'</a>').text();
    
    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });
  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);
  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });
  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }
}
```
```
body {
  text-align: left !important;
  display: block !important;
}
#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}
#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}
table thead {
  font-weight: bold;
}
table td {
  padding: 5px;
}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">
    </tbody>
  </table>
</div>
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">
    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
```
  
[Answer]
# Sharp EL-9300 Graphics Calculator, 296 bytes
[This was my secondary school graphing calculator](https://www.google.com/search?q=sharp%20el-9300c%20graphing%20scientific%20calculator), getting on for 20 years ago! I remember writing a mandelbrot generator for it way back then. And sure enough, its still sitting there in the NV memory:
```
ClrG
DispG
Range -2.35,2.35,.5,-1.55,1.55,0.5
y=-1.55
Label ly
x=-2.35
Label lx
n=1
zx=0
zy=0
Label ln
tzx=zx²-zy²+x
zy=(2*zx*zy)+y
zx=tzx
If zx²+zy²>4Goto esc
n=n+1
If n<20Goto ln
Label esc
If fpart (n/2)=0Goto npl
Plot x,y
Label npl
x=x+.05
If x<=2.35Goto lx
y=y+.05
If y<=1.55Goto ly
Wait
```
It took about 90 minutes to render.
This is totally ungolfed. I'm sure I could save a bit of space, but I just wanted to share this historical curiosity!
I love that the only control statements available are `goto`s.
Here's a photo. I don't have any other means to get the graphical output out:
![enter image description here](https://i.stack.imgur.com/mMVr4.jpg)
[Answer]
I came across this the other day. I don't take credit for it, but damn, is it awesome:
Python 2:
```
_                                      =   (
                                        255,
                                      lambda
                               V       ,B,c
                             :c   and Y(V*V+B,B,  c
                               -1)if(abs(V)<6)else
               (              2+c-4*abs(V)**-0.4)/i
                 )  ;v,      x=1500,1000;C=range(v*x
                  );import  struct;P=struct.pack;M,\
            j  ='<QIIHHHH',open('M.bmp','wb').write
for X in j('BM'+P(M,v*x*3+26,26,12,v,x,1,24))or C:
            i  ,Y=_;j(P('BBB',*(lambda T:(T*80+T**9
                  *i-950*T  **99,T*70-880*T**18+701*
                 T  **9     ,T*i**(1-T**45*2)))(sum(
               [              Y(0,(A%3/3.+X%v+(X/v+
                               A/3/3.-x/2)/1j)*2.5
                             /x   -2.7,i)**2 for  \
                               A       in C
                                      [:9]])
                                        /9)
                                       )   )
```
![enter image description here](https://i.stack.imgur.com/gafUL.jpg)
<http://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python/>
[Answer]
## LaTeX, 673 bytes
```
\countdef\!1\!129\documentclass{article}\usepackage[margin=0pt,papersize=\!bp]{geometry}\usepackage{xcolor,pgf}\topskip0pt\offinterlineskip\def~{99}\let\rangeHsb~\countdef\c2\countdef\d3\countdef\e4\begin{document}\let\a\advance\let\p\pgfmathsetmacro\makeatletter\def\x#1#2#3{#10
\@whilenum#1<#2\do{#3\a#11}}\d0\x\c{\numexpr~+1}{\expandafter\edef\csname\the\c\endcsname{\hbox{\noexpand\color[Hsb]{\the\d,1,1}\/}}\a\d23
\ifnum\d>~\a\d-~\fi}\def\/{\rule{1bp}{1bp}}\x\c\!{\hbox{\x\d\!{\p\k{4*\d/(\!-1)-2}\p\K{2-4*\c/(\!-1)}\def\z{0}\def\Z{0}\x\e~{\p\:{\z*\z-\Z*\Z+\k}\p\Z{2*\z*\Z+\K}\let\z\:\p\:{\z*\z+\Z*\Z}\ifdim\:pt>4pt\csname\the\e\endcsname\e~\fi}\ifnum\e=~\/\fi}}}\stop
```
> 
> ![Result 129x129](https://i.stack.imgur.com/qWIxb.png) (129 × 129)
> 
> 
> 
The PDF image consists of colored square units with size 1bp × 1bp.
## Ungolfed
```
% count register \size contains the width and height of the square
\countdef\size=1
\size=31
\documentclass{article}
\usepackage[margin=0pt,papersize=\size bp]{geometry}
\usepackage{xcolor,pgf}
\topskip0pt
\offinterlineskip
\def\iterations{99}
\let\rangeHsb\iterations
\countdef\c2
\countdef\d3
\countdef\e4
\begin{document}
\let\p\pgfmathsetmacro
\makeatletter
% \Loop: for (#1 = 0; #1 < #2; #1++) {#3}
\def\Loop#1#2#3{%
  #1=0
  \@whilenum#1<#2\do{#3\advance#11}%
}
\d0%
\Loop\c{\numexpr\iterations+1\relax}{%
  \expandafter\edef\csname\the\c\endcsname{%
    \hbox{\noexpand\color[Hsb]{\the\d,1,1}\noexpand\pixel}%
  }%
  \advance\d23 \ifnum\d>\iterations\advance\d-\iterations\fi
}
\def\pixel{\rule{1bp}{1bp}}
% \c: row
% \d: column
% \e: iteration
\Loop\c\size{%
  \typeout{c: \the\c}%
  \hbox{%
    \Loop\d\size{%
      \pgfmathsetmacro\k@re{4*\d/(\size-1)-2}%
      \pgfmathsetmacro\K@im{2-4*\c/(\size-1)}%
      \def\z@re{0}%
      \def\Z@im{0}%
      \Loop\e\iterations{%
         % calculate z(n+1) = z^2(n) + k
         \pgfmathsetmacro\temp{\z@re*\z@re-\Z@im*\Z@im+\k@re}%
         \pgfmathsetmacro\Z@im{2*\z@re*\Z@im+\K@im}%
         \let\z@re\temp
         % calculate abs(z)^2
         \pgfmathsetmacro\temp{\z@re*\z@re+\Z@im*\Z@im}%
         \ifdim\temp pt>4pt\csname\the\e\endcsname\e\iterations\fi
      }%   
      \ifnum\e=\iterations\pixel\fi
    }%
  }%
}
\stop
```
[Answer]
## x86 DOS Assembly, ~~208~~ ~~177~~ 173 bytes
The full binary, in HEX, that I created by hand, is:
```
DBE3BE00A0B81300CD1056BA640007BF87F9FDBDC7008BCDE81A008AC3AA4979F7B9C70083EF784D79EE33C0CD16B80300CD10CD208BC12BC289441CDF441CDF06A701DEF9D95C088BC52BC289441CDF441CDF06A701DEF9D95C0CD9EED914D95404D95410D95C14B301D904D84C04DE0EA901D8440CD95404D94410D86414D84408D914D80CD95C10D84C04D95414D84410DF06AB01DED99BDFE09B9E7207433ADA72C632DBC3320002000400
```
The sample image is:
![Mandlebrot screen shot with black cropped](https://i.stack.imgur.com/7ISUi.png)
The full source in readable ASM is fairly long (I used this to figure out how I was coding this sucker):
```
.286
CODE SEGMENT
ASSUME CS:code, DS:code
ORG 0100h
; *****************************************************************************
start:
  ; Mandlebrot coordinates
  zr   = DWORD PTR [SI+0]
  zi   = DWORD PTR [SI+4]
  cr   = DWORD PTR [SI+8]
  ci   = DWORD PTR [SI+12]
  zrsq = DWORD PTR [SI+16]
  zisq = DWORD PTR [SI+20]
  ; Temp int
  Temp = WORD PTR  [SI+28]
  ; ===========================================================================
  ; Initialize
  ; Initialize the FPU
  FNINIT
  ; SI points to our memory
  mov si, 0A000h ; So we can push it
  ; Shave off some bytes by reusing 100
  mov dx, 100
  ; Switch to MCGA
  mov ax, 013h
  int 010h
  ; ES:DI is the end of our drawing area
  push si
  pop es
  mov di, 63879
  std ; We're using stosb backwards
  ; Initialize our X and Y
  mov bp, 199
  mov cx, bp
  ; ===========================================================================
  ; Main draw loop
MainLoop:
  ; Get our next mandelbrot value
  call GMV
  ; Store it
  mov al, bl
  stosb
  ; Decrement our X
  dec cx
  jns MainLoop
  ; Decrement our Y
  mov cx, 199
  sub di, 120
  dec bp
  jns MainLoop
  ; ===========================================================================
  ; Done
  ; Wait for a key press
  xor ax, ax
  int 016h
  ; Change back to text mode
  mov ax, 3
  int 010h
  ; Exit to DOS
  int 020h
; *****************************************************************************
; GMV: Get Mandelbrot Value
; Gets the value for the next Mandelbrot pixel
; Returns:
;   BL - The color to use
GMV:
  ; ===========================================================================
  ; Initialize
  ; cr = (x - 100) / 50;
  mov ax, cx
  sub ax, dx                  ; \
  mov Temp, ax                ;  > ST0 = Current X - 100
  FILD Temp                   ; /
  FILD Divisor                ; ST0 = 50, ST1 = Current X - 100
  FDIVP                       ; ST0 = (Current X - 100) / 50
  FSTP cr                     ; Store the result in cr
  ; ci = (y - 100) / 50;
  mov ax, bp
  sub ax, dx                  ; \
  mov Temp, ax                ;  > ST0 = Current Y - 100
  FILD Temp                   ; /
  FILD Divisor                ; ST0 = 50, ST1 = Current Y - 100
  FDIVP                       ; ST0 = (Current Y - 100) / 50
  FSTP ci                     ; Store the result in ci
  ; zr = zi = zrsq = zisq = 0;
  FLDZ
  FST zr
  FST zi
  FST zrsq
  FSTP zisq
  ; numiteration = 1;
  mov bl, 1
  ; ===========================================================================
  ; Our main loop
  ; do {
GMVLoop:
  ; zi = 2 * zr * zi + ci;
  FLD zr
  FMUL zi
  FIMUL TwoValue
  FADD ci
  FST zi ; Reusing this later
  ; zr = zrsq - zisq + cr;
  FLD zrsq
  FSUB zisq
  FADD cr
  FST zr ; Reusing this since it already is zr
  ; zrsq = zr * zr;
  ;FLD zr ; Reused from above
  FMUL zr
  FSTP zrsq
  ; zisq = zi * zi;
  ;FLD zi ; Reused from above
  FMUL zi
  FST zisq ; Reusing this for our comparison
  ; if ((zrsq + zisq) < 4)
  ;   return numiteration;
  FADD zrsq
  FILD FourValue
  FCOMPP
  FSTSW ax
  FWAIT
  sahf
  jb GMVDone
  ;} while (numiteration++ < 200);
  inc bx
  cmp bl, dl
  jb GMVLoop
  ;return 0;
  xor bl, bl
GMVDone:  
  ret
;GMV
; *****************************************************************************
; Data
; Divisor
Divisor DW 50
; Two Value
TwoValue DW 2
; 4 Value
FourValue DW 4
CODE ENDS
END start
```
This is designed for compiling with TASM, runs in MCGA, and waits for a keypress before ending the program. The colors are just the default MCGA palette.
**EDIT:** Optimized it, now it draws backwards (same image though), and saved 31 bytes!
**EDIT 2:** To assuage the OP, I have recreated the binary by hand. By doing so, I also shaved another 4 bytes off. I documented every single step of the process, showing all of my work so anybody can follow along if they really want to, here (warning, it's boring and very long):
<http://lightning.memso.com/media/perm/mandelbrot2.txt>
I used a couple regex's in EditPadPro, to find all the `; Final: ...` entries in the file and dump them as hex binary to a .com file. The resulting binary is what you see at the top of this post.
[Answer]
## Java, ~~505~~ ~~405~~ 324 bytes
Just a standard calculation, ~~with golfitude~~ now with extra golfitude.
![enter image description here](https://i.stack.imgur.com/XMrxo.png)
Golfed:
```
import java.awt.*;class M{public static void main(String[]v){new Frame(){public void paint(Graphics g){for(int t,s,n=640,i=n*n;--i>0;g.setColor(new Color(s*820)),g.drawLine(i/n,i%n+28,i/n,i%n),setSize(n,668)){float c=4f/n,a=c*i/n-2,b=i%n*c-2,r=a,e=b,p;for(s=t=99;t-->0&&r*r+e*e<4;s=t,p=r*r-e*e+a,e=r*e*2+b,r=p);}}}.show();}}
```
With line breaks:
```
import java.awt.*;
class M{
    public static void main(String[]v){
        new Frame(){
            public void paint(Graphics g){
                for(int t,s,n=640,i=n*n;--i>0;g.setColor(new Color(s*820)),g.drawLine(i/n,i%n+28,i/n,i%n),setSize(n,668)){
                    float c=4f/n,a=c*i/n-2,b=i%n*c-2,r=a,e=b,p;
                    for(s=t=99;t-->0&&r*r+e*e<4;s=t,p=r*r-e*e+a,e=r*e*2+b,r=p);
                }
            }
        }.show();
    }
}
```
[Answer]
# Javascript (ECMAScript 6) - ~~315~~ 308 Characters
```
document.body.appendChild(e=document.createElement("canvas"));v=e.getContext("2d");i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(87);f(0);f(0);k[j++]=255}v.putImageData(i,0,0)
```
![Default Output](https://i.stack.imgur.com/J1bSN.png)
```
(d=document).body.appendChild(e=d.createElement`canvas`);v=e.getContext`2d`;i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(87);f(0);f(0);k[j++]=255}v.putImageData(i,0,0)
```
* Change `n` to vary the image size (and number of iterations).
* Change the values passed in the `f(87);f(0);f(0);` calls (near the end) to change the RGB colour values. (`f(8);f(8);f(8);` is greyscale.)
With `f(8);f(23);f(87);`:
![enter image description here](https://i.stack.imgur.com/0DqHq.png)
```
(d=document).body.appendChild(e=d.createElement`canvas`);v=e.getContext`2d`;i=v.createImageData(e.width=e.height=n=600,n);j=0;k=i.data;f=r=>k[j++]=(n-c)*r%256;for(y=n;y--;)for(x=0;x++<n;){c=s=a=b=0;while(c++<n&&a*a+b*b<5){t=a*a-b*b;b=2*a*b+y*4/n-2;a=t+x*4/n-2}f(8);f(23);f(87);k[j++]=255}v.putImageData(i,0,0)
```
[Answer]
# J, 73 bytes
```
load'viewmat'
(0,?$~99 3)viewmat+/2<|(j./~i:2j479)(+*:) ::(3:)"0^:(i.99)0
```
![mandelbrot set](https://i.stack.imgur.com/BktN5.png)
**Edit**, some explaining:
```
x (+*:) y           NB. is x + (y^2)
x (+*:) ::(3:) y    NB. returns 3 when (+*:) fails (NaNs)
j./~i:2j479         NB. a 480x480 table of complex numbers in required range
v =: (j./~i:2j479)(+*:) ::(3:)"0 ]     NB. (rewrite the above as one verb)
v z0                NB. one iteration of the mandelbrot operation (z0 = 0)
v v z0              NB. one iteration on top of the other
(v^:n) z0           NB. the result of the mandelbrot operation, after n iterations
i.99                NB. 0 1 2 3 4 ... 98
(v^:(i.99))0        NB. returns 99 tables, one for each number of iterations
2<| y               NB. returns 1 if 2 < norm(y), 0 otherwise
2<| (v^:(i.99))0    NB. 99 tables of 1s and 0s
+/...               NB. add the tables together, element by element.
NB. we now have one 480x480 table, representing how many times each element exceeded norm-2.
colors viewmat M    NB. draw table 'M' using 'colors'; 'colors' are rgb triplets for each level of 'M'.
$~99 3              NB. 99 triplets of the numbers 99,3
?$~99 3             NB. 99 random triplets in the range 0 - 98 and 0 - 2
0,?$~99 3           NB. prepend the triplet (0,0,0): black
```
[Answer]
# Mathematica, ~~214~~ ~~191~~ ~~215~~ ~~19~~ 30
Since version 10.0 there is a built-in: (19 bytes)
```
MandelbrotSetPlot[]
```
[![mandelbrot](https://i.stack.imgur.com/WeLG1.png)](https://i.stack.imgur.com/WeLG1.png)
---
To conform to the coordinate range requirements, 11 additional bytes are required. (30 bytes)
```
MandelbrotSetPlot@{-2-2I,2+2I}
```
[![m2](https://i.stack.imgur.com/n9TKj.png)](https://i.stack.imgur.com/n9TKj.png)
---
A hand-rolled case:
```
m=Compile[{{c,_Complex}},Length[FixedPointList[#^2+c&,0,99,SameTest→(Abs@#>=2&)]]];
ArrayPlot[Table[m[a+I b],{b,-2,2,.01},{a,-2,2,.01}],DataRange→{{-2,2},{-2,2}},
ColorRules→{100→Black},ColorFunction→(Hue[Log[34,#]]&)]
```
![green](https://i.stack.imgur.com/efxtb.png)
[Answer]
# Python with Pylab+Numpy, 151 bytes
I couldn't bear to see a non-DQ'ed Python entry, but I think I really outdid myself on this one, and I made it down to 153 characters!
```
import numpy as n
from pylab import*
i=99
x,y=n.mgrid[-2:2:999j,-2:2:999j]
c=r=x*1j+y
x-=x
while i:x[(abs(r)>2)&(x==0)]=i;r=r*r+c;i-=1
show(imshow(x))
```
Also, notably, the second to last line raises 4 distinct runtime warnings, a new personal record!
![enter image description here](https://i.stack.imgur.com/RzPhj.png)
[Answer]
# C + Allegro 4.2.2 - 248 bytes
```
#include<allegro.h>
x=-1,y,K=400;float a,h,c,d,k;main(i){set_gfx_mode('SAFE',K,K,allegro_init(),0);while(x++<K)
for(y=0;y<K;y++){for(a=h=i=0;a*a+h*h<4&&++i<256;k=a,a=a*a-h*h+x*0.01-2,h=2*k*h+y*0.01-2);
putpixel(screen,x,y,i);}while(1);}END_OF_MAIN()
```
Output:
![MSet 1](https://i.stack.imgur.com/t95Jk.png)
[Answer]
### Windows PowerShell (v4), 299 bytes
[![Mandelbrot fractal picture](https://i.stack.imgur.com/zx9Uf.png)](https://i.stack.imgur.com/zx9Uf.png)
```
# Linewrapped here for show:
$M='System.Windows.Forms';nal n New-Object;Add-Type -A System.Drawing,$M;(
$a=n "$M.Form").backgroundimage=($b=n Drawing.Bitmap 300,300);0..299|%{
$r=$_;0..299|%{$i=99;$k=$C=n numerics.complex($_/75-2),($r/75-2);while(((
$k=$k*$k).Magnitude-lt4)-and$i--){$k+=$C}$b.SetPixel($_,$r,-5e6*++$i)}};$a.Show()
# The single line 299 char entry version:
$M='System.Windows.Forms';nal n New-Object;Add-Type -A System.Drawing,$M;($a=n "$M.Form").backgroundimage=($b=n Drawing.Bitmap 300,300);0..299|%{$r=$_;0..299|%{$i=99;$k=$C=n numerics.complex($_/75-2),($r/75-2);while((($k=$k*$k).Magnitude-lt4)-and$i--){$k+=$C}$b.SetPixel($_,$r,-5e6*++$i)}};$a.Show()
```
**Instructions**
* Run a normal PowerShell console (ISE might not work)
* Copy/paste code in, press Enter
* Wait - it takes a minute or more to run
* The only way to quit is to close the console
**Comment**
* There's a tiny bit of rule-testing going on with the colours inside the set; the rules say *"The other pixels (presumably inside the Mandelbrot set) must be colored either black or white'"*; the code is colouring the pixels completely black RGB(0,0,0) ... it just happens to be a transparent black RGBA(0,0,0,0). So what shows up is the form background colour of the current Windows theme, a slightly off-white RGB(240,240,240) in this case.
[Answer]
## Python + [PIL](http://www.pythonware.com/products/pil/), 166 bytes
```
import Image
d=600;i=Image.new('RGB',(d,d))
for x in range(d*d):
 z=o=x/9e4-2-x%d/150.j-2j;c=99
 while(abs(z)<2)*c:z=z*z+o;c-=1
 i.putpixel((x/d,x%d),5**8*c)
i.show()
```
Output (will open in the default \*.bmp viewer):
![](https://i.stack.imgur.com/K7WCm.png)
[Answer]
# BBC Basic (228 bytes)
What about languages that nobody ever heard of in code golf? Most likely could be optimized, but I'm not quite where - improvements possible. Based of <http://rosettacode.org/wiki/Mandelbrot_set#BBC_BASIC>, but I tried to code golf it as much as possible.
```
VDU23,22,300;300;8,8,8,8
ORIGIN0,300
GCOL1
FORX=0TO600STEP2
i=X/200-2
FORY=0TO300STEP2
j=Y/200
x=0
y=0
FORI=1TO128
IFx*x+y*y>4EXIT FOR
t=i+x*x-y*y
y=j+2*x*y
x=t
NEXT
COLOUR1,I*8,I*4,0
PLOTX,Y:PLOTX,-Y
NEXT
NEXT
```
![The generated Mandelbrot set](https://i.stack.imgur.com/DEi59.png)
The `>` symbol on image is prompt, and it's automatically generated after running the program.
[Answer]
# APL, 194 chars/bytes\*
```
m←{1{⍺=99:0⋄2<|⍵:⍺⋄(⍺+1)∇c+⍵*2}c←⍵}¨⍉v∘.+0j1×v←¯2+4÷s÷⍳s←640
'F'⎕WC'Form'('Coord' 'Pixel')('Size'(s s))
'B'⎕WC'Bitmap'('CMap'(0,,⍨⍪0,15+10×⍳24))('Bits'(24⌊m))
'F.I'⎕WC'Image'(0 0)('Picture' 'B')
```
This is for Dyalog APL with `⎕IO ⎕ML←1 3`
Most of the space is taken by API calls to show a bitmap in a window (lines 2, 3, 4)  
If there was a shortcut to do it, the code would be down to 60 chars (line 1)
**Ungolfed version** (only line 1)
```
s←640            ⍝ size of the bitmap
v←(4×(⍳s)÷s)-2   ⍝ vector of s reals, uniform between ¯2 and 2
m←(0j1×v)∘.+v    ⍝ square matrix of complex numbers from ¯2j¯2 to 2j2
m←{              ⍝ transform each number in matrix m according to the following
  1{             ⍝   function that takes iteration counter as ⍺ and current value as ⍵
    ⍺=99: 0      ⍝     if we have done 99 iterations, return 0
    2<|⍵: ⍺      ⍝     if |⍵| > 2 return the number of iterations done
    (⍺+1)∇c+⍵*2  ⍝     otherwise, increment the iterations and recurse with the new value
  }c←⍵           ⍝   save the initial value as c
}¨m    
```
**Screenshot:**
![screenshot](https://i.stack.imgur.com/XzwhZ.png)
\*: Dyalog has its own single byte charset, with the APL symbols mapped to the upper 128 byte values, so the entire code can be stored in 194 bytes.
[Answer]
### R, ~~199~~ 211 characters
Old solution at 199 characters:
```
r=seq(-2,2,l=500);c=t(sapply(r,function(x)x+1i*r));d=z=array(0,dim(c));a=1:25e4;for(i in 1:99){z[a]=c[a]+z[a]^2;s=abs(z[a])<=2;d[a[!s]]=i;a=a[s]};image(d,b=0:99,c=c(1,sample(rainbow(98))),ax=F,asp=1)
```
With indentation:
```
r=seq(-2,2,l=500)
c=t(sapply(r,function(x)x+1i*r)) #Produces the initial imaginary number matrix
d=z=array(0,dim(c)) #empty matrices of same size as c 
a=1:25e4            #(z will store the magnitude, d the number of iterations before it reaches 2)
for(i in 1:99){     #99 iterations
    z[a]=c[a]+z[a]^2
    s=abs(z[a])<=2
    d[a[!s]]=i
    a=a[s]
    }
image(d,b=0:99,c=c(1,sample(rainbow(98))),ax=F,asp=1) #Colors are randomly ordered (except for value 0)
```
![enter image description here](https://i.stack.imgur.com/0s72f.png)
**Edit:** Solution at 211 characters that colors the inside of the set and the outside of the first layer differently:
```
r=seq(-2,2,l=500);c=t(sapply(r,function(x)x+1i*r));d=z=array(0,dim(c));a=1:25e4;for(i in 1:99){z[a]=c[a]+z[a]^2;s=abs(z[a])<=2;d[a[!s]]=i;a=a[s]};d[a[s]]=-1;image(d,b=-1:99,c=c(1:0,sample(rainbow(98))),ax=F,asp=1)
```
With indentation:
```
r=seq(-2,2,l=500)
c=t(sapply(r,function(x)x+1i*r))
d=z=array(0,dim(c))
a=1:25e4
for(i in 1:99){
    z[a]=c[a]+z[a]^2
    s=abs(z[a])<=2
    d[a[!s]]=i
    a=a[s]
    }
d[a[s]]=-1 #Gives the inside of the set the value -1 to differenciate it from value 0.
image(d,b=-1:99,c=c(1,sample(rainbow(99))),ax=F,asp=1)
```
![enter image description here](https://i.stack.imgur.com/sqm6V.png)
[Answer]
# TI-80 BASIC, ~~125~~ 106 bytes
```
ZDECIMAL
FOR(Y,-2,2,.1
FOR(X,-2,2,.1
0->S
0->T
1->N
LBL N
N+1->N
IF S²+T²≥4
GOTO B
S²-T²+X->I
2ST+Y->T
I->S
IF N<20
GOTO N
LBL B
IF FPART (N/2
PT-ON(X,Y
END
END
```
Based on Digital Trauma's answer.
[![enter image description here](https://i.stack.imgur.com/0f0ap.jpg)](https://i.stack.imgur.com/0f0ap.jpg)
[Answer]
# Mathematica 10.0, 19 chars
```
MandelbrotSetPlot[]
```
[`MandelbrotSetPlot`](http://reference.wolfram.com/language/ref/MandelbrotSetPlot.html) is a new function in Mathematica 10.0. 
![enter image description here](https://i.stack.imgur.com/Sa6G6.png)
[Answer]
# Java - Processing (271 bytes)
```
void setup(){int h=100,e=5*h,i;float d,v,w,a,b,c;size(e,e);colorMode(HSB,h);loadPixels();d=4./e;v=2;for(int x=1;x<=e;x++){v-=d;w=2;for(int y=0;y<e;){w-=d;a=b=c=0;i=-1;while(a*a+b*b<4&&++i<h){c=a*a-b*b+v;b=2*a*b+w;a=c;}pixels[e*++y-x]=color(i*9%h,h,h-i);}}updatePixels();}
```
Expanded:
```
void setup(){
  int h=100, e=5*h, i; //init of size "e", max hue "h", iterator "i"
  float d,v,w,a,b,c; //init of stepwidth "d", y-coord "v", x-coord "w", Re(z) "a", Im(z) "b", temp_a "c"
  size(e,e);
  colorMode(HSB,h);
  loadPixels();
  d = 4./e;
  v = 2;
  for(int x = 1; x <= e; x++){
    v -= d;
    w = 2;
    for(int y = 0; y < e;){
      w -= d;
      a = b = c = 0;
      i = -1;
      while(a*a + b*b < 4 && ++i < h){
        c = a*a - b*b + v;
        b = 2*a*b + w;
        a = c;
      }
      pixels[e * ++y - x] = color(i*9 % h, h, h-i);
    }
  }
  updatePixels();
}
```
![](https://i.stack.imgur.com/5FCSN.jpg)
[Answer]
# Applesoft BASIC, ~~302~~ ~~286~~ 280 bytes
This picks random points to draw, so it will run forever and may never fill in the full plane.
```
1HGR:POKE49234,0:DIMco(10):FORc=0TO10:READd:co(c)=d:NEXT:DATA1,2,3,5,6,1,2,3,5,6,0
2x=INT(RND(1)*280):y=INT(RND(1)*96):x1=x/280*3-2:y1=y/191*2-1:i=0:s=x1:t=y1
3s1=s*s-t*t+x1:t=2*s*t+y1:s=s1:i=i+1:IFs*s+t*t<4ANDi<20THENGOTO3
4c=co(i/2):IFc THENHCOLOR=c:HPLOTx,y:HPLOTx,191-y
5GOTO2
```
Turns out Applesoft BASIC is *really* forgiving about lack of spaces. Only one space is necessary in the entire program.
Output after 14 hours:
        [![output](https://i.stack.imgur.com/qCoDC.png)](https://i.stack.imgur.com/qCoDC.png)
GIF:
        [![gif](https://i.stack.imgur.com/l5IYO.gif)](https://i.stack.imgur.com/l5IYO.gif)
Before golfing:
```
10 HGR : POKE 49234,0
20 DIM co(10) : FOR c = 0 TO 10 : READ d : co(c) = d : NEXT
30 DATA 1, 2, 3, 5, 6, 1, 2, 3, 5, 6, 0
100 x = INT(RND(1) * 280) : y = INT(RND(1) * 96)
110 x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
120 i = 0:s = x1:t = y1
130 s1 = s * s - t * t + x1
140 t = 2 * s * t + y1:s = s1: i = i + 1
150 IF s * s + t * t < 4 AND i < 20 THEN GOTO 130
160 c = co(i/2) : IF c THEN HCOLOR= c : HPLOT x,y : HPLOT x,191 - y
170 GOTO 100
```
Note: `POKE 49234,0` (in Applesoft BASIC) puts the machine into full graphics mode.
### A version optimized for B&W displays:
```
110 HGR:POKE 49234,0:HCOLOR=3
120 FOR x = 0 TO 279:FOR y = 0 TO 95
130 x1 = x / 280 * 3 - 2:y1 = y / 191 * 2 - 1
140 i = 0:s = x1:t = y1:c = 0
150 s1 = s * s - t * t + x1
160 t = 2 * s * t + y1:s = s1:c = 1 - c:i = i + 1
170 IF s * s + t * t < 4 AND i < 117 THEN GOTO 150
180 IF c = 0 THEN HPLOT x,y:HPLOT x,191 - y
190 NEXT:NEXT
```
Output after 12 hours:
        [![b&w](https://i.stack.imgur.com/K2fu9.png)](https://i.stack.imgur.com/K2fu9.png)
### A version that will work in GW-BASIC (DOS):
```
5 CLS
6 SCREEN 1
20 DIM co(10) : FOR c = 0 TO 10 : READ d : co(c) = d : NEXT
30 DATA 1, 2, 3, 5, 6, 1, 2, 3, 5, 6, 0
100 x = INT(RND(1) * 280) : y = INT(RND(1) * 96)
110 x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
120 i = 0 : s = x1 : t = y1
130 s1 = s * s - t * t + x1
140 t = 2 * s * t + y1 : s = s1 : i = i + 1
150 IF s * s + t * t < 4 AND i < 20 THEN GOTO 130
160 c = co(i/2) : PSET (x,y),C : PSET (x,191 - y),C
170 GOTO 100
```
[Answer]
# [R](https://www.r-project.org/), ~~140~~ ~~136~~ ~~128~~ ~~124~~ ~~123~~ ~~110~~ 109 bytes\*
```
image(outer(j<-1:396/99-2,j,Vectorize(function(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;n})),c=colors())
```
[Try it at rdrr.io](https://rdrr.io/snippets/embed/?code=image(outer(j%3C-1%3A396%2F99-2%2Cj%2CVectorize(function(x%2Cy%2Cn%3D99)%7Bwhile((n%3Dn-1)%26abs(F)%3C2)F%3DF*F%2Bx%2B1i*y%3Bn%7D))%2Cc%3Dcolors()))
6y after the Q was asked, but I love Mandelbrot sets, and the earlier R solution was 211 characters...
[![enter image description here](https://i.stack.imgur.com/I0XrN.png)](https://i.stack.imgur.com/I0XrN.png)
\*Or just [62 bytes](https://rdrr.io/snippets/embed/?code=pixel_shader%3Dfunction(x%2Cy%2Cn%3D99)%7Bwhile((n%3Dn-1)%26abs(F)%3C2)F%3DF*F%2Bx%2B1i*y%3Bcolors()%5Bn%2B1%5D%7D%0Aj%3D1%3A396%2F99-2%0Aimage(outer(j%2Cj%2CVectorize(function(x%2Cy)which(colors()%3D%3Dpixel_shader(x%2Cy))))%2Cc%3Dcolors())) as a [pixel-shader](https://codegolf.meta.stackexchange.com/a/18305/95126) function in [R](https://www.r-project.org/)≥4.1:  
`\(x,y,n=99){while((n=n-1)&abs(F)<2)F=F*F+x+1i*y;colors()[n+1]}`
[Answer]
## JavaScript, ~~284 283 ...(12 improvements)... 191 190 188~~ 199 bytes
currenty (2019-10-05) this is shortest js solution (the shortest one before this has [285 bytes](https://codegolf.stackexchange.com/a/24080/88163))
[![enter image description here](https://i.stack.imgur.com/1vJFc.png)](https://i.stack.imgur.com/1vJFc.png)
Expanded
```
// Fractal calculations
c=512;
// p has pixels, p+= allways join 4 digit number implicit casted to string
// 4 char string interpred as base64 gives 3bytes = 1 RGB pixel
for( p=i=''; j=x=y=0,++i<=c*c; p+= j<c ? 9*c+9*j : 'AAAA' ) 
  while( x*x+y*y<4 && ++j-c )
    [x,y] = [ x*x-y*y+i%c/128-2, 2*x*y+i/c/128-2 ];
  
// draw pixels in 512x512 BMP base64 image
document.write("<img src=data:;base64,Qk0bAAwAAAAAABsAAAAMAAAAAAIAAgEAGAAA"+p)
```
After small constans changes
```
c=512;for(p=i='';j=x=y=0,++i<=c*c;p+=j<c?2*c+9*j:'AAAA')while(x*x+y*y<4&&++j-c)[x,y]=[x*x-y*y+i%c/128-2,2*x*y+i/c/128-2]
document.write("<img src=data:;base64,Qk0bAAwAAAAAABsAAAAMAAAAAAIAAgEAGAAA"+p)
```
[Answer]
# GLSL - 225 bytes:
```
void main(){vec2 c=gl_FragCoord.xy/iResolution.y*4.-2.,z=c,v;for(int i=0;i<99;i++){z=vec2(z.x*z.x-z.y*z.y,2.*z.x*z.y)+c;if(length(z)>2.&&v.y<1.)v=vec2(float(i)/99.,1.);}gl_FragColor=(v.y<1.)?vec4(v,v):texture2D(iChannel0,v);}
```
Defining variables in the code (242 bytes):
```
uniform vec3 r;uniform sampler2D t;void main(){vec2 c=gl_FragCoord.xy/r.y*4.-2.,z=c,v;for(int i=0;i<99;i++){z=vec2(z.x*z.x-z.y*z.y,2.*z.x*z.y)+c;if(length(z)>2.&&v.y<1.)v=vec2(float(i)/99.,1.);}gl_FragColor=(v.y<1.)?vec4(v,v):texture2D(t,v);}
```
[See it in ShaderToy](https://www.shadertoy.com/view/Xs2GW3)
![Mandelbrot Golf](https://i.stack.imgur.com/Wjn4B.png)
This requires a suitable palette texture be loaded as `iChannel0`. (The colouring here is from the "random pixel" texture on ShaderToy).
[Answer]
# Octave (~~212~~ 136 bytes)
(Now including some ideas due to @ChrisTaylor.)
```
[y,x]=ndgrid(-2:.01:2);z=c=x+i*y;m=c-c;for n=0:99;m+=abs(z)<2;z=z.^2+c;end;imagesc(m);colormap([hsv(128)(1+mod(0:79:7890,128),:);0,0,0])
```
With whitespace:
```
[y,x] = ndgrid(-2:.01:2);
z = c = x + i*y;
m = c-c;
for n=0:99
    m += abs(z)<2;
    z = z.^2 + c;
end
imagesc(m)
colormap([hsv(128)(1+mod(0:79:7900,128),:);
          0,0,0])
```
Output:
![Mandelbrot steps to abs(z)>2](https://i.stack.imgur.com/MHQOw.png)
To convert to Matlab, change "`m+=abs(z)<2`" to "`m=m+(abs(z)<2)`". [+3 bytes]
To make the aspect ratio 1:1, add "`;axis image`". [+11 bytes]
My first answer (212 bytes):
```
[x,y]=meshgrid(-2:.01:2);z=c=x+i*y;m=0*e(401);for n=0:99;m+=abs(z)<2;z=z.^2+c;endfor;t=[0*e(1,7);2.^[6:-1:0]];[s{1:7}]=ndgrid(num2cell(t,1){:});t=1+sum(cat(8,s{:}),8);imagesc(m);colormap([hsv(128)(t(:),:);0,0,0])
```
[Answer]
## [PostScript](https://en.wikipedia.org/wiki/PostScript), ~~290~~ ~~285~~ ~~282~~ ~~271~~ 261 bytes
#### Screenshot:
[![screeshot](https://i.stack.imgur.com/eK42t.png)](https://i.stack.imgur.com/eK42t.png)
#### Golfed code:
```
-2 .01 2{/a exch def -2 .01 2{/b exch def/x 0 def/y 0 def 0 1 99{/i exch def x x mul y y mul add 4 ge{i log 2 div 1 1 sethsbcolor a 2 add 100 mul b 2 add 100 mul 1 1 rectfill exit}if/x x x mul y y mul sub a add/y 2 x mul y mul b add def def}for}for}for showpage
```
#### Ungolfed code:
```
-2 .01 2 {
    /a exch def
    -2 .01 2 {
        /b exch def
        /x 0 def
        /y 0 def
        0 1 99 {
           /i exch def                       % iteration count
           x x mul y y mul add 4 ge {
               i log 2 div 1 1 sethsbcolor   % rainbow colors outside
               a 2 add 100 mul
               b 2 add 100 mul 1 1 rectfill
               exit
           } if
           /x x x mul y y mul sub a add
           /y 2 x mul y mul b add
           def def
       } for
    } for
} for
showpage
```
[Answer]
# gnuplot 110 (105 without newlines)
Obligatory gnuplot entry. It's been done countless times but this one is from scratch (not that it's difficult). I like how `gnuplot` golfs its commands intrinsically :)
```
f(z,w,n)=abs(z)>2||!n?n:f(z*z+w,w,n-1)
se vi map
se si sq
se isos 256
sp [-2:2] [-2:2] f(0,x+y*{0,1},99) w pm
```
ungolfed:
```
f(z,w,n)=abs(z)>2||n==0?n:f(z*z+w,w,n-1)
set view map
set size square
set isosamples 256
splot [-2:2] [-2:2] f(0,x*{1,0}+y*{0,1},99) with pm3d
```
However, I'm DEEPLY disappointed at the entry of complex numbers. `x*{1,0}+y*{0,1}` must be the saddest existing way of constructing a complex number.
Oops, the image:
![gnuplot mandelbrot](https://i.stack.imgur.com/oY7Wa.png)
Set isosamples higher for better resolution. We could also say `unset tics` and `unset colorbox` for a pure image, but I think this version qualifies just fine.
[Answer]
## Matlab (89 bytes)
```
[X,Y]=ndgrid(-2:.01:2);C=X+i*Y;Z=C-C;K=Z;
for j=1:99,Z=Z.*Z+C;K=K+(abs(Z)<2);end,imagesc(K)
```
Output -
![enter image description here](https://i.stack.imgur.com/3zaic.png)
Doesn't satisfy the requirement that the inner cells must be black or
white, but that can be satisfied by either (1) using `imshow(K)` instead
of `imagesc(K)` (requires 1 fewer byte but needs the image processing
toolbox) or (2) appending `colormap hot` (requires 12 more bytes).
Ungolfed version -
```
Z = zeros(N);
K = Z;
[X,Y]=ndgrid(-2:.01:2);
C = X+1i*Y;
for j = 1:99
  Z = Z.*Z + C;
  K(K==0 & abs(Z) > 2) = j;
end
imagesc(K)
```
[Answer]
# Excel VBA, ~~251~~ ~~246~~ ~~224~~ ~~223~~ 221 bytes
Saved 5 bytes thanks to ceilingcat
Saved 23 bytes thanks to Taylor Scott
```
Sub m
D=99
For x=1To 4*D
For y=1To 4*D
p=0
q=0
For j=1To 98
c=2*p*q
p=p^2-q^2-2+(x-1)/D
q=c+2+(1-y)/D
If p^2+q^2>=4Then Exit For
Next
j=-j*(j<D)
Cells(y,x).Interior.Color=Rnd(-j)*1E6*j/D
Next y,x
Cells.RowHeight=48
End Sub
```
Output:
[![Output with D = 99](https://i.stack.imgur.com/jcPqJ.png)](https://i.stack.imgur.com/jcPqJ.png)
I made a version that did this a long time ago but it had a lot of extras like letting the user pick the basic color and easy-to-follow math. Golfing it way down was an interesting challenge. The `Color` method uses `1E6` as a means to get a wide range of colors since the valid colors are `0` to `2^24`. Setting it to `10^6` gave nice contrast areas.
Explanation / Auto-Formatting:
```
Sub m()
    'D determines the number of pixels and is factored in a few times throughout
    D = 99
    For x = 1 To 4 * D
    For y = 1 To 4 * D
        'Test to see if it escapes
        'Use p for the real part and q for the imaginary
        p = 0
        q = 0
        For j = 1 To 98
            'This is a golfed down version of complex number math that started as separate generic functions for add, multiple, and modulus
            c = 2 * p * q
            p = p ^ 2 - q ^ 2 - 2 + (x - 1) / D
            q = c + 2 + (1 - y) / D
            If p ^ 2 + q ^ 2 >= 4 Then Exit For
        Next
        'Correct for no escape
        j = -j * (j < D)
        'Store the results
        'Rnd() with a negative input is deterministic
        'This is what gives us the distinct color bands
        Cells(y, x).Interior.Color = Rnd(-j) * 1000000# * j / D
    Next x, y
    'Resize for pixel art
    Cells.RowHeight = 48
End Sub
```
---
I also played around with `D=999` and `j=1 to 998` to get a much larger and more precise image. The results are irrelevant to the challenge because they're way too large but they *are* neat.
[![D=999](https://i.stack.imgur.com/FHIHY.jpg)](https://i.stack.imgur.com/FHIHY.jpg)
[Answer]
## [Floater](https://esolangs.org/wiki/Floater), 620 pixels
A language I made up when I got inspired by my own challenge, as well as from the esoteric language Piet.
![enter image description here](https://i.stack.imgur.com/VfnKu.png)
[Answer]
# JavaScript + HTML5 (356B)
(Note: lines ending with '//' are added here for some readability)
Performant version (375B):
```
<body onload='var
w,h=w=C.width=C.height=500,X=C.getContext("2d"),I=X.createImageData(w,h),D=I.data, //
y=0,f=255,T=setInterval(function(x,i,j,k,l,c,o){for(x=0;x<w;){                     //
for(i=x*4/w-2,j=y*4/h-2,k=l=0,c=f;--c&&k*k+l*l<4;)t=k*k-l*l+i,l=2*k*l+j,k=t
D[o=(y*w+x++)*4]=(c*=0xc0ffeeee)&f
D[++o]=c>>8&f
D[++o]=c>>16&f
D[++o]=f}X.putImageData(I,0,0)
++y-h||clearInterval(T)},0)'><canvas id=C>
```
Slow version (356B): remove the 'var' and parameters in the inner function so that the global scope is used.
Try it out: <http://jsfiddle.net/neuroburn/Bc8Rh/>
![enter image description here](https://i.stack.imgur.com/WlPl6.png)
[Answer]
# Javascript, 285B
Based off my code and some improvements on [MT0's](https://codegolf.stackexchange.com/users/15968/mt0) code, I've got this down to 285B in colour:
```
document.body.appendChild(V=document.createElement('Canvas'));j=(D=(X=V.getContext('2d')).createImageData(Z=V.width=V.height=255,Z)).data;for(x=Z*Z;x--;){k=a=b=c=0;while(a*a+b*b<4&&Z>k++){c=a*a-b*b+4*(x%Z)/Z-3;b=2*a*b+4*x/(Z*Z)-2;a=c;}j[4*x]=99*k%256;j[4*x+3]=Z;}X.putImageData(D,0,0);
```
in action: <http://jsfiddle.net/acLhe/7/>
### was: Coffeescript, 342B
```
document.body.appendChild V=document.createElement 'Canvas'
N=99
Z=V.width=V.height=400
P=[]
P.push "rgba(0,0,0,"+Math.random()*i/N+')' for i in [N..0]
X=V.getContext '2d'
for x in [0..Z]
 for y in [0..Z]
  k=a=b=0
  [a,b]=[a*a-b*b+4*x/Z-3,2*a*b+4*y/Z-2] while a*a+b*b<4 and N>k++
  X.fillStyle=P[k-1]
  X.fillRect x,y,1,1
```
Coffeescript is supposed to be readable :-/ see it in action: <http://jsfiddle.net/acLhe/6/>
![Mandelbrot Coffeescript](https://i.stack.imgur.com/9rMdo.png)
]