console.log('Comics in collaboration with Joe Chain');
console.log('https://www.artstation.com/ceda90');
console.log('Lomz 2022');
console.log('https://www.lomz.net');
let comicGridX = [1.34 , 1.007];
let comicGridY = [3.96 ,2 , 1.34 , 1.007];
comicDividerX = int(get_random(0, comicGridX.length));
console.log('X: ' +comicDividerX + '=' + comicGridX[comicDividerX]);
comicDividerY = int(get_random(0, comicGridY.length));
console.log('Y: ' +comicDividerY + '=' + comicGridY[comicDividerY]);
createCanvas(wh/comicGridX[comicDividerX], wh/comicGridY[comicDividerY]);
if (comicDividerX == 0) {
if (comicDividerX == 1) {
if (comicDividerY == 0) {
if (comicDividerY == 1) {
if (comicDividerY == 2) {
if (comicDividerY == 3) {
synthColor = int(get_random(0, colors.length));
for (let x = 0; x < gridNumX; x += 1) {
for (let y = 0; y < gridNumY; y += 1) {
choosen1x2 = int(fxrand() * numberOf1x2);
image(p1x2[choosen1x2], xPos+sBW, yPos+sBW, (rS/2)-sBW, rS-sBW);
choosen1x2 = int(fxrand() * numberOf1x2);
image(p1x2[choosen1x2], (xPos+(rS/2))+sBW, yPos+sBW, (rS/2)-sBW, rS-sBW);
else if (fxrand() > .3 && fxrand() < .5) {
choosen2x1 = int(fxrand() * numberOf2x1);
image(p2x1[choosen2x1], xPos+sBW, yPos+sBW, rS-sBW, (rS/2)-sBW);
choosen2x1 = int(fxrand() * numberOf2x1);
image(p2x1[choosen2x1], xPos+sBW,(yPos+(rS/2))+sBW, rS-sBW, (rS/2)-sBW);
choosen2x2 = int(fxrand() * numberOf2x2);
image(p2x2[choosen2x2], xPos+sBW, yPos+sBW, rS-sBW, rS-sBW);
choosenS = int(fxrand() * numberOfS);
image(s[choosenS], xPos+sBW, yPos+sBW, rS-sBW, rS-sBW);
image(title, xPos+sBW, yPos+sBW, rS-sBW, rS-sBW);
imgGrain = createImage(width, height);
for (let i = 0; i < dens * (width * height); i += dens) {
grc = color(random(255));
imgGrain.pixels[i] = red(grc);
imgGrain.pixels[i + 1] = green(grc);
imgGrain.pixels[i + 2] = blue(grc);
imgGrain.pixels[i + 3] = alpha(grc);
image(imgGrain, 0, 0, width, height);
if (key == 's' || key == 'S') save("comic"+int(random(0,1000))+".png");
function get_random(min, max) {
return min + fxrand() * (max - min);
for (var i = 0; i < numberOf2x2; i++) {
p2x2[i] = loadImage("2x2-" + i + ".png");
for (var i = 0; i < numberOf2x1; i++) {
p2x1[i] = loadImage("2x1-" + i + ".jpg");
for (var i = 0; i < numberOf1x2; i++) {
p1x2[i] = loadImage("1x2-" + i + ".jpg");
for (var i = 0; i < numberOfS; i++) {
s[i] = loadImage("s" + i + ".png");
title = loadImage("title.png");