Spu7Nix made a video on putting images/videos into geometry dash with this same algorithm, and after watching it i immediately sole his idea because everything that can be made in javascript eventually will be.
The principle behind it is using a small amount of shapes to represent an image as opposed to a bitmap.
For the sake of the school computer I quickly coded this on, it doesn't generate as many shapes as it could. The process is as follows:
- Make a lot of random shapes. The traits that can be changed are size and rotation
- These shapes are ranked based on how "good" they are (which is how much they contribute to the color difference between images)
- The top 10 or so survive and get to have children, who have slight variations in their traits
- We do this a few times. sort everyone, make children, etc
- Then the winner is picked, which is the shape with the highest score out of all of the others.
- Now we have a single shape on the screen.
Warning: This thing is s l o w. Like 40 sec on average PER SHAPE for a full screen render. If you wanna use this dumpsterfire, use small images.
(this one took a whole 40 minutes to render!! sped up by 256x) also casually linking my sromg comics lol
and here we see the majestic garfield phone. no idea how long it took