Of course, there has to be a Mandelbrot submission.
char red_fn(int i,int j){
float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}
Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn
and use that macro in the other two so I have more characters for fancy colour selection in green and blue?
Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:
/* RED */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE */ return 128-log(k)*23;
And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:
E.g.
char red_fn(int i,int j){
float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char green_fn(int i,int j){
float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char blue_fn(int i,int j){
float x=0,y=0,k=0,X,Y;while(k++<256&&k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return 128-k/2;200;
}
gives