FAST color counting of a pixmap.

BlitzMax Forums/BlitzMax Beginners Area/FAST color counting of a pixmap.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yeah, calls to lists or maps is an organized way of checking previously found colors, but extremely non-optimistic in terms of speed.

With the array, you only check once if a color has been met. With tlist/maps your checking EVERY single pixel whether a color has been added or not.
With an array, you can even count how many times a color was found, with no real loss in speed (talking 5-10%, maybe).

My method (derived from burnsides pixel ptr method of getting r,g,b values) could probobly still be optimized some. I would assume this is the idea that programs like paintshop pro & adobe use for counting colors.