可以使用 NewImage 函数将 JSL 二维矩阵转换为图像。 二维矩阵和图像占用大量内存;您也许可以制作一个充满颜色值的 30K x 30K 矩阵并显示它。 如果要将其另存为 PNG 文件,可能需要尝试使用较小的尺寸; 20K x 20K 对我有用。 Here's some JSL with a comment 关于如何避免在内存中同时拥有矩阵的多个副本。
clear globals();
// notes on making big images
//
// a 20Kx20K matrix is 20000*20000*8/1024/1024/1024 = 3GB
// the image created from it will be at least half that size too, in memory.
// clear globals, above, makes sure old matrices are released, otherwise
// m=J(...) might have the old matrix in m on the left hand side while the
// new matrix is being created on the right hand side. Two copies at once.
// the parallel assign below is designed to do all the processing on an element.
// using m = f(m) later creates extra copies, and single-threaded. The
// commented-out range(m) was from previous runs to figure out the
// -1.1 and /1.5 scaling on the mandelbrot results. The critical
// part is making the RGB color from f1(m), f2(m), f3(m) inside the
// parallel assign. Otherwise there could be four! copies of m if
// newimage("rgb", {f1(m), f2(m), f3(m)})
// ---
// the above was important for a 30Kx30K matrix, using ~7GB; my machine
// could not hold ~28GB at once. But I had to reduce it to 20K anyway to
// save the picture; somewhere bigger than 20K refuses to save the image.
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 ; // scaled counts
RGB Color( (x) ^ .5, (x) ^ 9, (1 - x) ^ 9 ) ; // keep final color
) //
);
//Show( Range( m ) ); // m holds JSL colors not mandelbrot counts. range is meaningless
m=newimage(m);
New Window( "m", m );
m<<SAVEPICTURE></SAVEPICTURE>NewImage 有两种选择:包含 JSL rgb 颜色的单个矩阵,或 r、g 和 b 值介于 0 和 1 之间的三个矩阵。 显示的 JSL 使用第一个选项,因为只需要存在一个矩阵。 第二种选择更灵活,但至少暂时需要四个矩阵。
所附图片为20,000 x 20,000像素;根据您的查看器,您需要滚动或缩放。