this is in excel btw. and this image is exactly half green and half pink. and for each shade of green there is an equal number of "opposite" pink pixels. and this represents a major leap forward in excel macro use by me
the origin of this concept was, oh, what if you were trying to recreate an image as a tapestry? and you had, say, 24 colors of yarn? and you wanted the image to have equal amounts of each color of yarn? how would you effectively use the yarn you had to create the image? you'd have to look at all the colors of the original image, then look at your yarn colors, and find some consistent method for choosing what original colors are replaced with what yarn colors. but then it turns out there's a lot of different rules you could imagine or follow, which produce different-looking images. and you can end up with something like this:
which is cool. and it would be cool to say, find a granny square cardigan pattern with 24 squares, knit these squares, make a sick cardigan. but then i realized i don't know how to knit or anything. and once you accept that there isn't really a clear "application" and this concept lives on a screen, you open yourself up to more possibilities. a la birth of venus.
step 1: python script that looks at the original image and generates an excel spreadsheet the same dimensions (793 x 1322 pixels = 793 x 1322 cells), and each cell is populated with the hex code of the color that appears in that pixel of the original image
step 2: excel macro to generate list of every unique hex code that appears in the excel spreadsheet.
step 3: excel macro to calculate the R, G, B values of each of those hex codes.
step 4: excel macro to fill each cell with the color of that hex code (not necessary, i just like to do it).
step 5: I add in Saturation (the difference between the largest and smallest RGB value) and Lightness (average of all RGB values).
step 6: pick a color palette. i always find myself gravitating towards groovy seventies palettes with warm reds and oranges, so i decided not to do that this time. i looked on coolors and found a color palette that was all dark greens that were similar to each other. there were only like four colors or something in this palette. and to make it truly different from the other project, there should be a small gradient. so i determined the smallest possible change between colors and used an excel macro to color it. i was going to stop here and do the entire image in shades of green (inspired by that guy on tiktok that paints using only one color) but then. idk. i realized the "opposite" of each color was an equally subtly changing pink. so i imagined that the end of this process would be an "abstract" image, with subtle variations of pink and green, that would end up suggesting birth of venus.
so all told, i had 502 unique replacement colors, 251 of which are green, 251 of which are pink. (793 x 1322) / 502 = either 2088 or 2089 of each color.
step 7: find some method for finding the difference between the original colors of the image and my new color palette. I use a method of comparing, R, G, B, S and L:
((abs(R1 - R2) + abs(G1 - G2) + abs(B1 - B2)) / 3) + abs(S1 - S2) + abs(L1 - L2)
and you come up with something like this. on the left, those are colors that appear in the original image. across the top, those greens are the colors i'm replacing it with. in blue, that's the number of each new color i have to work with (it's just blue for contrast). and in the center, this pink area, that's a giant spreadsheet with the "objective" difference between each original color and each replacement color. it's pink because i have some conditional formatting applied, ignore that part.
and in this situation, you have some choices to make. in the original image up there, i used a schema prioritizing light and dark--i.e., i looked at the darkest color (pure black) that appeared in the original image, then found the closest replacement color (i.e., the replacement color with the smallest number). then did the same with the lightest color. then the next darkest, next lightest.
but i'm going to do it slightly differently this time. and i don't know how this image will come out looking.
if you look at the "first" green, closest to the left, and sort by smallest to largest:
you can see that these colors on the left are closest to the "first" green i've decided to work with. that might seem odd. i mean, #7F9800--> #00a94f are pretty close, but #A95400 is red. but that's just a difference in hue. really, #A95400 and #00a94f are very similar in lightness and saturation.
and this also calculates the number of times that color actually appears in the original image. that first specific green, #7F9800, only appears twice. but some colors, like actual black #000000, appear something like 46,000 times. and if you add all the numbers in the "frequency" column, it should exactly equal the sum of each replacement color (2088 ish x 502).
step 8: excel macro again. this one is complicated. basically it sorts that first "green" column (column E in my spreadsheet) from smallest to largest. then it adds each cell in the "frequency" column until it reaches or surpasses the blue cell above column E, which for this particular color is 2089. it copies those "original image" colors and their respective frequencies over to another sheet. for the color that surpassed 2089, it splits in two. then it deletes that column E. Then it makes sure "frequency" and "replacement color sum" still total. then it runs again on the new column E, until the whole spreadsheet is used up. and it generates something like:
[color from original image] [number of times that color appears] [replacement color, filled in]
and there's approximately 8000 lines of that.
i have the replacement colors in the order above. starting with vivid green, slowing transitioning to dark green, switching abruptly to bright pink, slowly transitioning to pale pink.
step 9: another excel macro. this one looks at original image broken down into hex codes, then looks at the generated list and replaces each [original] color with the replacement color, that exact number of times.
end result of these macros, following different "rules" of assigning replacement colors to original colors, is this:
which looks different, obviously. but it is the exact replacement colors, and same number of each replacement color, as the original up there.
at maximum efficiency, it took about 20 minutes to complete step 8 and 9. i have a vision of creating a series of these, each time "starting" with the next replacement color, and then making a gif of it. idk how to make gifs though
@magnetictapedatastorage seems up your alley
































