0x1d01…aa9a

All memos sent from and to 0x1d01…aa9a.

andom_dec()) / 1.5); } } } } else if (cfg.style == 2) { // curvy threads let angle, n, nst = 100, dx, dy, step = pt/5; for (let i = 0; i < 10000; i++) { let xstart = mrgn + rnd.random_dec() * ww, ystart = mrgn + rnd.random_dec() * wh, len = rnd.random_int(50, 100); for (let j = 0; j < len; j++) { n = noise(nst * (xstart / w), nst * (ystart / h)); angle = n * 2 * Math.PI; dx = step * Math.cos(angle); dy = step * Math.sin(angle); xstart += dx; ystart += dy; if (rnd.random_dec() < 0.1) { ellipse(xstart, ystart, pt * (1 + rnd.random_dec()) / 1.5); } } } } else if (cfg.style == 3) { // curvy graphs if ("gap" in cfg == false) cfg.gap = ww / rnd.random_choice([50, 100]); if ("round" in cfg == false) cfg.round = rnd.random_choice([-1, 2, 4, 8]); let x_start, y_start, angle, n, nst, dx, dy, step = pt/10; for (let i = mrgn; i <= mrgn + ww; i += cfg.gap) { x_start = i; nst = 5; for (y_start = mrgn; y_start <= mrgn + wh; y_start += pt / 2) { n = noise(nst * (x_start / w), nst * (y_start / h)); angle = n * Math.PI; if (cfg.round != -1) angle = int(angle / (1/cfg.round * PI)) * 1/cfg.round * PI; dx = step * Math.cos(angle); x_start += dx; if (rnd.random_dec() < 0.35) { ellipse(x_start, y_start, pt * (1 + 0.5 * rnd.random_dec())); } } } for (let i = mrgn; i <= mrgn + wh; i += cfg.gap) { y_start = i; nst = 1; for (let x_start = mrgn; x_start < mrgn + ww; x_start += pt / 2) { n = noise(nst * (x_start / w), nst * (y_start / h)); angle = n * 2 * Math.PI; if (cfg.round != -1) angle = int(angle / (1/cfg.round * PI)) * 1/cfg.round * PI; dy = step * Math.sin(angle); y_start += dy; if (rnd.random_dec() < 0.35) { ellipse(x_start, y_start, pt * (1 + 0.5 * rnd.random_dec())); } } } } return cfg; } // from https://stackoverflow.com/questions/8022885/rgb-to-hsv-color-in-javascript // input: r,g,b in [0,1], out: h in [0,360) and s,v in [0,1] function rgb2hsv(r, g, b) { // r = r/255; g = g/255; b = b/255; let v = Math.max(r, g, b), c = v - Math.min(r, g, b); let h = c && ((v == r) ? (g - b) / c : ((v == g) ? 2 + (b - r) / c : 4 + (r - g) / c)); return [60 * (h < 0 ? h + 6 : h), v && c / v, v]; } // from https://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately/54024653#54024653 // input: h in [0,360] and s,v in [0,1] - output: r,g,b in [0,1] function hsv2rgb(h, s, v) { let f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0); // return [f(5)*255,f(3)*255,f(1)*255]; return [f(5), f(3), f(1)]; } // from https://stackoverflow.com/questions/45309447/calculating-median-javascript // function median(values) { // if (values.length === 0) throw new Error("No inputs"); // values.sort(function(a, b) { // return a - b; // }); // var half = Math.floor(values.length / 2); // if (values.length % 2) // return values[half]; // return (values[half - 1] + values[half]) / 2.0; // } // From https://stackoverflow.com/questions/1669190/find-the-min-max-element-of-an-array-in-javascript Array.prototype.max = function() { return Math.max.apply(null, this); }; Array.prototype.min = function() { return Math.min.apply(null, this); }; // From https://stackoverflow.com/questions/2963281/javascript-algorithm-to-find-elements-in-array-that-are-not-in-another-array function setdiff(a1, a2) { // console.log(a1) // console.log(a2) // console.log(a2.filter(x => !a1.includes(x)) ) return a2.filter(x => !a1.includes(x)) } function generate_masks_colors_noise(color_style) { /************************************************************************* * Generate pattern of masks and colors *************************************************************************/ let pattern_so_far = new Array(), color_pattern_so_far = new Array(); // generate pattern of masks and colors for (var i = 0; i < mask_model.length; i++) { if (color_style == CLR_FROM_MODEL) { if (i == 0) { pattern[i] = rnd.random_choice(mask_model[i]); } else { pattern[i] = rnd.random_choice(setdiff(pattern_so_far, mask_model[i][pattern[i - 1]])); } if (i == 0) { color_pattern[i] = rnd.random_choice(color_model[pattern[i] - 1]); } else { color_pattern[i] = rnd.random_choice(setdiff(color_pattern_so_far, color_model[pattern[i] - 1])); } pattern[i] = pattern[i] - 1; color_pattern[i] = color_pattern[i] - 1; pattern_so_far.push(pattern[i] + 1); color_pattern_so_far.push(color_pattern[i] + 1); } else if (color_style == CLR_UNIFORM) { if (i == 0) { pattern[i] = round(rnd.random_dec() * (masks.length - 1)); } else { pattern[i] = rnd.random_choice(setdiff(pattern, [...Array(masks.length).keys()])); } if (i == 0) { color_pattern[i] = round(rnd.random_dec() * (num_colors_per_palette - 1)); } else { color_pattern[i] = rnd.random_choice(setdiff(color_pattern, [...Array(num_colors_per_palette).keys()])) } } // The shape prototypes are the prototypes themselves (25), and their flipped versions (25 more). So if the shape id is >25, need to subtract 25 and use its flipped version. if (pattern[i] > (num_prototypes - 1)) { mask_gen[i] = reshape(masks[pattern[i] - num_prototypes], Nx, Ny) mask_gen_use = new Array for (var cuse = 0; cuse < mask_gen[i].length; cuse++) { mask_gen_use[cuse] = mask_gen[i][mask_gen[i].length - cuse - 1]; } mask_gen[i] = mask_gen_use; } else { mask_gen[i] = reshape(masks[pattern[i]], Nx, Ny) } } // noise_vector = [-0.1476, 0.0409, -0.0298]; // test vector to match MATLAB implementation for (var k = 0; k < mask_model.length; k++) { noise_vector[k] = new Array(); for (var n = 0; n < min_noise.length; n++) { noise_vector[k][n] = rnd.random_num(min_noise[n] / precision, max_noise[n] / precision); } } /*************************************************************************/ } function infer_category() { // predict category using classifier saved in model.js: landscape, flower, urban, bird let pred_scene = new Array(); for (var i = 0; i < num_categories; i++) { pred_scene[i] = rnd.random_dec() * 0.00001; for (var k = 0; k < pattern.length; k++) { pred_scene[i] = pred_scene[i] + pfgc[pattern[k]][k][i]; } } return pred_scene.indexOf(max(pred_scene)); }
tte_names.indexOf(_C.palette)]; /*************************************************************************/ /************************************************************************* * Background color and grid. *************************************************************************/ background(white); bg_cfg = create_grid_background(mrgn = 0, {style: bg_style_names.indexOf(_C.bg_style)}); rnd = new Random(seed); /*************************************************************************/ /************************************************************************* * Style-specific options. *************************************************************************/ sshape = rnd.random_choice(["rect", "ellipse"]); num_elements = 100000; strokeWeight(w / 600); y_offsets = {}; op_layers = {}; patch_factor = rnd.random_choice([w / 30, w / 20]); /*************************************************************************/ console.log(_C); noLoop(); } function draw() { /************************************************************************* * Let's draw! *************************************************************************/ for (var n = 0; n < num_elements; n++) { let x = rnd.random_num(0, w), y = rnd.random_num(0, h); // y = n/num_elements*h; if (_C.reflection == "yes") { if (y > 2*h/3) { ysend = y-2*h/3; ysend = ysend*3; ysend = h-ysend; } else { ysend = y/(2*h/3)*h; } } else { ysend = y; } let use_color_gen = get_color_for_location(x, ysend, Nx, Ny, color_pattern, mask_gen, use_colors, _C.texture == "gradient", noise_vector) // samples the color to be used at a location let use_color = use_color_gen[0], gen = use_color_gen[1]; if (_C.texture == "gradient") { let use_color_hsv = rgb2hsv(use_color[0], use_color[1], use_color[2]); //TODO: Target colors are just one of 4. Don't need to convert them to HSV for each pixel separately. Convert once and then use. let target_color = use_colors[color_pattern[gen]], target_color_hsv = rgb2hsv(target_color[0], target_color[1], target_color[2]); // Hue directly set to the target hue. Not affected by xy2rgb. use_color_hsv[0] = target_color_hsv[0]; // Value directly set to the target hue. Not affected by xy2rgb. use_color_hsv[2] = target_color_hsv[2]; use_color = hsv2rgb(use_color_hsv[0], use_color_hsv[1], use_color_hsv[2]) } place_mark(x, y, use_color) } /*************************************************************************/ // Sanity check seed value across resolutions after everything's done. console.log(rnd.random_dec()); /************************************************************************* * Grains *************************************************************************/ for (let i = 0; i < 20000; i++) { let x = margin + rnd.random_dec() * (w - 2 * margin), y = margin + rnd.random_dec() * (h - 2 * margin); let clr = [white[0], white[1], white[2], rnd.random_dec() * 0.2 * 255]; stroke(clr); fill(clr); circle(x, y, rnd.random_dec() * pt / 2); } bg_cfg.clr = bg_white_stroke; create_grid_background(mrgn=0, bg_cfg); /*************************************************************************/ duration = Date.now() - start; console.log(duration, "ms") // saveCanvas(tokenData.hash.toString() + '_' + _C.bg_style.toString() + '_' + _C.category.toString() + '_' + _C.color_style.toString() + '_' + _C.palette_idx.toString() + '_' + _C.reflection.toString() + '_' + _C.use_xy2rgb.toString(), 'png') } function place_mark(x, y, use_color) { // Don't draw in the margins. if (x < margin || x > w - margin || y < margin || y > h - margin) return; if (op_layers.hasOwnProperty(int(x / patch_factor)) == false) op_layers[int(x / patch_factor)] = rnd.random_dec() * 128 * (x - margin) / (w - 2 * margin); else rnd.random_dec(); use_color = rgb2hsv(use_color[0], use_color[1], use_color[2]); use_color[2] = (0.96 + 0.04 * (x - margin) / (w - 2 * margin)) * use_color[2]; use_color = hsv2rgb(use_color[0], use_color[1], use_color[2]); use_color.push(128 + op_layers[int(x / patch_factor)]); fill(use_color); stroke(use_color); if (y_offsets.hasOwnProperty(int(x / patch_factor)) == false) y_offsets[int(x / patch_factor)] = rnd.random_choice([-1, 1]) * rnd.random_dec(); else rnd.random_choice([-1, 1]) * rnd.random_dec(); if (sshape == "rect") rect(x, y_offsets[int(x / patch_factor)] * (h / 100) + y, rnd.random_choice([w / 150, w / 125, w / 100]), rnd.random_choice([w / 100, w / 75, w / 50])); else if (sshape == "ellipse") ellipse(x, y_offsets[int(x / patch_factor)] * (h / 100) + y, rnd.random_choice([w / 150, w / 125, w / 100]), rnd.random_choice([w / 100, w / 75, w / 50])); } function get_color_for_location_xy2rgb(x, y, noise_vector, precision) { x = x - w / 2; x = x / w; y = y - h / 2; y = y / h; F = [y, x]; // model was trained to take row (i.e., y) as the first feature for (var n = 0; n < min_noise.length; n++) { F.push(noise_vector[n]) } for (var L = 0; L < Weights.length; L++) { W = Weights[L]; B = Bias[L]; if (L == Weights.length - 1) { is_relu = false; } else { is_relu = true; } A = get_activations(F, W, B, is_relu, precision); F = A; } use_color = A; for (var m = 0; m < 3; m++) { if (use_color[m] < 0) { use_color[m] = 0 } if (use_color[m] > 1) { use_color[m] = 1 } use_color[m] = Math.round(use_color[m] * 255); } return use_color; } function get_activations(F, W, B, is_relu, precision) { A = new Array(); for (var j = 0; j < W.length; j++) { A[j] = B[j]; // Borrowed from https://github.com/photopea/UNN.js/blob/master/UNN.js#L22. let l = W[j].length, k = 0; while (((l - k) & 3) != 0) A[j] += F[k] * W[j][k++]; for (; k < l; k += 4) A[j] += F[k] * W[j][k] + F[k + 1] * W[j][k + 1] + F[k + 2] * W[j][k + 2] + F[k + 3] * W[j][k + 3]; A[j] = A[j] / precision; if (is_relu) { if (A[j] < 0) { A[j] = 0 } } } return A } function get_color_for_location(c, r, Nx, Ny, color_pattern, mask_gen, use_colors, use_xy2rgb, noise_vector) { // does bilinear interpolation on mask_gen (which is 10x10 maps for 4 colors) to figure out distribution over the 4 colors at any (x,y) location. Then argmax, or average, or sample from the distribution. Need to do this right based on the quadrant to get the symmetries I mentioned. let cuse = ((c - margin) / (w - 2 * margin) * (Nx - 1)), ruse = ((r - margin) / (h - 2 * margin) * (Ny - 1)), ca = cuse - floor(cuse), ra = ruse - floor(ruse); // getting the to-left, top-right, etc. co-ordinates to use as anchors for bilinear interpolation let ptl = new Array; for (var k = 0; k < pattern.length; k++) { ptl[k] = mask_gen[k][max(0, floor(cuse))][max(0, floor(ruse))]; } let ptr = new Array; for (var k = 0; k < pattern.length; k++) { ptr[k] = mask_gen[k][min(9, ceil(cuse))][max(0, floor(ruse))]; } let pbl = new Array; for (var k = 0; k < pattern.length; k++) { pbl[k] = mask_gen[k][max(0, floor(cuse))][min(9, ceil(ruse))]; } let pbr = new Array; for (var k = 0; k < pattern.length; k++) { pbr[k] = mask_gen[k][min(9, ceil(cuse))][min(9, ceil(ruse))]; } // interpolation let p = new Array; for (var k = 0; k < pattern.length; k++) { p[k] = (1 - ca) * (1 - ra) * ptl[k] + (ca) * (1 - ra) * ptr[k] + (1 - ca) * (ra) * pbl[k] + (ca) * (ra) * pbr[k]; } // max let gen = p.indexOf(max(p)); if (use_xy2rgb == true) { use_color = get_color_for_location_xy2rgb(c, r, noise_vector[gen], precision) } else { use_color = use_colors[color_pattern[gen]]; } return [use_color, gen]; } function reshape(vector, R, C) { var i = 0; var grid = new Array() for (var c = 0; c < C; c++) { grid[c] = new Array() for (var r = 0; r < R; r++) { grid[c][r] = vector[i]; i = i + 1; } } return grid; } function create_grid_background(mrgn = 0, cfg = {}) { wh = h - 2 * mrgn, ww = w - 2 * mrgn; // working height, width if ("clr" in cfg == false) cfg.clr = bg_black_stroke; noStroke(); fill(cfg.clr); if ("style" in cfg == false) cfg.style = rnd.random_choice([0, 1, 2, 3]); if (cfg.style == 0) { // graph if ("gap" in cfg == false) cfg.gap = ww / rnd.random_choice([20, 30, 50]); for (let i = mrgn; i <= mrgn + ww; i += cfg.gap) { y_start = mrgn; for (let y_start = mrgn; y_start <= mrgn + wh; y_start += pt / 2) { if (rnd.random_dec() < 0.5) ellipse(i, y_start, pt * (1 + 0.5 * rnd.random_dec())); } } for (let i = mrgn; i <= mrgn + wh; i += cfg.gap) { for (let x_start = mrgn; x_start < mrgn + ww; x_start += pt / 2) { if (rnd.random_dec() < 0.5) ellipse(x_start, i, pt * (1 + 0.5 * rnd.random_dec())); } } } else if (cfg.style == 1) { // threads for (let i = 0; i < 1000; i++) { let xstart = mrgn + rnd.random_dec() * ww, ystart = mrgn + rnd.random_dec() * wh, angle = rnd.random_dec() * 2 * Math.PI, len = pt * 10 * (1 + rnd.random_dec()); for (let j = 0; j < 1; j += 0.035) { if (rnd.random_dec() < 0.5) { ellipse(xstart + j * Math.cos(angle) * len, ystart + j * Math.sin(angle) * len, pt * (1 + rnd.r
,2,187,-168,-346,-363,-285,-84,148,-342,-288],[6,1,0,3,-2,1,-3,-0,-2,5,-4,-0,3,1,-3,5,-5,1,2,-1,2,5,-5,-5,1,3,6,0,-0,1,4,-2],[-5,-3,5,-6,1,-6,6,-2,4,-5,6,-4,-0,6,-2,2,-4,-0,-3,2,4,-1,-1,-4,2,-4,-2,-4,1,3,-6,-2],[-6,-1,5,-6,3,2,-5,3,-5,5,-3,-4,-5,4,1,5,7,3,1,2,-5,-4,-5,6,-4,4,-4,2,-0,3,-3,1],[-114,-18,35,7,-29,2,96,222,215,-130,67,95,5,-50,-64,43,191,-3,108,-89,-90,61,7,-45,-79,-169,143,-146,-238,76,87,-83],[-97,-332,223,-31,-187,7,143,-119,-282,92,-9,152,3,193,-212,88,278,1,136,-131,405,-282,-1,224,-385,-27,-35,-153,115,205,98,-308],[180,6,-27,151,-340,-4,-236,198,44,-160,-59,350,-6,-185,305,-19,32,6,113,-44,219,-211,0,275,-122,-166,79,-150,93,226,182,-286],[-229,-101,169,318,-2,-2,-261,59,303,430,67,34,5,158,104,272,-31,2,29,90,294,24,7,-250,365,45,48,-1,123,-187,40,-128],[326,140,190,150,-277,-4,273,-360,-67,-260,134,-166,4,-237,61,-29,53,1,165,-167,-171,-37,5,231,-267,4,-391,-410,-70,190,-248,-6]] Weights[4] = [[-5,-41,-370,-95,45,-22,262,-120,-146,243,-78,-2,136,186,316,-9,4,-7,-277,425,147,387,-186,222,4,-1,-3,52,29,89,-116,1],[2,-4,6,-4,-0,-6,4,-7,-3,-4,5,-5,-6,-1,4,-6,-2,-3,3,-3,-5,-2,4,0,6,4,2,5,6,7,5,-1],[4,-73,234,-230,174,26,-387,-215,226,-308,18,-4,308,-73,-183,7,-13,32,445,-94,-79,-110,335,-655,-1,-4,5,-279,-466,-249,106,-112],[4,-7,86,-83,-43,36,-32,36,-238,221,-15,1,-10,-15,-58,-34,-7,-187,121,-94,89,-92,104,35,2,-6,6,-82,-67,-42,-12,-91],[-1,16,-89,-66,-5,-29,125,-104,-61,106,-34,-1,94,66,48,-12,8,-29,-239,199,105,96,-72,28,6,-3,1,62,-45,-20,-10,0],[3,-4,5,-2,-4,-2,-6,-4,0,3,0,4,-3,-2,-7,-0,-1,-4,0,3,1,-3,1,-4,4,-6,4,-6,6,1,-6,-5],[6,-23,43,-17,80,82,-122,88,-134,63,61,0,-101,3,-49,56,-1,103,161,-92,-28,-168,-27,10,-3,-3,3,-33,19,161,-25,4],[-1,-19,9,84,-13,58,-32,108,-27,113,35,-3,-108,19,-79,34,-0,59,66,-43,-7,76,-36,92,-6,0,-6,19,97,193,-27,1],[-6,5,2,-0,-2,0,-3,0,-3,3,4,-3,3,2,-7,1,0,-6,1,-1,4,-6,-3,-5,-3,-6,5,2,1,-3,0,3],[1,112,383,-175,108,115,128,-430,63,-213,-140,-5,136,13,-218,150,-21,-94,-105,319,363,-75,25,-324,5,1,4,26,-196,-5,131,-468],[2,61,17,49,-89,-38,51,-282,98,2,-110,-0,101,-76,31,-13,-8,-217,-275,42,135,226,36,-122,-4,-0,-3,94,-27,-182,-44,-94],[-4,69,-306,119,-113,36,324,-100,360,-3,-56,-5,358,149,-85,-163,-7,150,-256,215,15,279,182,159,4,5,-3,-1,17,188,202,186],[3,37,1,-39,-25,-31,49,-73,-31,-13,-46,-6,44,-15,-0,12,-6,-72,-160,46,54,58,11,-88,4,-2,-6,48,-52,-141,6,-24],[1,69,-5,234,149,-257,-345,297,263,-181,40,3,-41,142,-290,34,1,299,-15,320,-157,-77,50,2,-6,1,5,97,131,-371,112,-239],[-5,-0,-1,-1,1,4,-5,-6,4,7,4,5,1,1,-2,-0,4,-3,-4,-1,3,-5,-6,-1,0,-6,6,-5,4,-4,-2,6],[2,2,3,6,1,4,2,3,-0,-4,2,2,4,-5,-3,-3,-2,6,2,-6,-5,0,-0,-4,-1,4,-1,0,2,5,6,-6],[-4,-16,-6,-15,-3,4,4,-9,-22,23,-7,-4,-4,6,-5,-17,-4,-24,-8,-2,2,-5,-1,8,6,6,2,-1,-7,-24,-0,-1],[-1,50,-41,-173,81,44,17,81,-45,-125,-17,-6,8,27,0,146,-3,-85,70,2,94,19,-84,-209,-1,4,-2,70,-148,-214,40,-23],[-3,-111,-306,162,-100,-25,55,50,-7,200,55,4,-174,-52,104,-33,7,-59,119,-66,-163,95,-91,354,6,3,-4,-7,212,147,-272,132],[1,41,-29,-112,-87,-16,165,-146,30,-4,-104,4,118,26,93,-37,-13,-169,-283,200,144,183,-13,-69,-2,6,-3,84,-148,-197,-4,-64],[6,-144,102,-52,176,-124,-79,-51,158,-187,87,-4,-330,145,-358,-46,-5,197,251,-115,-53,2,245,-480,5,2,-4,-138,-378,77,138,-458],[2,-81,-446,103,-124,-64,235,149,-100,289,37,-4,-106,1,124,-130,9,10,-40,-77,-284,184,-30,404,-0,3,3,2,179,220,-301,216],[1,2,3,-4,-1,2,-4,-6,-4,3,-0,1,-3,-3,-3,-0,3,0,-2,6,0,0,-3,3,-3,-2,-5,2,1,1,-1,2],[-1,79,59,-99,-74,51,-39,121,-348,45,-9,1,-12,72,149,87,-4,-97,-202,40,0,101,-220,-41,-5,2,4,230,-67,4,39,-48],[-2,112,32,-328,259,-17,-77,-307,-101,-124,-83,6,85,-94,-26,161,-14,-84,-310,252,122,-102,-52,-88,6,-5,-4,108,302,29,5,-12],[3,-28,-556,170,-148,-56,193,-59,-317,161,67,-3,18,116,159,-288,9,-111,314,-48,-13,292,-155,278,1,6,-1,92,381,332,-514,132],[-1,-134,-129,176,-13,-39,-9,25,-175,-10,33,-5,-161,-2,205,-45,3,-38,-223,20,-94,31,-40,132,-7,2,-3,-47,-123,71,-3,58],[4,-87,91,154,-90,-9,-138,147,250,14,70,0,-102,46,-47,-118,9,100,349,-24,-48,-56,55,59,2,-4,5,-67,-25,152,48,13],[-2,-24,8,-92,-21,52,49,5,67,-2,-14,-7,46,107,21,-36,-1,53,141,99,149,116,-23,4,-5,-4,-4,-11,-76,-32,-70,-2],[-5,-130,-337,-51,28,62,-49,66,-171,88,68,-3,-56,138,-71,-80,14,310,87,163,-82,-165,-213,270,-4,2,-4,-107,34,211,-251,156],[5,-9,-279,105,-71,-96,220,176,-237,117,-33,5,75,140,176,-122,-2,-202,-285,169,49,385,-60,153,2,-3,7,97,-21,126,-75,188],[-0,0,7,1,2,-6,2,-1,-6,-0,-2,-1,-4,-3,1,-4,0,-6,-5,4,-3,-4,-2,3,-3,-1,1,3,3,3,0,-2]] Weights[5] = [[-27,-7,-23,22,-59,0,-92,30,-4,-29,82,-129,-12,306,-0,1,-5,-116,78,-30,6,69,2,-213,14,123,-55,129,-5,-122,85,4],[-51,-5,247,263,50,4,-143,-131,-6,355,250,200,86,-190,-0,-3,16,173,-337,214,208,-330,3,171,369,-464,-240,-30,111,-443,34,1],[-2,6,187,-73,-46,-4,73,62,4,-185,-129,-89,-93,10,3,-1,-4,2,34,-101,180,-15,2,-151,-98,1,71,197,131,136,-49,-1],[3,-3,5,6,-5,6,-5,2,3,2,6,3,-6,-3,-3,3,4,-2,-1,-4,4,-2,3,-3,4,6,-4,-3,-4,-2,5,0],[-4,1,6,-5,-5,-6,-6,6,-6,6,1,-2,4,2,-3,5,-2,-2,4,-5,4,-2,-3,-5,-1,-5,2,-5,-2,-4,-6,-2],[45,-1,-17,116,51,-1,-68,-82,-4,187,109,101,65,-94,5,2,12,82,-47,105,-138,-13,-0,120,160,-12,-105,-101,8,-97,81,-6],[160,2,-660,-49,116,-1,-3,47,4,-360,6,243,22,66,-0,-6,18,-209,125,39,-428,129,-2,44,-167,274,90,-100,-73,42,69,-6],[-94,-6,103,105,-19,5,-75,-36,6,143,97,20,22,13,-6,-5,1,49,-134,62,53,-155,-5,27,104,-278,-106,27,-1,-215,-41,5],[-44,0,-256,-151,-17,-1,75,95,-6,-327,-118,-117,-45,146,5,-6,-9,-182,95,-104,43,45,-2,-96,-259,103,152,34,-120,117,-94,2],[82,1,-283,18,67,-4,-14,13,-3,-72,27,111,20,24,6,-1,2,-69,54,25,-230,72,-2,56,-27,148,-1,-36,-14,-2,73,6],[3,-4,-2,5,4,4,-3,-6,2,1,-3,-5,-3,-7,2,-1,2,-1,-1,3,-4,5,-5,-6,7,-5,-5,3,-3,-7,1,4],[5,-0,-7,4,2,1,-4,1,0,0,1,5,2,-5,-6,-0,-4,1,-3,-5,-5,-6,3,-1,-6,2,5,-7,-4,3,-3,7],[-5,-4,-4,-1,-1,7,-3,1,7,-2,3,-7,-3,-6,-6,3,-3,1,-2,-4,1,4,2,0,-1,1,-6,5,2,-1,-5,5],[-13,3,-39,-12,17,6,14,5,2,-11,3,13,5,-98,-1,-4,2,-14,6,10,-3,15,-1,32,-30,40,23,-18,-24,3,22,-4],[99,6,-136,66,75,-2,-29,-43,-3,70,98,166,43,-204,1,-6,6,30,12,97,-223,34,-6,83,120,136,-44,-76,55,-5,103,5],[15,5,-41,82,31,-0,-54,-65,2,158,96,68,58,-54,3,-5,10,55,-45,79,-113,-1,2,108,118,-22,-83,-105,-27,-100,59,-2],[3,-6,4,-0,5,4,-4,0,3,1,3,2,-4,5,4,5,-4,1,2,1,3,-2,-5,3,-3,3,-2,-6,-4,-1,-2,1],[-387,5,247,53,-116,-4,92,58,-3,-48,-98,-272,-14,445,-3,-5,-14,-47,-151,-161,262,-278,2,-86,-201,-168,-78,151,-55,-44,-274,4],[-17,3,123,-7,-16,3,32,16,5,-36,-69,-44,-18,-37,1,4,-5,23,-7,-52,55,-33,-6,-28,-4,28,-6,88,70,64,-53,2],[-331,7,280,105,-131,-4,-32,3,-3,91,48,-138,-28,208,-2,1,-13,9,-220,-50,257,-312,-1,-82,10,-525,-124,173,-48,-313,-263,7],[-379,4,380,58,-116,-3,136,56,-6,-75,-161,-366,-49,349,-1,1,-23,-5,-249,-167,379,-368,-2,-105,-124,-374,-78,172,26,-18,-267,-0],[70,7,-197,-13,-14,-5,84,35,4,-463,-104,164,-64,-159,2,5,15,-63,90,-66,-60,71,2,5,-62,215,93,74,100,104,57,-5],[155,-7,-62,183,110,7,-111,-135,6,278,198,283,115,-278,5,2,17,163,-52,203,-296,20,-1,220,278,87,-179,-146,102,-105,184,-1],[1,1,-36,35,-50,-3,-85,22,3,-12,79,-64,-14,262,-3,-2,-6,-101,61,-22,-3,74,0,-169,27,117,-53,107,0,-110,96,-2],[64,4,-121,98,68,-2,-69,-75,2,178,128,141,89,-107,-1,1,10,45,-27,122,-197,21,2,142,137,50,-86,-137,-24,-99,93,4],[38,3,78,42,44,4,-39,-50,-1,127,77,62,49,-67,-5,4,5,53,-27,77,-25,-22,-1,24,44,-38,-48,-69,34,-52,18,1],[-39,3,-10,-20,-22,4,9,3,6,-9,-44,-50,-5,154,5,2,-1,-6,-16,-43,8,-50,-2,-19,-0,-23,1,8,-14,10,-68,5],[72,1,242,163,83,-4,-96,-156,6,233,152,137,89,-228,-1,-1,10,147,-286,180,93,-272,-6,141,363,-366,-176,-120,123,-259,29,3],[-6,-2,-4,-1,0,4,3,3,-5,-2,4,-1,-5,-6,-6,3,-5,-5,-5,-4,-3,-4,-2,1,1,-3,2,-2,3,-6,-4,3],[-4,-7,-6,6,2,2,-5,-6,4,2,-1,1,-2,-5,4,4,-2,-2,-0,-5,-6,-2,6,-6,6,-6,-5,6,0,-6,-0,5],[49,1,-92,-27,-9,-2,102,65,6,-383,-138,-21,-62,-65,-0,-1,0,-13,78,-90,38,32,1,-41,-77,163,73,96,113,140,19,2],[-351,-1,330,-84,-135,6,171,83,6,-232,-212,-530,-84,238,1,-4,-24,-65,-169,-226,381,-286,4,-207,-151,-341,40,113,-35,93,-398,0]] Weights[6] = [[239,-372,224,2,-5,-326,-384,51,322,-242,0,8,-9,12,-474,-228,7,905,-45,637,921,-349,-768,153,-384,-235,162,-354,-1,-3,-128,967],[-367,375,304,-7,-7,-30,-746,195,-306,-350,-8,7,-2,-124,-92,-75,-5,138,123,471,551,-66,-34,-319,-173,30,-115,274,-5,-7,110,545],[258,1054,-355,0,-4,322,-507,456,-504,-92,2,9,8,46,34,289,-8,101,-195,520,76,-538,408,252,292,128,31,835,-3,-6,-509,-318]] Bias[0] = [-77,-55,-0,57,117,242,42,70,-185,260,231,97,29,111,113,-232,-73,39,89,82,135,51,-4,-169,-146,60,-31,61,153,-215,258,188] Bias[1] = [-42,-83,-127,-11,130,-344,-4,106,-136,181,-241,220,-6,-289,-194,455,94,-318,188,-95,218,-118,-48,-15,-56,-115,17,133,171,126,-30,22] Bias[2] = [-159,28,-57,240,407,-41,403,323,-65,282,40,100,-32,16,-325,-112,244,-31,-8,-211,377,-178,-32,55,-111,-230,-148,257,410,-201,95,-193] Bias[3] = [-39,46,-298,204,130,37,-77,287,152,188,-86,-57,-2,39,87,100,-11,113,-15,75,-31,66,143,-15,-103,-20,-27,52,95,-99,-184,181] Bias[4] = [-32,-4,145,82,58,-1,65,-52,-72,88,121,-346,99,-207,-29,-75,8,66,4,171,111,-3,-7,103,-16,4,93,-1,23,42,31,-1] Bias[5] = [-1,56,53,-55,-51,72,105,74,108,31,-4,0,-9,12,-8,77,-71,128,-27,211,160,45,8,-6,84,-15,15,11,-0,-14,40,213] Bias[6] = [428,390,299] min_noise = [-500,-272,-255] max_noise = [500,339,236] white = [244, 244, 246]; black = [19, 19, 19]; bg_black_stroke = [19, 19, 19, 20]; bg_white_stroke = [255-bg_black_stroke[0], 255-bg_black_stroke[1], 255-bg_black_stroke[2], 20]; bg_red_stroke = [349, 100, 35]; min_luminance = 0.5; precision = 1000; // model file has been written to three decimal places, and without the "0." to save space. So need to divide by precision to get the right weights, biases, min_noise, max_noise /*************************************************************************/ /************************************************************************* * Features *************************************************************************/ Nx = Ny = Math.sqrt(masks[0].length); num_prototypes = masks.length; // number of shapes the generative model samples from CLR_FROM_MODEL = "AI", CLR_UNIFORM = "random"; // do colors come from the model or uniform? SAMPLE_COLOR_OPS = [CLR_FROM_MODEL, CLR_UNIFORM]; _C = calculateFeatures(tokenData); use_colors = palettes[pale
118,249,-153,-472,193,406,40,-55,206,162,460,98,394,-265,-145,39,339],[-73,-26,184,166,-10,104,60,199,8,119,82,80,-58,112,-105,210,38,15,79,-85,79,-23,153,13,49,-12,-114,-106,-68,35,-127,95],[-23,-23,-168,239,107,11,79,-277,-7,-141,-86,31,152,-290,-147,22,-474,-102,201,-298,-63,-380,-51,-10,-257,-63,-178,402,115,55,-69,191],[-268,-315,-156,183,135,90,158,-126,-101,-126,-152,-19,318,-234,210,-129,-85,-283,-177,-464,155,165,292,-19,97,-554,-4,67,236,-212,216,91],[-3,37,99,-85,5,46,-11,-170,-311,22,-74,-33,152,32,-17,-129,41,111,-75,154,187,41,64,69,1,-18,203,46,-205,0,-253,-142],[65,251,-38,-219,14,205,190,524,-74,116,-146,-155,54,-471,39,241,-418,-86,229,311,-220,-432,55,-88,-359,-61,-236,-24,-150,119,178,-355],[295,252,-335,-6,11,-132,-294,214,252,159,-158,22,-517,-49,299,356,156,45,415,-282,444,1,205,-99,112,444,-72,255,40,-23,151,-3],[191,-49,-59,88,16,14,16,23,-76,-33,-474,-362,48,113,98,-99,93,-188,460,76,194,-227,440,-16,-1,243,-179,-16,-71,-2,-245,31],[3,3,-2,-4,4,-1,-0,-0,-5,-5,-4,5,6,-6,5,1,5,-5,-7,-6,-5,5,0,4,-7,2,-4,-1,-1,-1,-5,-2],[-220,-93,49,-28,-85,282,190,80,-80,246,8,-330,125,275,-60,131,-187,57,-16,-116,-55,446,-142,-84,134,373,466,-96,-125,-169,-223,-442],[328,-120,277,-207,-120,-159,-52,21,4,-169,480,-111,297,125,14,-323,99,-169,142,-164,291,-232,92,2,-292,110,-28,-627,125,182,10,112],[-452,-125,118,-42,-491,315,66,-102,-242,-98,-255,-27,-155,-86,-238,-274,-447,-239,-522,150,-188,-100,-148,-98,-200,-173,-214,-108,28,-324,-108,-117],[272,66,-116,-118,-83,-73,204,-291,-279,-437,-35,29,-198,23,-265,-15,147,151,351,217,-198,42,-84,124,-43,127,-47,244,-75,-92,43,-62],[-273,382,51,-133,-160,250,52,160,-386,386,-34,-72,-40,-169,157,234,-29,84,-98,208,182,-175,-104,-335,-333,235,-144,53,-230,-98,135,-137],[34,-124,-251,306,487,-115,-71,-211,-312,-188,-70,-51,69,-83,6,21,-94,-18,-20,-186,479,95,353,-82,-52,420,-384,-515,-199,6,-245,-4],[-20,-51,-1,-42,270,132,-24,33,-5,66,357,121,-106,-290,145,-56,21,-332,138,-88,-103,-294,8,39,-65,140,-59,281,36,388,4,213],[156,-220,-369,-282,236,-22,57,175,55,-150,-104,71,-6,-64,222,-83,255,171,-58,160,-128,482,-297,-19,-127,-135,167,625,-3,79,-162,-123],[70,13,-248,57,98,-120,140,-7,115,-272,-222,-41,-373,25,196,-4,-29,168,171,235,75,-269,-394,45,-107,-222,-105,105,-23,-6,127,-51],[-209,244,32,-18,13,-80,60,-357,192,-254,-194,-16,264,472,484,16,190,-38,154,122,-382,31,-141,-28,390,-10,117,-147,95,-98,351,-69],[-2,-5,-4,2,5,-4,-5,8,6,-5,5,-3,-3,-1,-2,-5,-2,-0,-5,-6,1,7,-5,2,-3,1,-4,4,-1,1,-0,-8],[-219,-610,139,-29,102,271,-53,277,11,193,-295,-42,-67,346,191,-126,-51,235,9,264,24,271,-261,173,12,-63,-75,-78,127,158,-30,198],[-32,0,188,128,175,9,124,99,-162,-141,517,76,360,-31,258,67,-5,263,197,7,250,157,-3,-80,128,5,129,-69,-73,286,-191,-116],[-171,268,396,14,558,-147,-480,-592,157,119,85,193,-357,284,-94,51,82,102,-107,-310,-91,395,310,-333,244,247,196,-258,58,118,57,-40],[-213,635,9,283,408,348,69,-232,197,86,22,144,101,-289,-54,70,-69,135,-385,258,-95,98,-189,-55,-116,-0,-168,-76,-259,-48,97,-147],[-47,269,201,-99,-302,89,-5,-184,-113,169,24,76,-262,140,-192,-79,46,-324,217,-84,-203,436,-292,-123,-78,126,241,204,201,-337,-120,-162],[-63,16,-169,-47,-282,-300,-62,247,-211,-135,-350,-352,146,-155,40,-138,182,-143,-50,-19,28,53,-14,-182,254,380,113,250,126,164,477,-87],[-83,154,-51,355,-210,-26,-336,-201,-73,-45,274,227,-412,50,240,107,185,-173,202,-83,-40,-204,302,-76,-5,-279,-325,-167,139,-398,202,192],[-193,-137,28,49,41,-203,-128,641,69,92,64,281,-82,246,42,95,70,122,203,-210,114,386,-275,-102,-26,191,-447,400,97,-172,-249,123]] Weights[2] = [[-68,-377,-74,-5,-23,164,179,7,-121,109,-162,103,6,-16,-90,-76,-100,262,237,224,279,-166,45,-2,-33,62,267,509,228,175,-440,236],[62,25,199,-2,226,-48,-282,241,-32,-52,246,-55,-3,192,-305,-32,-45,-135,236,4,-480,-43,-159,-1,62,476,327,-84,-69,-308,-47,203],[-172,145,59,6,78,110,216,-204,-81,63,-33,205,-2,95,159,365,-371,177,-12,-355,21,-320,47,0,274,143,419,-75,370,-153,-238,72],[23,-43,-32,4,114,110,225,-251,-65,-110,-204,262,5,39,456,52,-151,107,367,51,-210,-83,-109,-1,-28,195,-353,-457,24,247,-281,266],[661,39,-167,-4,-271,-80,-73,387,200,205,308,199,1,-98,20,-251,-266,-241,-182,253,-331,143,-483,5,-201,81,306,-416,-385,316,-143,-331],[-6,5,-0,6,0,-5,-1,6,4,-2,-2,2,1,-4,2,5,5,-2,-4,-2,-4,4,-0,4,3,-1,-2,-5,-4,-6,1,1],[53,-121,-73,0,-292,-3,139,295,-83,40,-248,-22,-4,-1,78,305,-74,93,-145,-24,-159,-76,-112,-4,179,-232,-292,-178,-205,-228,-36,-210],[11,-170,-300,6,269,-50,-192,33,-2,-143,-262,-121,1,35,-269,0,42,-39,141,-97,90,105,-106,2,-85,-108,-96,199,-194,50,-251,-44],[111,13,-358,6,273,-42,-96,-68,153,-182,263,435,-2,170,-283,-38,-56,-318,289,29,295,177,-46,6,188,-24,-502,23,-225,115,13,-18],[214,126,151,-5,230,-48,-229,-219,-180,-54,319,-408,-3,6,-216,-448,-89,-297,-93,-134,-49,179,-12,5,-230,-245,-103,17,71,-301,405,-165],[-58,-32,239,4,268,117,268,-66,-75,18,-180,-82,-5,-89,87,301,-255,72,141,287,-303,-182,132,2,-45,262,9,-155,167,86,157,212],[64,-19,-21,1,-31,-32,-262,-345,9,223,-1,-37,-0,61,-131,-216,320,-77,139,64,21,0,49,-0,98,21,78,260,-314,-206,8,220],[5,-7,2,-6,-1,2,5,3,-3,-1,5,-4,-0,-3,-4,5,4,-5,0,-2,-6,2,4,2,0,-3,-4,-3,0,-0,4,-5],[-274,-448,277,5,198,-68,293,-35,240,-539,86,-247,4,314,218,-513,-8,166,-286,-118,447,168,139,-6,-401,-30,397,-85,13,-427,208,268],[-107,-67,122,-4,546,185,49,284,-91,311,26,114,3,203,181,-309,398,21,297,-7,339,-194,379,-5,-138,131,-13,90,279,-62,-214,-8],[429,468,-136,-1,134,-156,-241,296,77,-381,-54,-3,-5,-161,-327,191,-19,-144,154,-149,423,94,-243,7,254,-121,80,-50,300,-211,-264,114],[-73,-382,-24,6,-210,102,-21,-79,-111,-205,-194,35,7,198,-220,229,-208,103,-124,27,146,-336,-54,4,303,-167,302,-189,-237,3,68,-61],[-0,-4,5,-1,0,-7,3,-1,-4,-1,4,-4,-5,4,7,2,4,-6,-5,1,-4,-2,-3,0,5,-5,4,-6,2,2,-6,-4],[-59,-15,289,-5,19,-29,132,-162,-44,-75,-135,45,5,-1,52,28,41,49,-180,-83,22,-26,-5,5,194,23,-251,-95,-470,75,361,-112],[-166,-102,181,6,-129,-12,75,-389,38,-41,-11,114,-5,135,-81,240,216,-130,-412,-82,81,172,251,2,281,-154,116,125,142,-164,234,-56],[-30,-23,-159,-3,-180,-74,-271,-376,-27,-279,-81,-184,1,77,188,-72,102,-136,-3,104,234,-165,-2,2,157,-101,61,-479,-22,14,-165,116],[138,-9,15,4,-45,-51,92,107,-20,55,-135,298,-7,123,189,7,-199,-71,303,-149,151,118,165,-7,18,-102,204,146,88,73,-121,-725],[-5,-6,3,5,-2,-5,4,6,6,-4,3,-5,1,-5,-5,-2,-1,-6,-4,1,6,-5,3,-6,-3,1,-3,-3,-4,-5,-2,-1],[102,-174,31,-2,-422,-1,-96,284,-97,-73,-183,-259,4,87,84,-22,54,-1,-17,-244,214,237,75,4,4,3,-346,95,71,-287,111,-146],[116,-73,-358,-3,272,14,-26,-226,69,265,79,-51,4,568,130,307,-177,-173,-55,-222,56,13,-80,-6,279,145,-412,-167,79,-289,-55,40],[-71,71,268,5,-182,-2,-54,185,3,197,39,239,-2,-17,22,143,-54,6,-21,183,86,7,20,0,-310,-260,10,113,253,103,115,-135],[275,327,-257,4,540,-112,-4,114,110,10,58,64,-2,-221,-230,0,-12,-155,-129,-287,183,-100,-79,3,348,-39,-122,-239,-83,108,-283,445],[-52,-153,-492,2,-185,304,80,-272,97,-223,-84,64,5,-616,-219,145,102,-369,-359,-81,-396,273,43,4,-2,-346,72,-84,335,139,223,172],[-1,115,-194,4,-185,12,34,-5,155,30,103,-165,2,-43,-29,6,311,-72,-390,-23,-29,16,-107,-3,-56,-94,-154,299,4,270,-263,-588],[149,172,19,4,2,2,173,15,-148,-31,99,-90,-6,347,-1,171,120,162,-84,72,337,96,56,4,147,-87,-60,-186,-96,227,-245,-48],[46,-245,-31,7,324,-135,-382,97,91,-211,101,-364,4,-157,-199,-152,-122,-240,-149,-176,-226,88,-233,6,-56,103,215,368,148,-109,-138,176],[-9,-63,-316,-2,274,-154,63,-56,120,-262,64,98,-3,-169,103,62,87,69,73,-267,-164,15,-555,1,16,84,256,325,410,90,227,107]] Weights[3] = [[-1,-6,3,2,1,-6,1,-7,-5,2,5,-6,0,5,-3,3,-4,1,-6,-4,-5,3,-4,-1,-3,5,-7,-5,-2,-1,5,-4],[-50,9,39,-36,2,0,146,13,53,-17,-2,92,-2,39,-114,21,172,-1,8,-40,93,128,3,-77,100,-61,88,-52,-122,-47,43,-19],[11,545,-2,-245,-15,1,-354,199,-22,398,56,450,-0,684,332,82,-243,6,-25,244,259,-25,5,131,172,55,-152,-169,71,-224,-212,-19],[-55,9,37,109,-285,-6,-149,41,46,95,49,62,5,85,254,-98,31,3,33,-107,-132,-174,6,-142,10,33,-22,-8,-407,130,313,-40],[-36,-102,47,-15,-76,4,60,109,72,-40,-201,16,-5,-54,-191,20,112,0,-148,18,132,98,-4,-131,160,47,52,277,250,-135,-55,78],[-45,106,-101,-57,119,-7,135,31,-23,8,21,79,0,9,22,-126,-15,-1,17,49,54,75,6,24,65,-5,-14,-113,136,-13,-32,-48],[-145,20,8,-23,387,-0,68,-420,-115,170,-78,-202,1,148,213,-161,36,-4,65,-97,174,-19,5,171,72,-94,-181,252,-175,-8,-414,10],[-176,19,161,268,-29,-1,100,-67,-277,80,-150,-66,-6,-224,-274,-265,-8,-3,-3,165,7,-370,-2,84,-157,44,-276,-37,-178,102,138,-33],[-133,-16,-510,408,-383,3,-76,-150,143,141,382,-113,0,76,-159,230,23,-4,-86,27,403,-150,1,-48,-72,132,117,241,-247,-25,67,-4],[141,-124,56,-119,61,1,-62,7,-381,436,268,-156,1,-44,-195,-85,-49,6,148,-77,-249,-228,4,167,-361,-57,-316,-248,22,167,100,-243],[44,39,22,-35,17,-1,-49,-30,-4,-2,60,-11,-3,69,78,138,-20,-2,-7,-36,37,10,-4,-4,-1,27,179,-44,-99,69,23,-46],[-2,4,0,-5,-6,6,1,-5,2,-1,-2,5,-6,-3,2,2,-2,2,-2,2,2,-1,-0,1,-1,-1,-3,-4,1,-2,3,-3],[95,233,92,-28,-129,6,147,-264,-195,-202,171,47,3,114,145,-96,84,1,124,76,299,146,1,-52,228,-3,159,-19,38,-75,-154,123],[-8,146,172,106,234,-4,-70,50,-76,-53,56,-178,1,94,-17,34,0,6,4,-126,-20,-76,-5,29,-16,-46,46,42,-100,32,40,36],[92,-435,203,326,-241,2,108,-43,-138,135,115,99,-2,-466,47,-263,-158,-6,116,-25,358,-330,-0,150,-145,-163,57,-165,-74,93,-169,-321],[-184,-3,-104,-50,-13,4,180,120,90,-22,-71,186,-7,-76,-178,-18,120,-4,-66,108,41,135,-5,-169,121,29,-28,146,143,-88,-58,-69],[6,8,10,-2,-9,5,-8,-6,-3,0,12,-8,-2,8,11,17,-6,3,4,0,8,0,-0,-1,1,1,13,-10,-9,13,-0,-3],[-122,173,-39,315,179,6,197,-72,48,-130,-135,-114,4,95,-227,294,125,6,-64,11,80,-242,2,70,11,-12,97,37,-186,85,-90,44],[-204,352,173,8,112,5,-228,-464,103,10,419,-52,-3,321,378,-223,-390,-3,-311,307,-154,274,4,-14,-56,107,-132,338,164,49,207,248],[-293,80,193,234,133,-2,198,-24,4,-103,172,-328,3,19,28,-66,136,-7,119,-207,91,44,3,-98,180,-101,354,235,-242,0,-188,-132],[-81,195,21,-206,247,4,-26,-90,-6,110,-9,-14,2,55,316,94,-56,-6,-11,-91,16,162,-2,-7,63,-81,-89,315,-19,60,240,-19],[61,319,63,156,-285,3,-263,40,-101,-106,236,117,-6,107,385,-204,-39,-4,196,-464,162,225,-4,155,-205,-395,-337,109,-293,41,-120,210],[210,-19,46,-333,-166,-4,-93,-21,-97,318,-151,-178,6,291,111,12,-143,3,-65,14,134,163,3,-95,149,81,-20,124,65,-157,80,256],[326,-156,233,359,-665,-3,-176,-213,-205,-128,348,6,6,-310,438,-432,392,-3,347,-273,216,-139
19,0.22,0.07,0.08,0.1,0.11,0.13,0.15,0.17,0.17,0.18,0.22,0.08,0.09,0.11,0.12,0.12,0.15,0.18,0.19,0.19,0.23,0.08,0.09,0.11,0.13,0.14,0.17,0.2,0.22,0.24,0.27,0.08,0.09,0.11,0.13,0.15,0.19,0.25,0.28,0.32,0.33,0.08,0.09,0.11,0.14,0.17,0.23,0.3,0.37,0.42,0.41,0.08,0.1,0.12,0.15,0.21,0.29,0.4,0.48,0.52,0.49,0.1,0.11,0.13,0.19,0.27,0.38,0.49,0.59,0.61,0.55,0.1,0.12,0.16,0.23,0.33,0.43,0.55,0.65,0.64,0.57,0.13,0.14,0.19,0.25,0.34,0.43,0.53,0.6,0.6,0.56],[0.06,0.06,0.06,0.07,0.08,0.09,0.08,0.07,0.07,0.07,0.06,0.07,0.07,0.08,0.09,0.09,0.09,0.08,0.07,0.07,0.06,0.07,0.08,0.08,0.09,0.11,0.1,0.09,0.07,0.07,0.06,0.07,0.08,0.09,0.1,0.12,0.12,0.1,0.08,0.08,0.06,0.07,0.08,0.1,0.11,0.13,0.12,0.1,0.08,0.08,0.06,0.07,0.08,0.09,0.11,0.13,0.12,0.1,0.08,0.08,0.06,0.07,0.07,0.09,0.1,0.12,0.12,0.1,0.08,0.08,0.06,0.07,0.07,0.08,0.1,0.11,0.11,0.09,0.08,0.08,0.06,0.06,0.06,0.07,0.09,0.1,0.09,0.08,0.08,0.08,0.06,0.06,0.06,0.06,0.08,0.09,0.09,0.08,0.08,0.08],[0.41,0.37,0.33,0.3,0.28,0.26,0.23,0.19,0.16,0.16,0.39,0.29,0.25,0.23,0.22,0.22,0.2,0.17,0.14,0.14,0.4,0.27,0.22,0.2,0.18,0.17,0.16,0.14,0.13,0.13,0.46,0.34,0.24,0.2,0.17,0.16,0.14,0.14,0.13,0.13,0.55,0.47,0.35,0.25,0.2,0.17,0.16,0.15,0.14,0.14,0.65,0.62,0.52,0.38,0.27,0.2,0.17,0.17,0.15,0.14,0.73,0.75,0.66,0.54,0.39,0.27,0.2,0.19,0.17,0.16,0.78,0.82,0.79,0.69,0.55,0.4,0.28,0.23,0.19,0.18,0.79,0.85,0.85,0.79,0.66,0.5,0.39,0.28,0.21,0.19,0.76,0.82,0.82,0.77,0.66,0.54,0.43,0.32,0.25,0.2],[0.43,0.4,0.37,0.35,0.35,0.37,0.41,0.45,0.5,0.55,0.41,0.35,0.3,0.27,0.26,0.27,0.33,0.41,0.49,0.55,0.41,0.32,0.25,0.2,0.18,0.19,0.26,0.37,0.48,0.57,0.41,0.31,0.21,0.15,0.13,0.14,0.2,0.32,0.46,0.57,0.42,0.31,0.2,0.14,0.12,0.12,0.17,0.29,0.44,0.58,0.45,0.34,0.22,0.16,0.13,0.13,0.18,0.31,0.48,0.61,0.48,0.39,0.28,0.2,0.17,0.19,0.25,0.39,0.56,0.65,0.53,0.46,0.38,0.31,0.28,0.3,0.37,0.48,0.62,0.68,0.56,0.54,0.5,0.45,0.44,0.46,0.5,0.57,0.66,0.69,0.57,0.58,0.58,0.55,0.54,0.56,0.57,0.62,0.66,0.67],[0.04,0.03,0.03,0.04,0.04,0.04,0.05,0.05,0.05,0.06,0.04,0.05,0.06,0.05,0.06,0.08,0.07,0.07,0.06,0.05,0.05,0.08,0.11,0.16,0.19,0.19,0.16,0.11,0.07,0.05,0.06,0.12,0.22,0.35,0.43,0.42,0.34,0.2,0.12,0.07,0.07,0.17,0.32,0.49,0.58,0.57,0.47,0.3,0.17,0.09,0.06,0.15,0.32,0.5,0.6,0.6,0.49,0.31,0.17,0.09,0.05,0.11,0.22,0.37,0.48,0.48,0.38,0.23,0.13,0.08,0.05,0.07,0.11,0.18,0.24,0.25,0.21,0.15,0.09,0.06,0.04,0.05,0.05,0.07,0.09,0.1,0.09,0.08,0.07,0.06,0.04,0.04,0.03,0.04,0.04,0.05,0.05,0.05,0.05,0.05],[0.9,0.88,0.74,0.41,0.15,0.07,0.05,0.04,0.04,0.04,0.93,0.91,0.76,0.41,0.13,0.06,0.05,0.04,0.03,0.04,0.94,0.94,0.8,0.41,0.12,0.06,0.05,0.04,0.03,0.04,0.95,0.95,0.81,0.41,0.12,0.06,0.05,0.04,0.03,0.03,0.95,0.95,0.82,0.43,0.13,0.07,0.05,0.04,0.03,0.03,0.95,0.95,0.81,0.42,0.12,0.06,0.05,0.04,0.03,0.03,0.94,0.94,0.8,0.4,0.11,0.06,0.05,0.04,0.03,0.03,0.94,0.94,0.78,0.38,0.1,0.05,0.05,0.04,0.03,0.03,0.92,0.91,0.75,0.37,0.11,0.06,0.04,0.04,0.03,0.04,0.89,0.87,0.71,0.38,0.13,0.07,0.05,0.04,0.03,0.04],[0.92,0.94,0.92,0.86,0.64,0.33,0.16,0.08,0.04,0.04,0.93,0.95,0.93,0.89,0.66,0.33,0.15,0.07,0.04,0.04,0.94,0.94,0.93,0.9,0.67,0.34,0.15,0.07,0.04,0.04,0.94,0.95,0.93,0.9,0.69,0.34,0.15,0.07,0.04,0.03,0.94,0.96,0.93,0.89,0.7,0.35,0.14,0.07,0.04,0.03,0.94,0.96,0.94,0.9,0.7,0.34,0.13,0.06,0.04,0.03,0.94,0.97,0.96,0.93,0.71,0.34,0.15,0.07,0.04,0.04,0.93,0.95,0.95,0.92,0.7,0.34,0.15,0.07,0.04,0.03,0.93,0.95,0.94,0.89,0.67,0.33,0.13,0.06,0.04,0.03,0.91,0.93,0.91,0.85,0.63,0.32,0.14,0.07,0.04,0.04],[0.12,0.14,0.18,0.26,0.37,0.51,0.65,0.73,0.77,0.78,0.1,0.12,0.16,0.24,0.36,0.52,0.68,0.76,0.81,0.81,0.09,0.11,0.16,0.23,0.35,0.53,0.7,0.8,0.84,0.84,0.07,0.09,0.14,0.21,0.32,0.52,0.72,0.82,0.86,0.85,0.05,0.07,0.11,0.17,0.29,0.5,0.7,0.81,0.85,0.85,0.05,0.06,0.1,0.16,0.29,0.5,0.71,0.81,0.85,0.85,0.06,0.07,0.12,0.2,0.33,0.52,0.72,0.81,0.85,0.84,0.08,0.1,0.15,0.23,0.35,0.54,0.7,0.79,0.83,0.83,0.1,0.11,0.16,0.24,0.35,0.52,0.68,0.75,0.8,0.8,0.12,0.13,0.18,0.26,0.37,0.51,0.65,0.72,0.75,0.77],[0.05,0.05,0.07,0.11,0.21,0.39,0.49,0.39,0.22,0.14,0.05,0.05,0.07,0.11,0.21,0.45,0.58,0.46,0.24,0.13,0.04,0.04,0.06,0.11,0.22,0.48,0.65,0.51,0.25,0.13,0.04,0.04,0.06,0.1,0.23,0.51,0.69,0.55,0.27,0.13,0.04,0.04,0.05,0.1,0.23,0.52,0.71,0.56,0.28,0.13,0.04,0.04,0.05,0.1,0.23,0.51,0.71,0.57,0.28,0.12,0.04,0.04,0.06,0.1,0.22,0.5,0.69,0.56,0.27,0.12,0.04,0.05,0.06,0.11,0.21,0.47,0.64,0.51,0.24,0.12,0.05,0.05,0.06,0.1,0.2,0.43,0.57,0.44,0.23,0.13,0.05,0.05,0.06,0.1,0.18,0.38,0.48,0.39,0.22,0.14]] all_colors = [[3,62,140],[4,135,217],[4,191,173],[26,26,26],[46,89,3],[73,101,131],[104,91,73],[106,131,132],[112,151,192],[140,78,3],[150,134,117],[158,190,207],[216,206,196],[242,94,61],[242,147,92],[242,227,12],[242,242,242]] pfgc = [[[0.08,0.67,0.08,0.18],[0.03,0.74,0.03,0.2],[0.03,0.95,0,0.03],[0,1,0,0]],[[0.11,0.37,0.15,0.37],[0.11,0.45,0.13,0.31],[0.08,0.42,0.16,0.34],[0.13,0.37,0.19,0.31]],[[0.12,0.21,0.22,0.44],[0.16,0.26,0.26,0.32],[0,0.3,0.4,0.3],[0.25,0.25,0.25,0.25]],[[0.46,0.07,0.37,0.1],[0.43,0.12,0.32,0.13],[0.43,0.08,0.43,0.07],[0.42,0.06,0.46,0.05]],[[0.35,0.16,0.28,0.2],[0.26,0.18,0.34,0.22],[0.31,0.19,0.34,0.17],[0.28,0.19,0.36,0.17]],[[0.15,0.3,0.1,0.45],[0.11,0.34,0.19,0.36],[0.11,0.34,0.17,0.37],[0.14,0.34,0.2,0.32]],[[0.61,0,0.36,0.03],[0.4,0.06,0.46,0.08],[0.43,0.05,0.5,0.02],[0.56,0.05,0.39,0.01]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.08,0.24,0.03,0.65],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.33,0.33,0.33,0],[0.67,0,0,0.33],[0.25,0.25,0,0.5],[1,0,0,0]],[[0,0.3,0.3,0.4],[0.13,0.25,0.2,0.42],[0.16,0.29,0.23,0.31],[0.18,0.28,0.23,0.32]],[[0.7,0.08,0.15,0.07],[0.52,0.12,0.23,0.12],[0.55,0.09,0.31,0.05],[0.75,0.08,0.15,0.01]],[[0.03,0.66,0.03,0.29],[0,0.74,0,0.26],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.22,0.2,0.25,0.34],[0.2,0.19,0.21,0.41],[0.08,0.17,0.33,0.42],[0.25,0.25,0.25,0.25]],[[0.08,0.42,0.09,0.4],[0.09,0.47,0.1,0.33],[0.07,0.36,0.25,0.32],[0.2,0.3,0.1,0.4]],[[0.25,0.25,0.25,0.25],[0.5,0,0.5,0],[0.25,0.25,0,0.5],[0,1,0,0]],[[0.33,0,0.33,0.33],[0.11,0.44,0.22,0.22],[0.09,0.18,0.18,0.55],[0.25,0.25,0.25,0.25]],[[0.25,0.25,0.25,0.25],[0.22,0.22,0,0.57],[0.16,0.23,0.14,0.47],[0.18,0.26,0.21,0.35]],[[0.19,0.18,0.23,0.4],[0.21,0.23,0.28,0.28],[0.33,0.13,0.37,0.17],[0.33,0,0.67,0]],[[0.08,0.5,0.1,0.33],[0.06,0.58,0.11,0.24],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.5,0,0,0.5],[0.03,0.46,0.03,0.48],[0.05,0.64,0.05,0.26],[0.07,0.68,0.07,0.18]],[[0.6,0.02,0.36,0.03],[0.52,0.02,0.44,0.03],[0.82,0,0.15,0.03],[0.25,0.25,0.25,0.25]],[[0.55,0.01,0.41,0.04],[0.29,0,0.64,0.07],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.06,0.53,0.14,0.28],[0.03,0.64,0.08,0.25],[0,0.89,0,0.11],[0,1,0,0]],[[0.08,0.33,0.21,0.38],[0.08,0.42,0.16,0.34],[0.09,0.46,0.13,0.32],[0.07,0.57,0.13,0.23]],[[0,0.11,0,0.89],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[1,0,0,0],[1,0,0,0],[1,0,0,0],[0.25,0.25,0.25,0.25]],[[0.25,0.25,0.25,0.25],[1,0,0,0],[0,0.75,0,0.25],[0,0,1,0]],[[0.22,0.11,0.33,0.33],[0.11,0.2,0.22,0.47],[0.11,0.28,0.24,0.37],[0.11,0.29,0.28,0.33]],[[0.74,0.02,0.13,0.11],[0.53,0.06,0.34,0.06],[0.47,0.05,0.42,0.05],[0.49,0.03,0.45,0.02]],[[0.46,0.05,0.45,0.03],[0.5,0.05,0.4,0.04],[0.79,0,0.2,0.01],[1,0,0,0]],[[0.09,0.31,0.03,0.57],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.3,0.11,0.54,0.05],[0.33,0.12,0.42,0.13],[0.46,0.12,0.31,0.12],[0.6,0.08,0.21,0.1]],[[0.25,0.25,0.25,0.25],[0.06,0.2,0.19,0.56],[0.07,0.3,0.23,0.41],[0.1,0.26,0.28,0.36]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[1,0,0,0],[0.25,0.25,0.25,0.25]],[[0.03,0.75,0.01,0.21],[0,0.75,0.17,0.08],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.23,0.17,0.29,0.31],[0.21,0.2,0.22,0.36],[0.21,0.36,0.36,0.07],[0.25,0.25,0.25,0.25]],[[0.13,0.4,0.17,0.29],[0.11,0.45,0.2,0.24],[0.17,0.41,0.14,0.29],[0.2,0.45,0.15,0.2]],[[0.28,0.13,0.35,0.24],[0.26,0.16,0.26,0.32],[0.32,0.14,0.28,0.27],[0.36,0.15,0.28,0.21]],[[0.27,0.19,0.31,0.23],[0.22,0.22,0.27,0.29],[0.29,0.17,0.28,0.26],[0.33,0.16,0.26,0.25]],[[0.25,0.25,0.25,0.25],[0.25,0.11,0.05,0.6],[0.18,0.16,0.2,0.46],[0.22,0.22,0.26,0.3]],[[0.4,0,0.2,0.4],[1,0,0,0],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.07,0.56,0.1,0.26],[0.08,0.65,0.06,0.21],[0,0.75,0,0.25],[0.25,0.25,0.25,0.25]],[[0,0,0,1],[0.02,0.33,0.1,0.55],[0.05,0.53,0.11,0.31],[0.11,0.6,0.12,0.18]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.34,0.04,0.52,0.1],[0.53,0.03,0.32,0.13],[0.25,0.25,0.25,0.25],[0.25,0.25,0.25,0.25]],[[0.54,0.07,0.24,0.16],[0.49,0.1,0.26,0.14],[0.48,0.12,0.29,0.11],[0.67,0.07,0.22,0.05]]] // xy2rgb_mixed_model_small.js Weights = new Array Bias = new Array Weights[0] = [[-353,-415,-485,130,736],[-101,27,102,777,1120],[-645,-187,-317,-122,-779],[48,297,-529,-696,-34],[-105,346,306,-539,1020],[-145,690,49,169,243],[-400,32,672,414,-371],[307,123,-879,751,-635],[88,582,416,335,485],[314,515,-126,468,-68],[273,-80,-773,-643,-586],[467,62,-253,-295,-681],[86,160,-688,-828,832],[-568,-16,365,-577,-991],[406,-438,104,-699,-74],[-265,391,-607,242,-187],[-554,-13,377,-842,-138],[-839,5,424,169,259],[78,623,541,-260,-935],[-295,-60,132,487,1129],[-396,132,-490,-259,910],[30,-78,275,1223,-655],[-485,-4,-590,-843,71],[-16,252,162,493,-417],[564,-14,95,733,-263],[74,-201,-597,1124,173],[-13,520,592,719,-70],[5,144,1083,-926,413],[172,62,319,-442,-413],[786,12,-254,-571,-393],[413,-136,419,-263,499],[-12,376,-226,-707,7]] Weights[1] = [[-145,-398,39,70,124,-108,265,-8,35,-53,-457,-362,-129,-165,115,-11,-292,-464,145,-15,-52,312,-65,90,75,11,88,191,199,-90,202,-162],[15,320,89,85,-80,-418,260,37,5,-323,142,216,180,135,95,-183,-31,-237,-366,-290,234,280,182,7,75,369,52,-29,-11,-115,-104,105],[199,54,-433,-324,211,-105,-27,55,-101,-234,286,236,140,-674,100,-120,182,-121,78,518,200,73,60,166,-91,-160,-20,387,249,352,65,115],[2,5,5,1,1,-0,0,7,5,-5,-5,-1,-4,-5,-4,-6,3,-6,-2,-5,-1,2,2,1,5,-6,-2,-5,-5,0,-2,-1],[124,11,-335,137,-24,-23,-322,118,24,-258,55,-116,512,-48,-193,
1,41,42,46],[11,21,31,41,43,46],[5,6,11,12,31,32,35,41,42],[4,11,31,32,35,41,42,46],[11,18,27,41,42,43,46],[4,5,11,33,35,41],[],[],[4,11,27],[2,4,5,6,11,18,41,42,43,46],[2,4,5,35,41,42,50],[2,6,11,18,21,41,42,43,46],[2,4,5,6,11,18,27,31,35,41,42,43],[2,11,21,31,40,41,46],[4,11],[6,11,18,26,42,46],[18,21,43,46],[5,6,35,41,42,46],[6,21,31,32,36,46,50],[2,6,11,18,21,36,41,43,46],[7,12,32,35,41,42,50],[4,5,7,11,18,32,43],[],[],[2,5,6,11,18,27,35,41,43],[2,6,11,21,27,41,46],[],[11,41],50,[2,5,6,11,21,31,35,41,43,46],[4,5,11,33,35,41],[4,5,7,11,12,32,41,43,50],[],[2,4,5,11,41,50],[6,11,18,21,35,36,41,43,46],[],[2,11,18,21,27,41,43,46],[2,4,5,6,11,35,41,42,43],[4,5,6,11,21,31,41,42,46],[2,4,6,11,31,35,41,42,43,46],[2,4,5,6,11,21,31,41],[18,43],[35,41,42],[2,6,11,18,21,31,46],[2,6,11,18,31,36,41,43,46],[],[],[4,5,18,21,32,41,43],[2,4,6,11,35,41]],[[18,21,31,43,46],[2,6,11,18,21,41,43,46],[11,18,43],[5,6,11,18,35,41,43],[4,11,18,21,41,43],[4,11,18,21,43,46],[4,11,18,41,43,50],[],[],[18,43,46],[4,5,11,18,41,43,46],[4,18,32,35,41,43,50],[],[2,5,11,18,41,43,46],[2,11,18,27,43],[2,7,43],[5,6,11,18,19,36,42,43,46],[18,43],[11,18,41,43],[],[11,18,21,43,46],[11,12,18,35,41,43],[],[],[],[2,5,11,18,21,41,43,46],[2,6,11,18,21,41,43],[],18,[5,31,43,46],[11,18,21,41,43,46],[4,5,11,12,18,35,41,43],[4,7,12,18,35,41,42,43,50],[],[4,18,41,43,50],[11,18,21,41,43],43,[],[2,4,7,18,31,35,36,43],[2,5,11,18,21,43],[11,18,35,41,43],[4,11,18,41,43],[18,43],[],[2,18,43,46],[11,18,21,43,46],[],[],[],[4,7,12,18,35,41,43]]] color_model = [[4,7,10,11,12,13,14,16],[4,5,7,11,12,13],[4,5,6,7,8,9,11,12,13],[7,9,11,12,13,17],[7,8,9,11,12,13,17],[4,7,11,12,13],[4,5,7,8,9,11,12,13],[],[4,5,7,8,9,11,12,13],[4,5,6,7,11,12,13],[4,7,8,11,12,13],[7,8,9,11,12,13],[4,5,7,11,12],[4,5,7,8,11,13],[4,5,7,11,13],[4,7,9,11,12,13,15],[4,5,7,8,11],[7,11,12,13,17],[4,5,6,7,8,9,11,12,13,17],[4,5,7,11],[7,10,11,12,13,14,15,16],[6,9,12,13,17],[9,12,13,17],[],[],[4,7,10,11,12,13,14,16],[4,5,7,11,13],[4,5,7,11,13],[6,7,12],[4,5,6,11,13],[4,5,7,8,11,12,13],[4,5,6,7,8,11,12,13],[4,5,7,8,11],[4,5,7,9,11,12,13],[4,5,7,8,11,13],[4,7,8,11,13],12,[4,5,7],[4,5,7,8,11],[4,5,7,11],[4,5,7,8,11,13],[4,5,7,8,11,13],[4,5,7,8,11,12,13],[4,7,8,11,12],[4,5,7,11],[4,5,7,10,11,12,13,14],[],[],[4,5,7,8,11],[4,5,6,7,8,11,13]] masks = [[0.05,0.06,0.06,0.07,0.09,0.09,0.08,0.07,0.06,0.06,0.05,0.09,0.15,0.22,0.29,0.3,0.24,0.16,0.1,0.07,0.09,0.21,0.36,0.5,0.58,0.58,0.52,0.36,0.19,0.08,0.15,0.37,0.59,0.7,0.72,0.71,0.7,0.55,0.33,0.13,0.18,0.46,0.67,0.71,0.66,0.67,0.71,0.63,0.41,0.16,0.18,0.49,0.68,0.7,0.66,0.66,0.71,0.65,0.42,0.17,0.14,0.39,0.61,0.69,0.7,0.71,0.7,0.57,0.34,0.14,0.09,0.22,0.4,0.53,0.6,0.59,0.51,0.36,0.2,0.1,0.06,0.1,0.17,0.24,0.3,0.3,0.25,0.16,0.1,0.06,0.05,0.05,0.06,0.07,0.08,0.09,0.08,0.06,0.05,0.05],[0.34,0.33,0.32,0.3,0.29,0.28,0.28,0.28,0.28,0.28,0.32,0.3,0.27,0.24,0.23,0.23,0.23,0.23,0.24,0.26,0.31,0.26,0.21,0.18,0.17,0.18,0.18,0.19,0.21,0.24,0.31,0.24,0.18,0.15,0.13,0.14,0.15,0.16,0.19,0.23,0.31,0.23,0.17,0.14,0.13,0.13,0.14,0.16,0.19,0.23,0.33,0.24,0.17,0.14,0.14,0.14,0.14,0.15,0.19,0.23,0.35,0.27,0.19,0.15,0.14,0.15,0.15,0.16,0.2,0.24,0.39,0.33,0.26,0.2,0.19,0.18,0.19,0.2,0.22,0.25,0.43,0.4,0.35,0.3,0.27,0.25,0.26,0.25,0.25,0.27,0.42,0.43,0.41,0.38,0.35,0.32,0.31,0.3,0.28,0.28],[0.78,0.8,0.79,0.76,0.71,0.65,0.53,0.42,0.33,0.28,0.82,0.83,0.8,0.75,0.67,0.58,0.45,0.35,0.26,0.24,0.81,0.8,0.73,0.65,0.54,0.44,0.34,0.27,0.22,0.22,0.77,0.72,0.61,0.5,0.39,0.3,0.26,0.23,0.21,0.22,0.72,0.61,0.47,0.36,0.28,0.24,0.21,0.21,0.2,0.2,0.66,0.51,0.35,0.25,0.22,0.2,0.19,0.19,0.19,0.19,0.62,0.42,0.27,0.21,0.19,0.19,0.2,0.18,0.17,0.2,0.58,0.41,0.29,0.25,0.23,0.23,0.23,0.21,0.19,0.2,0.58,0.46,0.38,0.35,0.34,0.32,0.29,0.26,0.23,0.22,0.59,0.56,0.51,0.48,0.45,0.42,0.36,0.3,0.27,0.25],[0.61,0.42,0.19,0.1,0.08,0.07,0.06,0.06,0.04,0.05,0.66,0.43,0.17,0.08,0.07,0.06,0.06,0.05,0.04,0.04,0.74,0.48,0.16,0.08,0.08,0.07,0.06,0.06,0.05,0.04,0.82,0.56,0.22,0.11,0.09,0.08,0.07,0.06,0.05,0.05,0.87,0.63,0.3,0.18,0.13,0.09,0.08,0.06,0.05,0.05,0.89,0.66,0.32,0.19,0.14,0.09,0.08,0.07,0.05,0.05,0.88,0.63,0.28,0.14,0.1,0.09,0.07,0.06,0.05,0.05,0.82,0.58,0.25,0.12,0.09,0.07,0.06,0.05,0.05,0.05,0.75,0.54,0.26,0.12,0.08,0.07,0.06,0.05,0.04,0.04,0.68,0.51,0.27,0.14,0.09,0.07,0.06,0.05,0.05,0.04],[0.53,0.61,0.58,0.44,0.28,0.18,0.12,0.1,0.09,0.08,0.57,0.67,0.63,0.44,0.27,0.16,0.11,0.09,0.08,0.07,0.56,0.67,0.62,0.41,0.24,0.15,0.1,0.08,0.07,0.07,0.5,0.59,0.54,0.35,0.21,0.13,0.09,0.08,0.07,0.07,0.42,0.46,0.44,0.29,0.19,0.13,0.09,0.07,0.07,0.06,0.33,0.35,0.34,0.24,0.17,0.13,0.1,0.08,0.07,0.07,0.26,0.27,0.27,0.21,0.15,0.12,0.09,0.08,0.08,0.08,0.2,0.21,0.23,0.18,0.13,0.11,0.09,0.08,0.07,0.07,0.17,0.19,0.2,0.16,0.11,0.1,0.09,0.07,0.07,0.07,0.17,0.18,0.19,0.15,0.11,0.09,0.09,0.08,0.07,0.08],[0.1,0.12,0.15,0.19,0.2,0.18,0.16,0.13,0.11,0.1,0.11,0.2,0.28,0.36,0.39,0.33,0.26,0.18,0.13,0.1,0.13,0.26,0.41,0.52,0.54,0.48,0.37,0.26,0.16,0.12,0.11,0.26,0.4,0.49,0.5,0.46,0.38,0.29,0.19,0.12,0.11,0.21,0.3,0.36,0.38,0.36,0.32,0.25,0.18,0.13,0.09,0.15,0.19,0.24,0.26,0.26,0.25,0.21,0.16,0.12,0.07,0.11,0.14,0.17,0.19,0.2,0.19,0.18,0.14,0.1,0.06,0.08,0.11,0.13,0.14,0.15,0.16,0.15,0.12,0.1,0.06,0.07,0.08,0.1,0.11,0.12,0.12,0.12,0.11,0.1,0.06,0.06,0.07,0.08,0.09,0.09,0.09,0.1,0.09,0.09],[0.06,0.07,0.13,0.29,0.53,0.53,0.33,0.16,0.09,0.07,0.05,0.06,0.1,0.27,0.55,0.56,0.32,0.14,0.07,0.06,0.03,0.04,0.07,0.23,0.54,0.56,0.31,0.11,0.06,0.06,0.03,0.03,0.05,0.2,0.51,0.54,0.29,0.1,0.06,0.06,0.03,0.03,0.05,0.2,0.5,0.54,0.29,0.1,0.06,0.06,0.03,0.03,0.05,0.2,0.5,0.55,0.29,0.1,0.06,0.06,0.03,0.03,0.05,0.22,0.53,0.56,0.31,0.11,0.06,0.06,0.04,0.04,0.07,0.25,0.57,0.59,0.34,0.13,0.06,0.06,0.05,0.06,0.11,0.29,0.59,0.59,0.35,0.15,0.07,0.07,0.07,0.08,0.14,0.31,0.56,0.56,0.35,0.17,0.09,0.08],[0.04,0.04,0.05,0.08,0.11,0.21,0.42,0.69,0.83,0.86,0.04,0.04,0.04,0.06,0.09,0.18,0.39,0.7,0.85,0.87,0.03,0.03,0.04,0.05,0.08,0.15,0.37,0.71,0.87,0.88,0.03,0.03,0.04,0.05,0.07,0.14,0.35,0.71,0.88,0.89,0.03,0.03,0.04,0.05,0.08,0.13,0.34,0.71,0.88,0.88,0.03,0.03,0.04,0.05,0.08,0.14,0.35,0.71,0.88,0.89,0.03,0.03,0.04,0.05,0.07,0.14,0.36,0.72,0.89,0.89,0.03,0.03,0.04,0.05,0.08,0.15,0.36,0.71,0.88,0.89,0.03,0.03,0.04,0.06,0.1,0.18,0.39,0.7,0.86,0.87,0.04,0.04,0.05,0.08,0.12,0.21,0.41,0.68,0.83,0.85],[0.88,0.87,0.88,0.86,0.87,0.87,0.86,0.85,0.81,0.8,0.85,0.78,0.76,0.74,0.74,0.76,0.79,0.77,0.75,0.79,0.83,0.7,0.62,0.56,0.54,0.57,0.63,0.68,0.73,0.77,0.85,0.69,0.54,0.43,0.38,0.36,0.45,0.59,0.71,0.75,0.88,0.71,0.51,0.36,0.28,0.27,0.36,0.52,0.66,0.74,0.88,0.72,0.51,0.35,0.27,0.27,0.34,0.51,0.65,0.71,0.87,0.72,0.55,0.43,0.36,0.34,0.39,0.54,0.68,0.72,0.85,0.73,0.62,0.57,0.54,0.53,0.56,0.62,0.71,0.74,0.87,0.79,0.76,0.74,0.73,0.75,0.76,0.76,0.74,0.76,0.88,0.87,0.88,0.86,0.85,0.86,0.86,0.84,0.81,0.79],[0.08,0.07,0.07,0.1,0.13,0.17,0.18,0.27,0.49,0.69,0.07,0.06,0.07,0.09,0.11,0.14,0.15,0.24,0.49,0.73,0.06,0.06,0.07,0.08,0.11,0.13,0.14,0.2,0.49,0.75,0.06,0.06,0.07,0.09,0.11,0.13,0.13,0.19,0.48,0.76,0.06,0.06,0.07,0.09,0.12,0.13,0.13,0.18,0.47,0.77,0.06,0.06,0.07,0.09,0.12,0.13,0.13,0.18,0.47,0.77,0.06,0.05,0.07,0.09,0.11,0.13,0.12,0.19,0.48,0.77,0.06,0.05,0.07,0.08,0.11,0.12,0.13,0.21,0.5,0.77,0.06,0.06,0.07,0.09,0.11,0.14,0.16,0.25,0.51,0.75,0.07,0.06,0.07,0.09,0.13,0.16,0.18,0.28,0.51,0.72],[0.08,0.08,0.09,0.1,0.09,0.09,0.09,0.08,0.08,0.08,0.08,0.09,0.11,0.12,0.12,0.11,0.1,0.1,0.09,0.08,0.09,0.12,0.16,0.16,0.15,0.14,0.13,0.12,0.09,0.08,0.1,0.16,0.22,0.22,0.19,0.17,0.15,0.13,0.1,0.08,0.12,0.22,0.29,0.28,0.24,0.2,0.17,0.14,0.12,0.09,0.14,0.28,0.39,0.38,0.32,0.24,0.2,0.16,0.12,0.09,0.16,0.33,0.49,0.49,0.4,0.3,0.23,0.17,0.13,0.09,0.17,0.33,0.48,0.51,0.43,0.33,0.23,0.16,0.11,0.09,0.15,0.25,0.34,0.37,0.32,0.24,0.17,0.12,0.09,0.08,0.12,0.16,0.2,0.2,0.18,0.15,0.12,0.1,0.08,0.08],[0.09,0.18,0.4,0.57,0.46,0.24,0.13,0.08,0.05,0.04,0.08,0.18,0.47,0.69,0.54,0.26,0.13,0.08,0.05,0.05,0.06,0.2,0.52,0.76,0.59,0.27,0.13,0.08,0.05,0.05,0.07,0.2,0.54,0.8,0.62,0.29,0.13,0.08,0.05,0.04,0.07,0.2,0.53,0.79,0.63,0.3,0.13,0.08,0.06,0.04,0.07,0.19,0.52,0.79,0.63,0.3,0.13,0.07,0.05,0.04,0.06,0.18,0.5,0.78,0.62,0.28,0.13,0.07,0.05,0.04,0.06,0.17,0.46,0.72,0.59,0.27,0.13,0.07,0.05,0.04,0.08,0.16,0.41,0.63,0.53,0.25,0.13,0.08,0.05,0.04,0.09,0.17,0.36,0.54,0.44,0.22,0.12,0.07,0.05,0.04],[0.85,0.85,0.83,0.79,0.75,0.74,0.74,0.74,0.76,0.74,0.84,0.79,0.69,0.55,0.48,0.48,0.53,0.61,0.69,0.72,0.79,0.64,0.42,0.25,0.18,0.2,0.27,0.38,0.54,0.67,0.7,0.43,0.18,0.08,0.06,0.08,0.12,0.2,0.38,0.6,0.64,0.29,0.1,0.05,0.05,0.07,0.08,0.13,0.29,0.53,0.62,0.27,0.1,0.05,0.06,0.07,0.08,0.13,0.29,0.53,0.67,0.38,0.17,0.09,0.07,0.08,0.12,0.2,0.37,0.58,0.75,0.56,0.38,0.25,0.19,0.2,0.27,0.37,0.52,0.65,0.82,0.74,0.65,0.53,0.47,0.46,0.51,0.6,0.66,0.69,0.84,0.83,0.81,0.77,0.76,0.74,0.73,0.75,0.75,0.72],[0.22,0.26,0.32,0.36,0.37,0.38,0.36,0.35,0.32,0.29,0.21,0.26,0.33,0.38,0.39,0.4,0.4,0.38,0.34,0.29,0.23,0.29,0.36,0.4,0.41,0.41,0.42,0.41,0.36,0.3,0.24,0.31,0.38,0.41,0.42,0.42,0.42,0.42,0.37,0.31,0.24,0.32,0.39,0.42,0.43,0.42,0.43,0.42,0.38,0.32,0.24,0.32,0.4,0.43,0.44,0.43,0.43,0.42,0.38,0.31,0.24,0.32,0.41,0.45,0.46,0.44,0.43,0.42,0.37,0.31,0.23,0.32,0.41,0.46,0.46,0.45,0.43,0.41,0.37,0.29,0.22,0.3,0.39,0.44,0.45,0.43,0.41,0.39,0.34,0.28,0.23,0.29,0.35,0.4,0.41,0.39,0.37,0.36,0.32,0.28],[0.5,0.52,0.57,0.63,0.66,0.69,0.69,0.7,0.68,0.63,0.44,0.45,0.49,0.54,0.58,0.62,0.63,0.65,0.65,0.62,0.36,0.33,0.33,0.35,0.37,0.42,0.46,0.52,0.56,0.56,0.28,0.23,0.2,0.2,0.2,0.25,0.3,0.38,0.46,0.5,0.23,0.18,0.14,0.13,0.14,0.16,0.2,0.27,0.36,0.44,0.22,0.17,0.13,0.12,0.13,0.14,0.16,0.21,0.3,0.38,0.22,0.17,0.14,0.12,0.13,0.14,0.15,0.2,0.28,0.35,0.21,0.18,0.15,0.15,0.16,0.18,0.19,0.23,0.3,0.35,0.2,0.18,0.18,0.19,0.19,0.22,0.24,0.27,0.31,0.35,0.21,0.2,0.22,0.23,0.24,0.25,0.28,0.31,0.33,0.36],[0.07,0.07,0.08,0.11,0.16,0.22,0.32,0.41,0.42,0.36,0.06,0.07,0.08,0.1,0.16,0.23,0.35,0.46,0.47,0.38,0.06,0.07,0.08,0.11,0.15,0.23,0.35,0.48,0.49,0.38,0.06,0.07,0.08,0.11,0.14,0.21,0.32,0.45,0.46,0.37,0.06,0.08,0.09,0.12,0.15,0.2,0.29,0.4,0.42,0.33,0.06,0.08,0.09,0.12,0.14,0.19,0.27,0.36,0.37,0.3,0.06,0.08,0.09,0.11,0.14,0.18,0.25,0.32,0.32,0.26,0.06,0.08,0.09,0.11,0.13,0.17,0.22,0.28,0.27,0.23,0.06,0.07,0.08,0.1,0.12,0.16,0.19,0.25,0.24,0.2,0.06,0.06,0.08,0.1,0.12,0.15,0.19,0.23,0.23,0.19],[0.08,0.09,0.11,0.13,0.14,0.17,0.18,0.19,0.
// Aragnation let num_categories = 4, num_colors_per_palette = 17, Nx, Ny, num_prototypes, pattern = new Array(), mask_gen = new Array(), color_pattern = new Array(), noise_vector = new Array(), palettes; class Random { constructor() { this.useA = false; let sfc32 = function(uint128Hex) { let a = parseInt(uint128Hex.substr(0, 8), 16); let b = parseInt(uint128Hex.substr(8, 8), 16); let c = parseInt(uint128Hex.substr(16, 8), 16); let d = parseInt(uint128Hex.substr(24, 8), 16); return function() { a |= 0; b |= 0; c |= 0; d |= 0; let t = (((a + b) | 0) + d) | 0; d = (d + 1) | 0; a = b ^ (b >>> 9); b = (c + (c << 3)) | 0; c = (c << 21) | (c >>> 11); c = (c + t) | 0; return (t >>> 0) / 4294967296; }; }; // seed prngA with first half of tokenData.hash this.prngA = new sfc32(tokenData.hash.substr(2, 32)); // seed prngB with second half of tokenData.hash this.prngB = new sfc32(tokenData.hash.substr(34, 32)); for (let i = 0; i < 1e6; i += 2) { this.prngA(); this.prngB(); } } // random number between 0 (inclusive) and 1 (exclusive) random_dec() { this.useA = !this.useA; return this.useA ? this.prngA() : this.prngB(); } // random number between a (inclusive) and b (exclusive) random_num(a, b) { return a + (b - a) * this.random_dec(); } // random integer between a (inclusive) and b (inclusive) // requires a < b for proper probability distribution random_int(a, b) { return Math.floor(this.random_num(a, b + 1)); } // random boolean with p as percent liklihood of true random_bool(p) { return this.random_dec() < p; } // random value in an array of items random_choice(list) { return list[this.random_int(0, list.length - 1)]; } } // From https://gist.github.com/dmitric/0de47d734bd1747158fd3b11f482e884 // Artblocks injects the tokenData variable into your sketch like so // let tokenData = {"hash":"0xf445bc56ff81a55f2ece1536eecf9972469048c04f778570b12ed664a9053590","tokenId":"123000456"} console.log(tokenData.hash) // your random seed let seed = generate_seed_from_token_data(tokenData); // the ID of the token let tokenId = parseInt(tokenData.tokenId.substring(2)) rnd = new Random(seed); function generate_seed_from_token_data(token) { return parseInt(token.hash.slice(0, 16), 16) } function setup_params_from_token(token) { let hashPairs = [] for (let j = 0; j < 32; j++) { hashPairs.push(token.hash.slice(2 + (j * 2), 4 + (j * 2))) } return hashPairs.map(x => { return parseInt(x, 16) }) } function calculateFeatures(tokenData) { let p = setup_params_from_token(tokenData), pid = 0; let pick_using_param = (choices, param) => choices[parseInt(map(param, 0, 256, 0, choices.length))]; let feats = {}; feats.texture = pick_using_param(["gradient", "plain"], p[pid++]); feats.reflection = pick_using_param(["yes", "no", "no", "no"], p[pid++]); feats.colors = pick_using_param(SAMPLE_COLOR_OPS, p[pid++]); feats.palette = palette_names[pick_using_param([...Array(palettes.length).keys()], p[pid++])]; feats.bg_style = bg_style_names[pick_using_param([...Array(4).keys()], p[pid++])]; generate_masks_colors_noise(feats.colors); feats.subject = category_names[infer_category()]; return feats; } function setup() { start = Date.now(); /************************************************************************* * Boilerplate: aspect ratio, margin, pixel density, seed, etc. *************************************************************************/ ar = 3 / 4, mult = 1.0; pixelDensity(2); if (windowWidth >= ar * windowHeight) { h = mult * windowHeight, w = ar * mult * windowHeight; } else { h = mult * windowWidth / ar, w = mult * windowWidth; } pt = h / 1000; // Use to set for stroke widths. margin = w / 15; createCanvas(w, h); // randomSeed(seed); noiseSeed(seed); console.log(w, h, seed); /*************************************************************************/ /************************************************************************* * Scene configs, color palettes *************************************************************************/ category_names = ["landscape", "flower", "urban", "bird"]; bg_style_names = ["graph", "rods and cones", "marble", "fabric"]; palette_names = ["v1", "indian", "american", "australian", "british", "canadian", "chinese", "dutch", "french", "german", "russian", "spanish", "swedish", "turkish"]; palettes = [ // from model // all_colors, // v1 [[41, 128, 185],[52, 152, 219],[26, 188, 156],[44, 62, 80],[39, 174, 96],[52, 73, 94],[142, 68, 173],[22, 160, 133],[127, 140, 141],[211, 84, 0],[155, 89, 182],[149, 165, 166],[189, 195, 199],[231, 76, 60],[230, 126, 34],[241, 196, 15],[236, 240, 241]], // indian [[59, 59, 152],[27, 156, 252],[37, 204, 247],[24, 44, 97],[44, 58, 71],[130, 88, 159],[109, 33, 79],[88, 177, 159],[85, 230, 193],[179, 55, 113],[189, 197, 129],[154, 236, 219],[202, 211, 200],[249, 127, 81],[254, 164, 127],[234, 181, 67],[248, 239, 186]], // american [[9, 132, 227],[116, 185, 255],[0, 206, 201],[45, 52, 54],[0, 184, 148],[108, 92, 231],[225, 112, 85],[99, 110, 114],[162, 155, 254],[255, 118, 117],[178, 190, 195],[129, 236, 236],[223, 230, 233],[214, 48, 49],[253, 203, 110],[255, 234, 167],[250, 177, 160]], // australian [[48, 51, 107],[104, 109, 224],[34, 166, 179],[19, 15, 64],[106, 176, 76],[72, 52, 212],[83, 92, 104],[186, 220, 88],[149, 175, 192],[240, 147, 43],[255, 121, 121],[126, 214, 223],[199, 236, 238],[235, 77, 75],[255, 190, 118],[249, 202, 36],[223, 249, 251]], // british [[39, 60, 117],[0, 151, 230],[0, 168, 255],[25, 42, 86],[68, 189, 50],[64, 115, 158],[53, 59, 72],[113, 128, 147],[72, 126, 176],[194, 54, 22],[127, 143, 166],[156, 136, 255],[220, 221, 225],[232, 65, 24],[225, 177, 44],[251, 197, 49],[245, 246, 250]], // canadian [[52, 31, 151],[46, 134, 222],[1, 163, 164],[34, 47, 62],[16, 172, 132],[95, 39, 205],[87, 101, 116],[29, 209, 161],[84, 160, 255],[238, 82, 83],[131, 149, 167],[72, 219, 251],[200, 214, 229],[255, 107, 107],[255, 159, 67],[254, 202, 87],[255, 159, 243]], // chinese [[55, 66, 250],[30, 144, 255],[123, 237, 159],[47, 53, 66],[46, 213, 115],[83, 82, 237],[87, 96, 111],[116, 125, 140],[112, 161, 255],[255, 71, 87],[255, 107, 129],[164, 176, 190],[206, 214, 224],[255, 99, 72],[255, 127, 80],[236, 204, 104],[241, 242, 246]], // dutch [[0, 98, 102],[6, 82, 221],[18, 203, 196],[27, 20, 100],[0, 148, 50],[18, 137, 167],[111, 30, 81],[131, 52, 113],[87, 88, 187],[234, 32, 39],[181, 52, 113],[153, 128, 250],[217, 128, 250],[238, 90, 36],[247, 159, 31],[255, 195, 18],[253, 167, 223]], // french [[30, 55, 153],[56, 173, 169],[7, 153, 146],[12, 36, 97],[10, 61, 98],[60, 99, 130],[183, 21, 64],[96, 163, 188],[106, 137, 204],[235, 47, 6],[229, 142, 38],[130, 204, 221],[248, 194, 145],[229, 80, 57],[250, 152, 58],[246, 185, 59],[250, 211, 144]], // german [[56, 103, 214],[45, 152, 218],[38, 222, 129],[75, 101, 132],[32, 191, 107],[119, 140, 163],[235, 59, 90],[15, 185, 177],[75, 123, 236],[250, 130, 49],[136, 84, 208],[165, 177, 194],[165, 94, 234],[252, 92, 101],[253, 150, 68],[254, 211, 48],[209, 216, 224]], // russian [[87, 75, 144],[84, 109, 229],[61, 193, 211],[48, 57, 82],[99, 205, 218],[89, 98, 117],[196, 69, 105],[120, 111, 166],[119, 139, 235],[225, 95, 65],[207, 106, 135],[119, 139, 235],[248, 165, 194],[230, 103, 103],[241, 144, 102],[245, 205, 121],[247, 215, 148]], // spanish [[34, 112, 147],[52, 172, 224],[51, 217, 178],[44, 44, 84],[33, 140, 116],[71, 71, 135],[64, 64, 122],[132, 129, 122],[112, 111, 211],[179, 57, 57],[204, 174, 98],[170, 166, 157],[209, 204, 192],[255, 82, 82],[255, 121, 63],[255, 177, 66],[247, 241, 227]], // swedish [[60, 64, 198],[15, 188, 249],[0, 216, 214],[30, 39, 46],[5, 196, 107],[87, 95, 207],[72, 84, 96],[128, 142, 155],[52, 231, 228],[255, 63, 52],[239, 87, 119],[75, 207, 250],[255, 221, 89],[255, 94, 87],[255, 192, 72],[255, 211, 42],[210, 218, 226]], // turkish [[125, 95, 255],[23, 192, 235],[24, 220, 255],[61, 61, 61],[58, 227, 116],[113, 88, 226],[75, 75, 75],[50, 255, 126],[103, 230, 220],[255, 56, 56],[197, 108, 240],[126, 255, 245],[255, 184, 184],[255, 77, 77],[255, 175, 64],[255, 242, 0],[255, 204, 204]] ]; // model.js mask_model = [[3,19,22,23,39,45,49],[[2,27,33,35,40,42,45],[2,27,39,41,42],[31,33,35,39,40,41,42],[11,12,32,33,35,39,40,41,42,50],[2,11,35,39,40,41,42,50],[19,27,31,35,39,40,45],[2,5,14,22,33,35,50],[],[11,21,31,36,41,42,43,46],[4,15,19],[2,5,6,27,35,39,42],[4,22,27,33,35,41,42,50],[1,6,26,41,42,46,50],[2,4,27,39,40,41,42,45],[2,14,31,40,41],[],[4,6,15],[],[33,35,39,41,42,45],[1,2,14,26,27,39,42,45],40,[32,33,35,41,42,50],[33,35,41,42,50],[],[],[2,3,4,15,19,27,35,40,45],[2,4,11,27,31,40,41,42],[4,14,15,33,39,40,41,42,45],35,[],[2,6,27,31,33,41,42,49],[4,22,33,35],[4,5,12,19,22],[6,11,18,21,46],[2,11,12,19,22,32,39,50],[],[],[1,2,6,11,12,21,26],[2,14,19,27,39,40,42],[1,2,4,5,14,42],[2,3,11,12,22,32,42],[2,4,5,19,22,40,41],[],[12,31,40,41,46],[1,2,11,14,19],36,[],[],[4,5,11,12,22],[2,5,12,19,22,35]],[[2,27,35,40,41,42,43],[2,6,11,21,27,3
Aragnation questions preconceived notions of what AI art can be. Does AI art have to be powered by giant neural networks? Do the aesthetics have to be that of photos or paintings or collages of pieces thereof? Aragnation uses tiny AI models and constructs abstract imagery in the vocabulary of abstract blobs and organic textures rather than pixels. It is playful with colors. It has a hint of a watercolor and art paper aesthetic. The training data includes photographs taken by one of the artists, Abhishek. The generated pieces thus capture, in broad strokes, Abhishek’s photography – nature, landscapes and urban settings. In a refreshing contrast to the gravity of the role AI technology is playing in content creation and creative expression, Aragnation brings a light and joyful touch to generative AI art. No GPUs were harmed in the making of Aragnation. All AI models are entirely different architectures than those commonly used, and have been designed and trained from scratch by the artists.
while(I.length<W){var F=Math.floor(rnd.o()*(colorsToUse.length-2))+1;if(I.indexOf(S[F])===-1&&!LindList.includes(F))I.push(S[F])}for(var _=0;_<W;_++){ind=S.indexOf(I[_]);colorsToUse[ind]=U[_]}}background(i);if(H!==6&H>0){if([1].includes(H)){strokeWeight(s/980*15)}if([2].includes(H)){strokeWeight(s/9800*15)}if([3,4,10].includes(H)){strokeWeight(s/980*2)}if([5,7,8,9,12,13].includes(H)){strokeWeight(s/980*1)}if([10,11].includes(H)){strokeWeight(s/980*2)}if([5].includes(H)){NN=15}if([8,10,11,12,13].includes(H)){NN=12}if([7].includes(H)){NN=7}if([9].includes(H)){NN=8}if([5,7,8,9,10,11,12,13].includes(H)){ll=s/980*NN}var _=0;for(var k=0;k<41;k++){var r=0;for(var M=0;M<41;M++){cid=rnd.F(0,W-1);random_color=U[cid];stroke(random_color);if(H==1){point(_,r)}if(H==2){ellipse(_,r,50*s/980,50*s/980)}if(H==3){ellipse(_,r,10*s/980,20*s/980)}if(H==4){ellipse(_,r,20*s/980,10*s/980)}if(H==5){line(_-ll,r-ll,_+ll,r+ll);line(_-ll,r+ll,_+ll,r-ll)}if(H==7){line(_-ll,r-ll,_+ll,r-ll);line(_+ll,r-ll,_+ll,r+ll);line(_+ll,r+ll,_-ll,r+ll);line(_-ll,r+ll,_-ll,r-ll)}if(H==9){icp1=[];icp2=[];vs=[];vs[0]=[_+ll,r];icp1[0]=[(_+vs[0][0])/2,(r+vs[0][1])/2+ll/2];icp2[0]=[(_+vs[0][0])/2,(r+vs[0][1])/2-ll/2];vs[1]=[_-ll,r];icp1[1]=[(_+vs[1][0])/2,(r+vs[1][1])/2-ll/2];icp2[1]=[(_+vs[1][0])/2,(r+vs[1][1])/2+ll/2];vs[2]=[_+ll/1.4,r+ll/1.4];icp1[2]=[(_+vs[2][0])/2-ll/4,(r+vs[2][1])/2+ll/4];icp2[2]=[(_+vs[2][0])/2+ll/4,(r+vs[2][1])/2-ll/4];vs[3]=[_-ll/1.4,r+ll/1.4];icp1[3]=[(_+vs[3][0])/2-ll/4,(r+vs[3][1])/2-ll/4];icp2[3]=[(_+vs[3][0])/2+ll/4,(r+vs[3][1])/2+ll/4];vs[4]=[_+ll/1.4,r-ll/1.4];icp1[4]=[(_+vs[4][0])/2+ll/4,(r+vs[4][1])/2+ll/4];icp2[4]=[(_+vs[4][0])/2-ll/4,(r+vs[4][1])/2-ll/4];vs[5]=[_-ll/1.4,r-ll/1.4];icp1[5]=[(_+vs[5][0])/2+ll/4,(r+vs[5][1])/2-ll/4];icp2[5]=[(_+vs[5][0])/2-ll/4,(r+vs[5][1])/2+ll/4];vs[6]=[_,r+ll];icp1[6]=[(_+vs[6][0])/2-ll/2,(r+vs[6][1])/2];icp2[6]=[(_+vs[6][0])/2+ll/2,(r+vs[6][1])/2];vs[7]=[_,r-ll];icp1[7]=[(_+vs[7][0])/2+ll/2,(r+vs[7][1])/2];icp2[7]=[(_+vs[7][0])/2-ll/2,(r+vs[7][1])/2]}if(H==9){for(var w=0;w<vs.length;w++){fill(random_color);beginShape();vertex(_,r);quadraticVertex(icp1[w][0],icp1[w][1],vs[w][0],vs[w][1]);vertex(_,r);quadraticVertex(icp2[w][0],icp2[w][1],vs[w][0],vs[w][1]);endShape();noFill()}}if([8,9,10,11,12,13].includes(H)){icp=[];vs=[];vs[0]=[_+ll,r];icp[0]=[(_+vs[0][0])/2,(r+vs[0][1])/2+ll];vs[1]=[_-ll,r];icp[1]=[(_+vs[1][0])/2,(r+vs[1][1])/2-ll];vs[2]=[_+ll,r+ll];icp[2]=[(_+vs[2][0])/2-ll/2,(r+vs[2][1])/2+ll/2];vs[3]=[_-ll,r+ll];icp[3]=[(_+vs[3][0])/2-ll/2,(r+vs[3][1])/2-ll/2];vs[4]=[_+ll,r-ll];icp[4]=[(_+vs[4][0])/2+ll/2,(r+vs[4][1])/2+ll/2];vs[5]=[_-ll,r-ll];icp[5]=[(_+vs[5][0])/2+ll/2,(r+vs[5][1])/2-ll/2];vs[6]=[_,r+ll];icp[6]=[(_+vs[6][0])/2-ll,(r+vs[6][1])/2];vs[7]=[_,r-ll];icp[7]=[(_+vs[7][0])/2+ll,(r+vs[7][1])/2]}if(H==8){for(var w=0;w<vs.length;w++){beginShape();vertex(_,r);quadraticVertex(icp[w][0],icp[w][1],vs[w][0],vs[w][1]);endShape()}}if(H==10){for(var w=0;w<2;w++){beginShape();vertex(_,r);quadraticVertex(icp[w][0],icp[w][1],vs[w][0],vs[w][1]);endShape()}}if(H==11){for(var w=6;w<8;w++){beginShape();vertex(_,r);quadraticVertex(icp[w][0],icp[w][1],vs[w][0],vs[w][1]);endShape()}}if(H==12){for(var w=0;w<vs.length;w++){if([0,1,6,7].includes(w)){beginShape();vertex(_,r);quadraticVertex(icp[w][0],icp[w][1],vs[w][0],vs[w][1]);endShape()}}}if(H==13){for(var w=2;w<6;w++){beginShape();vertex(_,r);quadraticVertex(icp[w][0],icp[w][1],vs[w][0],vs[w][1]);endShape()}}r=r+s/40}_=_+s/40}}if(H==6){strokeWeight(s/980*15);KK=400;var _=0;for(var k=0;k<KK+1;k++){var r=0;for(var M=0;M<KK+1;M++){cid=rnd.F(0,W-1);random_color=U[cid];if(rnd.o()>.9){strokeWeight(s/980*3);stroke(random_color);point(_,r)}r=r+s/KK}_=_+s/KK}}loadPixels();for(let e=0;e<h;e+=4){ind=cclabels1d[Math.floor(e/4)];if(ind>0&&(!LindList.includes(ind)||q==0)){pixels[e]=colorsToUse[ind][0];pixels[e+1]=colorsToUse[ind][1];pixels[e+2]=colorsToUse[ind][2];pixels[e+3]=255}}updatePixels();let L=[];for(var _=0;_<t.length;_++){if(cut_void){L[_]=1}else{P=.5;p0x=t[_];p0y=a[_];p1x=n[_];p1y=c[_];p2x=v[_];p2y=o[_];x=(1-P)*(1-P)*p0x+2*(1-P)*P*p1x+P*P*p2x;y=(1-P)*(1-P)*p0y+2*(1-P)*P*p1y+P*P*p2y;CH=3*s/$;let e=[];let i=[];if(f[_]==0){e[0]=x+CH;i[0]=y+CH;e[1]=x-CH;i[1]=y-CH}else{e[0]=x+CH;i[0]=y-CH;e[1]=x-CH;i[1]=y+CH}let l=0;for(var r=0;r<e.length;r++){if(LindList.includes(m[Math.floor(i[r]*u)][Math.floor(e[r]*u)])){l=l+1}}if(q==0||l<2){L[_]=1}else{L[_]=0}}}if(z==1){sws=[1.1*N+4*s/$,.3*N];colors=[i,white]}else{sws=[1.1*N];colors=[i]}for(var r=0;r<sws.length;r++){for(var _=0;_<t.length;_++){if(L[_]==1){strokeWeight(sws[r]);stroke(colors[r]);beginShape();vertex(t[_],a[_]);quadraticVertex(n[_],c[_],v[_],o[_]);endShape()}}}strokeWeight(s/$);stroke(i);rect(0,0,s,s)}function h(i){let l=[];for(let e=0;e<32;e++){l.push(i.hash.slice(2+e*2,4+e*2))}return l.map(e=>{return parseInt(e,16)})}function A(e){return parseInt(e.hash.slice(0,16),16)}function C(e,i,l,s){return Math.sqrt((l-e)*(l-e)+(s-i)*(s-i))}function E(e,i,l,s,r){return(e-i)/(l-i)*(r-s)+s}function D(e,i,l){return E(e,0,255,i,l)}function j(t,a,n){var o=a*n;var c=255;var e=0;var v=0;var f=-1;var p=[1,a+1,a,a-1,-1,-a-1,-a,-a+1];var F=[];var d=1;t.A(0,a,c);t.A(a*(n-1),a,c);for(var i=1;i<n-1;i++){var l=i*a;t[l]=c;t[l+a-1]=c}F.A(0,o,v);var u=function(e,i){for(var l=0;l<8;l++){var s=(i+l)%8;var r=e+p[s];if(r<0||r>=o)continue;if(t[r]!=c)return{C:r,D:s};B(F[r]<=v);F[r]=f}return{C:e,D:-1}};var h=function(e,i,l){var s=l?7:3;var r=u(e,s);var t=r.C;var a=r.D;F[e]=i;if(t==e)return;var n=0;var c=t;var v=t;while(v!=e||c!=t){B(n++<o,"Looped too many times!");F[c]=i;v=c;s=(a+5)%8;r=u(v,s);c=r.C;a=r.D}};var s=function(){var e=1;do{var i=0;do{var l=e*a+i;if(t[l]==c)continue;var s=false;if(t[l-a]==c&&F[l]==v){h(l,d,true);d++;s=true}if(t[l+a]==c&&F[l+a]==v){var r=F[l-1];if(F[l]!=v)r=F[l];B(r>v,"Step 2: N must be set, ("+i+","+e+") "+r+" "+t[l-1]);h(l,r,false);s=true}if(F[l]==v){var r=F[l-1];B(!s,"Step 3: We have traced, but not set the label");B(r>v,"Step 3: N must be set, ("+i+","+e+") "+r);F[l]=r}}while(i++<a)}while(e++<n-1);return F};return s()}Array.prototype.A=function(e,i,l){for(var s=0;s<i;s++){this[e++]=l}};function B(e,i){if(!e){throw new m(i)}}function m(e){this.message=e}m.prototype.toString=function(){return"AssertException: "+this.message};function b(e){var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),h:parseInt(i[2],16),b:parseInt(i[3],16)}:null} // https://github.com/bramp/Connected-component-labelling/blob/master/connected-component-labelling.js Apache 2.0 license.
let e=h(tokenData);let i=A(tokenData);let l=parseInt(tokenData.tokenId.substring(2));class r{constructor(){this.l=false;let e=function(e){let i=parseInt(e.substr(0,8),16);let l=parseInt(e.substr(8,8),16);let s=parseInt(e.substr(16,8),16);let r=parseInt(e.substr(24,8),16);return function(){i|=0;l|=0;s|=0;r|=0;let e=(i+l|0)+r|0;r=r+1|0;i=l^l>>>9;l=s+(s<<3)|0;s=s<<21|s>>>11;s=s+e|0;return(e>>>0)/4294967296}};this.t=new e(tokenData.hash.substr(2,32));this.v=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2){this.t();this.v()}}o(){this.l=!this.l;return this.l?this.t():this.v()}p(e,i){return e+(i-e)*this.o()}F(e,i){return Math.floor(this.p(e,i+1))}u(e){return this.o()<e}}rnd=new r(i);let t=[["#FFD4B5","#AA9CFF","#D1FFCF","#32BFD1"],["#FF67E7","#FFF338","#9A5AFF","#0CECDD"],["#FFBCBC","#F38BA0","#EDF6E5","#B5EAEA"],["#F9F9F9","#F7DBF0","#BEAEE2","#CDF0EA"],["#FFC074","#FAF1E6","#B6C867","#01937C"],["#BB371A","#EBA83A","#FFF8D9","#D5DBB3"],["#FFCEAD","#FFF5AB","#C449C2","#867AE9"],["#FFAAA7","#FFD3B4","#D5ECC2","#98DDCA"],["#BE0000","#E48900","#F7EA00","#9EDE73"],["#FFCB91","#FFEFA1","#94EBCD","#6DDCCF"],["#AA2B1D","#CC561E","#EF8D32","#BECA5C"],["#FF75A0","#FCE38A","#EAFFD0","#95E1D3"],["#FFE6E6","#FFABE1","#A685E2","#6155A6"],["#EF4F4F","#EE9595","#FFCDA3","#74C7B8"],["#FF577F","#FF884B","#FFC764","#CDFFFC"],["#FF449F","#FFF5B7","#005F99","#00EAD3"],["#FF94CC","#F0D9E7","#A239EA","#5C33F6"],["#FBC7F7","#D62AD0","#FB7AFC","#78DEC7"],["#ff3333","#dcd427","#779933","#0092cc"],["#c0392b","#e67e22","#27ae60","#2980b9"],["#fab1a0","#fd79a8","#a29bfe","#81ecec"],["#ff7675","#ffeaa7","#74b9ff","#55efc4"],["#e17055","#e84393","#6c5ce7","#00cec9"],["#d63031","#fdcb6e","#0984e3","#00b894"],["#DB162F","#DFD630","#09588E","#04A5AA"],["#F56A0F","#CCED32","#7ED615","#1F37AD"],["#FE0879","#FF82E2","#FED715","#0037B3"],["#943038","#945E46","#B68264","#EAD6B9"],["#FFFFFF","#C74BA3","#FFC618","#3E45AA"],["#E53A3B","#FAEFCF","#FAC80E","#589F7F"],["#FD9CAC","#FB934E","#FABE51","#1BAC6C"],["#FCA202","#521AA8","#2336D8","#028224"],["#F24976","#F29F05","#553967","#0FA619"],["#F29BAB","#F26A4B","#F2CA52","#1BA665"],["#794F6B","#F280D4","#9678BF","#8FD9BE"],["#F2766B","#F22233","#F2A2A9","#F2BB13"],["#BF610F","#73024B","#165927","#037F8C"],["#C11432","#FDD10A","#66A64F","#009ADA"],["#8C5E35","#594F32","#BFAF80","#427F8C"],["#E17976","#DF5D23","#E2CE19","#89AD03"],["#BC000D","#E7CFB7","#FFEC00","#3229AD"],["#9F4740","#B985BA","#7EA860","#4885A4"],["#E4502E","#E69252","#ECB931","#43789F"],["#D95032","#D95D30","#D98014","#D99311"],["#C7AD24","#CBC776","#2C41A7","#6284C8"],["#FD814E","#F588AF","#FCBC54","#A4D984"],["#EC0002","#E60400","#FEE454","#004895"],["#D91A1A","#F26716","#F28B0C","#A8B2E2"],["#EED09E","#B2C244","#827F88","#B2CFD4"],["#c35b48","#e5c027","#458962","#125592"]];density_param=Math.min(parseInt(D(e[0],0,15)),14);densities=[4,5,6,7,8,9,10,13,16,20,25,30,40,50,60];num_grid=densities[density_param];if(num_grid>20){climit=21}else{climit=31}curvy=parseInt(D(e[1],0,climit))/10;var V=parseInt(D(e[2],0,1001))/1e3;if(num_grid>20){if(num_grid>40){var a=4}else{var a=5}}else{var N=a=8}var N=parseInt(D(e[3],2,a));if(num_grid<6){var N=7}N=Math.min(N,7);if(num_grid<20&&N>2){var z=e[9]<127}else{var z=0}if(z){N=2*N}var n=Math.min(parseInt(D(e[5],0,t.length)),t.length-1);var q=e[4]>63;if(q==0){var c=2}else{var c=1}var W=parseInt(D(e[6],c,t[n].length+1));W=Math.min(W,t[n].length);var v=[];if(W==1){var o=Math.min(parseInt(D(e[10],1,5)),4);if(o==1){v=[1]}if(o==2){v=[2]}if(o==3){v=[3]}if(o==4){v=[4]}}if(W==2){var o=Math.min(parseInt(D(e[10],1,7)),6);if(o==1){v=[1,2]}if(o==2){v=[1,3]}if(o==3){v=[1,4]}if(o==4){v=[2,3]}if(o==5){v=[2,4]}if(o==6){v=[3,4]}}if(W==3){var o=Math.min(parseInt(D(e[10],1,5)),4);if(o==1){v=[1,2,3]}if(o==2){v=[1,2,4]}if(o==3){v=[1,3,4]}if(o==4){v=[2,3,4]}}if(W==4){v=[1,2,3,4]}var K=e[7]<127;var H=Math.min(parseInt(D(e[8],0,14)),13);if(num_grid>20){if(H==1){H=0}if(H==2){H=5}if(H==3){H=6}if(H==4){H=7}if(H==9){H=8}}VoidSizes=[.1,.2,.3];var f=Math.min(parseInt(D(e[11],0,VoidSizes.length)),VoidSizes.length-1);VoidSize=VoidSizes[f];if(num_grid<13&&z==1&&q==1){cut_void=1}else{cut_void=0}let U=[];for(var p=0;p<v.length;p++){dummy=b(t[n][v[p]-1]);U[p]=[dummy.r,dummy.h,dummy.b]}pieceSize=2400;s=Math.min(window.innerWidth,window.innerHeight);let F=1;if(!(pieceSize/s*s==pieceSize)){for(var P=0;P<5;P++){if(F){s=s-1;if(!(pieceSize/s*s==pieceSize)){F=1}else{F=0}}}}let $=800;N=N*s/$;function setup(){createCanvas(s,s);noLoop()}function draw(){cid=rnd.F(0,W-1);white=[236,240,241];if(K==0){i=[26,27,29]}else{var i=[];var e=.8;for(var r=0;r<3;r++){i[r]=(1-e)*U[cid][r]+e*0}}if(s<2401){pixelDensity(pieceSize/s)}else pixelDensity(1);th=s/num_grid;nu=curvy*th/3;st=0;en=s;noFill();strokeWeight(s/400);stroke(i);let t=[],a=[],n=[],c=[],v=[],o=[],f=[];x=st,y=st;for(var l=0;l<num_grid;l++){y=st;for(var p=0;p<num_grid;p++){if(rnd.o()>V){p1=[x,y];p2=[x+th,y+th];if(rnd.o()>.5){cp=[(p1[0]+p2[0]-nu)/2,(p1[1]+p2[1]+nu)/2]}else{cp=[(p1[0]+p2[0]+nu)/2,(p1[1]+p2[1]-nu)/2]}f.push(1)}else{p1=[x,y+th];p2=[x+th,y];if(rnd.o()>.5){cp=[(p1[0]+p2[0]-nu)/2,(p1[1]+p2[1]-nu)/2]}else{cp=[(p1[0]+p2[0]+nu)/2,(p1[1]+p2[1]+nu)/2]}f.push(0)}beginShape();vertex(p1[0],p1[1]);quadraticVertex(cp[0],cp[1],p2[0],p2[1]);endShape();t.push(p1[0]),a.push(p1[1]),n.push(cp[0]),c.push(cp[1]),v.push(p2[0]),o.push(p2[1]);y=y+th}x=x+th}T=10;colors_template=[];for(var F=0;F<=T;F++){colors_template[F]=[];for(var d=0;d<=T;d++){cid=rnd.F(0,W-1);colors_template[F][d]=U[cid]}}loadPixels();let u=pixelDensity();let h=4*(width*u)*(height/1*u);let A=0;let C=[];for(let e=0;e<h;e+=4){C[A]=pixels[e+3];A=A+1}cclabels1d=j(C,Math.round(s*u),Math.round(s*u));let E=[],D=[],B=[],m=[],b=0;var _=0;for(var F=0;F<s*u;F++){m[F]=[];for(var d=0;d<s*u;d++){b=Math.max(b,cclabels1d[_]);if(cclabels1d[_]>-1){if(isNaN(E[cclabels1d[_]])){E[cclabels1d[_]]=1;D[cclabels1d[_]]=0;B[cclabels1d[_]]=0}else{E[cclabels1d[_]]++;D[cclabels1d[_]]=D[cclabels1d[_]]+F/u;B[cclabels1d[_]]=B[cclabels1d[_]]+d/u;m[F][d]=cclabels1d[_]}}if(cclabels1d[_]<0){m[F][d]=m[F][d-1]}_++}}for(var _=0;_<B.length;_++){B[_]=B[_]/E[_];D[_]=D[_]/E[_]}if(q==1){let l=sort(E,E.length);let r=0;let t=0;LindList=[];for(let i=0;i<l.length;i++){if(t==0){let e=l[E.length-i-1];ind=E.indexOf(e);if(ind!=0){if(r==0){r=r+E[ind];LindList.push(ind)}else{if((r+E[ind])/(s*u*s*u)<VoidSize){r=r+E[ind];LindList.push(ind)}else{t=1}}}}}}else{LindList=[]}colorsToUse=[];cluster_loc_id=[];for(let e=0;e<=b;e+=1){cuse=Math.round(B[e]/s*T);ruse=Math.round(D[e]/s*T);colorsToUse[e]=colors_template[cuse][ruse];cluster_loc_id[e]=parseInt(cuse.toString()+ruse.toString());if(LindList.includes(e)){if(q==1){colorsToUse[e]=i}}}if(num_grid<16){var g=cluster_loc_id.slice().sort(function(e,i){return i-e});var S=cluster_loc_id.map(function(e){return g.indexOf(e)+1});var I=[];
Cushions brings together image processing and generative art techniques. The latter provides the geometric structure, and the former creates the organic shapes. Every single pixel and its connectedness to other pixels are explicitly considered. Inspiration for the palettes ranges from digital illustrations and pastels to a nod to renowned artists and different ethnicities. The organic shapes and the textures within symbolize the beauty in our individual oddities. Some pieces evoke the semblance of fantastical dreams in starry nights. Some of the comfort and familiarity of home. Some of nostalgia and long-lost friends. Some of reasonable and grounded perspectives. Some of sparks, some of style, some of strength, and some of passion. Some of candy. Some of pop art. Some of modern interior design. And some of traditional Indian cushions, known as Takiya.