Swap specific color in image

This is going to be my official page for progress of this project. the goal is not for making the code as short as possible mainly because usually the smaller you make it the longer it takes. Feel free to help out and give your incites.

What do you use this for?


im gonna simplify the image to the base colors then swapping after that should be easy

complex simplification script pic (1)

I would prefer to not have a loop in this if anyone knows how. i would also like to calculate this as fast as possible so it can done a couple thousand times

I have a pixel library that you can look at: Snap! Build Your Own Blocks

lol. im tring to make that but 10x better

How exactly 10x better?

youll see when its done

I need some context. What are the inputs and outputs of this piece of code?

list of accepted colors. and the color of a pixel. in that list we want to return the closest color. i already have a block that returns the distance

complex simplification script pic (3)

complex simplification script pic (4)

complex simplification script pic (5)

Screenshot 2024-04-14 11.30.40 AM
original costume for ref

Oh! Getting there! I dunno about the dotted border, though. And I don't understand how you pick the base colors. Where'd the (190 190 190 255) come from? I was imagining that if this pixel is within some fixed distance of the clicked color, you'd replace it. Maybe have a slider to choose the fixed distance, the way Photoshop does.

I made a gradient version of Alonzo so I could show you what I mean:

Photoshop does fancy stuff with the alpha channel so that points near the edge of the selected region can be half in half out of the region, so it gets a gradient of blue when I fill it, but don't do that; just notice how when I slide the slider it selects more or fewer points, depending on closeness in color to the one I selected (up in Alonzo's lambda hairdo).

i mean again. Yes its possible i can try to make it so its comparing to a selected color. right now the base colors are all the colors in the current image. then what it does it simplifies the image to get rid of the gradients then it replaces the color