The JSL 2D matrix can be turned into an image using the NewImage function. 2D matrices and images use a lot of memory; you might be able to make a 30K x 30K matrix full of color values and display it. If you want to save it as a PNG file, you might need to try a smaller size; 20K x 20K worked for me. Here's some JSL with a comment about how you might avoid having multiple copies of the matrix in memory at once.
clear globals();
m = J( 20000, 20000, . );
Parallel Assign( {}, m[r( -1.5, 1.5 ), c( -2.25, 0.75 )] =
(
x = ((Mandelbrot( 10000, 0, c, r ) ^ .1) - 1.1) / 1.5 ;
RGB Color( (x) ^ .5, (x) ^ 9, (1 - x) ^ 9 ) ;
)
);
m=newimage(m);
New Window( "m", m );
m<<savepicture("$desktop/mandelbrot.png","png");
There are two choices with NewImage: a single matrix containing JSL rgb colors, or three matrices of r, g, and b values between 0 and 1. The JSL shown uses the first choice because only one matrix needs to exist. The second choice is more flexible but will require, at least for a moment, four matrices to exist.
The attached picture is 20,000 by 20,000 pixels; depending on your viewer you'll want to scroll or zoom.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.