# BitmapData.histogram() explanation?

**URL:** https://forum.kirupa.com/t/bitmapdata-histogram-explanation/314766
**Category:** flash
**Created:** [October 8, 2010, 12:17am UTC](https://forum.kirupa.com/t/bitmapdata-histogram-explanation/314766 "2010-10-08T00:17:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)
#### Post date: [October 8, 2010, 12:17am UTC](https://forum.kirupa.com/t/bitmapdata-histogram-explanation/314766/1 "2010-10-08T00:17:59Z")

</div>

I’ve found some very useful ways to use BitmapData.histogram() however, I’m hoping someone can explain something proper terms/explanation for me.

Let’s assume I have a 100x100 GIF in Flash, it only contains Green (#00FF00) pixels and transparent pixels.

When I trace myBitmapdata.histogram()[0][0] - I’m tracing the first index of the 255 item Vector for the Red Channel. Since there isn’t any Red within my BitmapData - that first index reads 10,000.

How can I explain that? Would it be correct to say:  
“There are 10,000 pixels in this bitmap, and not one of them contains Red, hence it’s returning 10,000?”

Here is a quick sample of what I’m trying to explain: [http://lextalkington.com/ComparingImages.swf](http://lextalkington.com/ComparingImages.swf)

Hopefully this makes sense to someone, appreciate the help.
