Challenge: You will have 3 functions: getRed(i, j) getGreen(i, j) getBlue(i, j) Where i and j are the xy coordinate where the pixel color will be. Your goal is to write the code of the 3 functions that will return a number which represent the amount of the given color present in the pixel. You can also change the size of the image.
Here is the html file where all you need is in there: pastebin.com /LhxUSFuX
Pic related: red: return (i + j) & j; green: return (255 + i - j) & i; blue: return (i + j) & (255 + i - j);
Show me your best
Attached: art.png (500x500, 44K)
March 14, 2018 - 00:51
Another example: Red: return Math.cos(i * 28 / j) * 255;
Green: return Math.cos(i * 28 / j - 14) * 255;
Blue: return Math.cos(i * 28 / j - 28) * 255;
Attached: rainbow.png (600x600, 345K)
March 14, 2018 - 00:55
A really simple one: Red: return i;
Green: return j;
Blue: return 255;
Attached: simple.png (256x256, 2K)
March 14, 2018 - 00:59
Fractal !
getRed: function(i, j) { var a=0,b=0,d,n=0; for(;a*a+(d=b*b)
Attached: fractal.png (1200x1200, 930K)
March 14, 2018 - 01:06
Red: return i * j Green: return Math.sin(i * j) * 255; Blue: return Math.cos(i * j) * 255;
Attached: random.png (256x256, 156K)
March 14, 2018 - 01:12
red: return i * i * j; green: return i * i * j; blue: return i * i * j * j;
Attached: pixel.png (256x256, 74K)
March 14, 2018 - 01:34
I dont get it. Do you want someone to do your homework for you...?
March 14, 2018 - 01:38
Just want to see the Veeky Forums creativity
March 14, 2018 - 01:42
Red: return (i+j)/3; Green: return (i+2*j)/3; Blue: return (2*i+j)/3;
Attached: colorful.png (1024x1024, 49K)
March 14, 2018 - 02:10
So, fragment shaders? Why not just make it in shadertoy? For example: shadertoy_com/view/4sVcR1
March 14, 2018 - 02:25
Attached: download.png (256x256, 12K)
March 14, 2018 - 02:36
Math.sqrt(i*j); Math.log(i*j); Math.sqrt(i*j)*4;
Attached: rows.png (1024x1024, 336K)
March 14, 2018 - 02:48
I don't understand what you're asking
Attached: d27[1].png (645x729, 75K)
March 14, 2018 - 03:03
(j - i) * j; (j+i);
var a; for(i = 0; i < 255; i++){ a = (i * Math.random()) + j; } return a;
Attached: image.png (701x701, 1.25M)
March 14, 2018 - 03:40
sin, cos, and lots of modulus
Attached: dots.png (1024x1024, 62K)
March 14, 2018 - 05:23
where am i supposed to enter this type of data, what even mathematics is this using
March 14, 2018 - 11:17
get the html file on the pastebin link from the OP, then write the content of the three functions in a way that makes a cool picture
March 14, 2018 - 11:53
>get the html file on the pastebin link from the OP And do what with it, make a website?
March 15, 2018 - 00:32
run it in any browser
Attached: download (1).png (1024x1024, 411K)
March 15, 2018 - 01:33
return (Math.pow(i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(20, 2));
return (Math.pow(i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(10, 2));
return (Math.pow(i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(50, 2));
Attached: circle.png (1024x1024, 36K)
March 15, 2018 - 04:20
return (Math.pow(i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(20, 2)) / 100;
return (Math.pow(i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(40, 2)) / 100;
return (Math.pow(Math.sin(i) * i - this.size / 2, 2) + Math.pow(j - this.size / 2, 2) - Math.pow(60, 2)) / 100;
Attached: circ.png (1024x1024, 753K)
March 15, 2018 - 23:19
var def = { versace: 10000.0, size: 512, fuck: function(i, j) { return Math.sin((i * j) / this.versace) * 255; }, getRed: function(i, j) { return Math.max(this.fuck(i, i), this.fuck(j, j)); },
getGreen: function(i, j) { return Math.max(this.fuck(i, i/3.0), this.fuck(j, j/3.0)); },
getBlue: function(i, j) { return Math.max(this.fuck(i/2.0, i), this.fuck(j/2.0, j)); }, }
Attached: download.png (512x512, 40K)
March 15, 2018 - 23:47
var def = { size: 512, getRed: function(i, j) { return (j + i) * ((j + i) % 3) * 255/ 1024 * 2; },
getGreen: function(i, j) { return 2.0 * this.getRed(i, j); },
getBlue: function(i, j) { return 4.0 * this.getRed(i, j); }, }
Attached: download.png (512x512, 56K)
March 16, 2018 - 00:11
red: return (Math.abs(Math.pow(i % 178 - 55, 2) + Math.pow(j % 178 - 55, 2) - Math.pow(50, 2)) < Math.pow(24, 2)) ? 255 : ((this.size - i - j) / this.size * 200 | (i - j) / this.size * 200) + ((this.size - i - this.size + j) / this.size * 200 | (i - this.size + j) / this.size * 200);
green: return (Math.abs(Math.pow(i % 178 - 55, 4) + Math.pow(j % 178 - 55, 4) - Math.pow(25, 4)) < Math.pow(20, 4)) ? 255 : ((this.size - i - this.size + j) / this.size * 200 | (this.size - i - j) / this.size * 200)
blue: return (Math.abs(Math.pow(i % 178 - 144, 2) + Math.pow(j % 178 - 144, 2) - Math.pow(30, 2)) < Math.pow(15, 2)) ? 255 : ((i - this.size + j) / this.size * 200 | (i - j) / this.size * 200);
Attached: circles.png (1000x1000, 300K)
March 16, 2018 - 00:18
need to try some bitwise functions now
Attached: result.png (511x511, 462K)
March 16, 2018 - 03:29
I some alphamasks ages ago
Attached: alphamask (59).png (1024x1024, 910K)
March 16, 2018 - 03:34
Attached: download.png (512x512, 46K)
March 16, 2018 - 03:45
Attached: download (1).png (1024x1024, 246K)
March 16, 2018 - 03:50
Attached: download (2).png (1024x1024, 137K)
March 16, 2018 - 03:57
This is a good thread. Thanks, OP
Tried to see what would happen if I just threw functions at the wall... Pretty pleased with the results.
Attached: Screen Shot 2018-03-16 at 2.52.19 PM.png (1592x1578, 3.6M)
March 16, 2018 - 07:52