zirc

Online Scruffy Bunny

Programmer, Artist, Rabbit
in their early 20s

 


 

📢 Don't wanna see shares?
Follow @zircus for less noise!


Jeran
@Jeran

Here's an old script I wrote, and some results.

The idea here is that you take an input image, and you load all of the pixels into a big ol list. Then, you place a number of random seed pixels. The algorithm then will kind of wander thought he list looking for close matches in color to any pixel with an open space around it. If it cant find a close enough match, it loosens its requirements.

This is a naïve way of pixel sorting, because it leaves some gaps at the end where non matching pixels will inevitably be shoved, but still, it works nicely!

One of the fun things to do with this script is participate in the ALLRGB challenge.

For that, you simply load a list of all the colors you want to use instead of an input image, and then go to town.

this one makes the randomly placed leftovers a little more obvious

If you apply it to impressionist paintings, you get equally impressionist results! Claude Monet’s Poppies, Near Argenteuil.

And can also do great work with 2 color linear gradients.

There's only one problem with the code.... I can't find it! ¯_(ツ)_/¯ can't share it until i find it. but I can assure you, that it's not fun to look at code.


@zirc shared with:

You must log in to comment.

in reply to @Jeran's post:

i wrote a program (the culmination of a series of such programs in progressively faster languages) with very fast mutable k-d tree implementation for doing exactly this kind of thing, also spawned by my frustration with someone's terrible implementation in the ALLRGB challenge.

i've been meaning to attack it again to implement it with some of these variations, including some that don't just shuffle all the pixels from the original but actually also unpick them in reverse by the same method to generate the color placement order.

Cool! I was doing something similar around 15 years ago, and eventually just sorted pairs of neighboring pixels according to their "closeness" in terms of color, and connected them into "blobs" from closest pair to furthest - to avoid having to place seeds.