How does the algorithm work? #130
Replies: 1 comment 1 reply
-
We are actually using three different kind of modulable algorithm: quantize, pixel by pixel, avg area. The pixel by pixel is again using the color difference, but it taking half life to convert an image. The last one is the one that we like the most: it analyze an area of pixels (determineted from the input) and compare it to the previous one, making an average and taking the nearest color of the new palette. It's making this evalutation each time the "matrix of the avg" is moving towards the image. It is not optimized, as you can see but the results are quite good, on our opinion (without taking in consideration of the time) |
Beta Was this translation helpful? Give feedback.
-
I think it would be great to have some documentation on the pros and cons of the current conversion algorithm. From the Python package, it seems like
Image.quantize()
method from PIL is where the actual conversion is happening, though I could be wrong. Is there any benefit to this method over the naive (Euclidian) technique in this article?I implemented a version of this in C++ with opencv and it seems like it might be faster, though I only did a few tests against the ImageGoNord website. My method is extremely basic, with essentially 0 optimizations. Opencv does use parallel CPU operations so it's still pretty fast.
I would love to hear some thoughts on possible improvements to the algorithm!
Beta Was this translation helpful? Give feedback.
All reactions