Hi awesome Community,
I am successfully using the bitmap component (Gh/Firefly, they are very similar) to reproduce images on arrays of surfaces YaY
I am then using a 'straight line distance' algorithm to reduce the color range of these surfaces to just a bunch of final colors (I'm manually picking a few target colors based on custom palettes, like 15-20 colors in total)
What I am trying to implement now is a kind of dithering-algorithm to spread the color-error of a single surface (that I consider equal to the straight-line-distance measured in the above step) to its neighbors
Hopefully this step should avoid the production of huge flat island of exactly the same color on the final surface, where original shades on the starting images have very very close values
As I'm really not a coding expert, the best solution I could guess was to use the Floyd Steinberg error-spreading algorithm, or other more complex ones as described here:
http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_stein...
This method requires the use of loop cycles (like Anemone) to iterate calculations pixel-by-pixel from top left to bottom right, with an error diffusion that will be computed and distributed only to not-yet-calculated pixels of the final image
By using this method, the time required for a single iteration-loop will always be about the same, but the processing time will increase the higher the number of pixel to process on the original image is (and this factor could be dramatic)
Looking for a solution that takes advantage of the in-parallel Grasshopper calculation potential, I thought I could use no loop cycles at all, and spread a Nth fraction of the straight-line-distance error of every given pixel to all its surrounding neighbors (not just the subsequent ones like the above system) then reiterate the color matching process (and evaluate the quality of the results by quantifying the number of pixels that have changed their color because of this last step)
Eventually, this whole operation could be repeated several times until the desired effect is reached
has anyone in this Community had to deal with this before, or have some awesome idea on how to better dither an image with a reduced color palette?
I've been digging in the forum posts for quite some time, but did not find any magic hint for that
Thanks for reading!!