pixelogik / ColorCube

Dominant color extraction for iOS, macOS and Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestions for perf improvement on small images?

dxclancy opened this issue · comments

Hi, I was just wondering if there was something relatively simple I could do to increase performance when using small images as input.

I'm not saying that ColorCube isn't performant. But i am calling it many times, and was just wondering if perhaps for small images there is something obvious. Like "oh, you really don't need to do x passes, or this data structure could be smaller, or if your images are that small just do it yourself like this"

Essentially, I am almost exclusively working with 10x10 images and looking for only the first dominant color.

thanks!!

commented

Hi, image size is the main factor when it comes to speed. So you are doing that right :)

You should make sure that you create the color cube instance once, and reuse that. This way data structures do not get re-allocated. So do this only once:

CCColorCube *colorCube = [[CCColorCube alloc] init];

Otherwise there is not much you could do about it. It does not really make a different if you are looking for only the first dominant color or more. In both cases the whole image must be processed in the same way.

commented

Does that help?

Not really :) but I appreciate the answer!! Thanks!