| ▲ | jaen 2 hours ago | ||||||||||||||||
I really wish people would read the article, the library does exactly this: > Okmain downsamples the image by a power of two until the total number of pixels is below 250,000. | |||||||||||||||||
| ▲ | iamcalledrob an hour ago | parent | next [-] | ||||||||||||||||
Somehow I missed that, oops. I see that the library samples a maximum of 250K pixels from the input buffer (I jumped over to the project readme) That being said, this is sampling the fixed-size input buffer for the purposes of determining the right colour. You still have to load the bitmap into memory, with all the associated footguns that arise there. The library just isn't making it worse :) I suppose you could memmap it. Makes me wonder if the sub-sampling is actually a bit of a red herring, as ideally you'd want to be operating on a small input buffer anyway. Or some sort of interface on top of the raw pixel data, so you can load what's needed on-demand. | |||||||||||||||||
| ▲ | vasco an hour ago | parent | prev [-] | ||||||||||||||||
That's 500x500, I'm sure you can get good results at 32x32 or 64x64 but then part of your color choice is also getting done by the downsampling algorithm. I wonder if you could get away with just using a downsampling algorithm into a 1x1 and just use that as the main color. | |||||||||||||||||
| |||||||||||||||||