Write a program in your language of choice that does the following:
- load an image (source image) - get a list of all the colors in the source image - create 2 blank images, (image1 and image2) - draw a random polygon or circle on image1 using a random color from source image - compare image1 to the source image - if it's more like the source image than image2 copy image1 to image2, if not copy image2 to image1 and continue drawing more random shapes and comparing -post the results
import stupid_ass_anons_chellange as nigger nigger.run()
Brody Cruz
define "compare"
Luke Reyes
- you must use ed as your editor
Jeremiah Price
>if it's more like the source image than image2 copy image1 to image2, if not copy image2 to image1 and continue drawing more random shapes and comparing
What?
Lucas Powell
double buffering to maintain a temp last good copy it sounds like
Gavin Rogers
no
Blake Cooper
no
Thomas Gonzalez
Is that bailey jay?
Connor Sanchez
Ok so you have two copies of the same image now. What do you do next?
Caleb Davis
>do my homework for me Sup Forums
fixed that for you. Also No
Colton Barnes
Can someone please explain how you compare the source to the temp image? Conceptually, what does that mean?
Grayson Bailey
loop through all pixels and compare colors
Samuel Flores
It is to check if your random changes to image1 is closer to image2 or the source image. If it is closer to the source image, it means you made a random change which is "good". If it is close to image2, it means you made a "bad" change. Because the whole idea is to "mimic" the source image with a polygon.
Kevin Lee
That sounds slow as hell
Jack Torres
How it implement it?
Like Said. You can loop and compare pixels.
There are probably better methods
Nathaniel Wilson
is there another way?
Jordan Anderson
so do every other pixel, ever 3rd pixel, etc
Hunter Jackson
Maybe something like the amount of pixels that are within an arbitrary distance from the color values of the source image's pixel at the same location.
Blake Butler
Compare pixels (or averaged values) covered by the new shapes only. like post process antialiasing
Jonathan Foster
Instead of every one, just average the colors of a 4x4 or 8x8 pixel grid and compare those instead. Then once it's an exact match make the polygons smaller, and the grids half as large.
Ayden Roberts
The thing is. If you add a circle with r=10. to a random location on image1. So that will be around 100 pixels in size. I think you could get away with only comparing the same 100 pixels in your source image and image2? So you do not need to compare the whole image every time. only the few pixels you changed on image1
Nathaniel Edwards
That virgin killer sweater?
Adam Myers
yes
Caleb Baker
Guys I think you needn't compare pixel by pixel. The whole idea of comparing the images is finding the average color of the newly drawn area on srcImg. The "closer" image is the one whose shape color is closer to the color average it covers.
Leo Hall
>color average it covers. *color average of the area it respectively covers on srcImg
Nathan Reed
what?
Noah Young
ill let it run for a bit, but wouldnt it be better just to take an average over a specified region or some shit? seems unneccessary to actually randomize position and color from the reference image
Brody Rivera
>tfw hyper-intelligent artist now
Michael Hill
retard me didnt read the entire instructions
Liam Brooks
Looks cool. Do another one.
Zachary Diaz
can you post the original?
Hudson Wood
ok its too lewd, sorry
Wyatt Phillips
i thought she was nagato
Henry Williams
/* src = source image temp = temporal image with random figure added result = approximated result image w = weight function */ int w= 0; for(int i=0 ; i < width*height ; ++i) w+= src[i]==temp[i]?1:-1; if(w>w_result) { copy(temp,result); w_result=w; }
Cameron Sanchez
What language did you use?
Juan Murphy
heres the original pic my.mixtape.moe/qcccfz.png C++ with opencv, heres the code ghostbin.com/paste/kuay8 for some reason it doesnt do the bottom of the image, probably mixed up rows and cols somewhere
Cooper Jones
Wow. Thank you. I didn't even have to ask :-)
Isaac Harris
Fuck off with your homework
Xavier Morris
...
Daniel Wood
What's better: dots or pies?
Jose Rogers
Oops
Mason Morales
loser detected. why are you on this board if you cannot read or understand anything at all?
Ryan Flores
cute i think pies is better
Hunter Moore
I want to **** 2B
Michael Reyes
not really its just h x w calculations. so for a 1920 x 1080 image 2.07 million calculations.
Jeremiah Morris
i calculate euclidean distance for a square covering the newly filled circle hamming distance should work too
better just to compare the newly filled region, instead of 2.07 million calculations you get 400 if you have a radius of 10, ideally around 314 if you only look at the circle
Jose Peterson
im sure you can do it in few matrix multiplications by using matlab or some sci library for python
Wyatt Fisher
I am not this far in learning C yet :(
Jason Ramirez
solved why it didnt worked for the lower part of the image opencv devs are retards, cv::Point is trash for reverse order of rows and cols
for(;;){ int randr = rand() % img.rows; int randc = rand() % img.cols;
oh right now i get it you can speed up the comparison if you decrease your search area to a rectangle in which the line makes up the diagonal probably theres a even better way though but i cant think one up right now
Hudson Price
Oh yeah, changing that now.
Also I think the image package is keeping the source jpeg in the YCbCr color space in memory, so it gets converted every time RGBA() gets called. That's another bottleneck.
Ian Campbell
dont bother with jpeg, make it only work with png
Mason Ross
bow to me, faghots
Ryan Rogers
lines are trash manhattan distance top euclidean distance bottom
Jayden Lewis
Lines are trash. Even after 4200000 iterations you get spooky hollow eyes.
I just sped it up a billion times by only diffing along the line drawn, in parallel of course.
Adam Rogers
text isnt that much better a bit maybe rectangles wasnt that interesting either
Evan Butler
don't try to recreate the image perfectly, just generate something that looks cool
Nathan Lopez
Could we train a software on this way to return the process of abstraction. A software based on machine learning which would complete unclear pictures.
Samuel Thomas
maybe
Luke Morales
I think that's already how it works.
Nathaniel Hernandez
...
Camden Stewart
What would happen if you would source two different pictures, for example two different heads with the same size? I wanna see a merged face!
Grayson Lee
That looks amazing!
Chase Hill
Would you post the code? I love it!
Colton Lopez
>pies vs dots >not swastikas baka
Lucas Adams
You should extend the process to include blurring or some other type of finishing flourish. What you have made here is pretty fantastic.
Henry Price
looks really nice, post code please
Bentley Moore
this shit reminds me of that PS plugin called fractalius
Also what's the easiest way to load an image into an array using C? I wrote something a while ago to create voronoi diagrams with random points but I'd like to use pics as a starting point.
Evan Watson
...
Nicholas James
What shit lang is this with the mantis shrimp eyes := syntax. Fuck this.
Looks like golang. := is the implicit assignment operator so you don't have to waste extra characters specifying the type of the variable.
string op = "faggot"
// identical to
op := "faggot"
Ryan Green
yes also they start very large and get smaller over time.
for example, random between 1024,512px for about 50 iterations then get smaller and smaller to 4,8px
Carter Reyes
You mean, when using :=, it *assumes* what the type is by looking at the rvalue?
Zachary Rodriguez
Go is strongly typed, so these assumptions are 100% correct. You try to do something incorrect with the return value (like shove it into a function that expects a string) and your program won't compile.
Jeremiah Howard
"a := b" is a short way of saying "var a = b", and "a := 0" is a short way of saying "var a "
It's a not-very-useful readability enhancement taken from Go's predecessor where variables were declared and assigned like this: "a: int = 0". Notice the colon.
Yes, e.g. with "shit := image.Point{123, 456}", the compiler knows the type of "shit" has to be an image.Point struct.
Adam Brown
It's very useful because requiring the programmer to tell the computer things the computer already knows (and makes available by way of the AST and tooling) is a waste of time.
Eli Russell
I see.
Joshua Jackson
I suppose it is less to edit.
Jackson Bell
And less to screw up. Small things like that can really add up when your language is going to be used in projects of all sizes by God-only-knows how many people.
Andrew Moore
See I would do this but I already know you did it in python whereas I'd be doing it in C and nobody would appreciate it because everybody is a python 'programmer'
Luke Morris
>if it's more like the source image "more like" in what sense?
Hunter Jones
I often get frustrated by the strictness of the Go compiler, but that strictness has probably saved me a lot of hours by making some common bugs impossible unless you deliberately put them there.
Perceptually closer. You should be able to solve this.
Blake Nelson
>Perceptually closer.
That doesn't mean anything. What does "perceptually closer" mean to a computer?
Jackson Morgan
this but not as a challenge you should always use ed its hte best editor
Aaron Garcia
>I often get frustrated by the strictness of the Go compiler, but that strictness has probably saved me a lot of hours by making some common bugs impossible unless you deliberately put them there. How does it compare to the strictness of C? >Perceptually closer. ... E.g., closer in RGB values of every pixel at a given (x, y) position. Or less granular averages or whatever for speed prawbz.
Dylan Carter
I'd give my left testicle if Go would just friggin' support generics already. Right now, it's basically Java with all its bureaucracy with sightly better tooling and less XML.
The constant need of boilerplate and the "if err :=" pattern drives me batty.