# Detecting percentage of BitmapData that is transparent

**URL:** https://forum.kirupa.com/t/detecting-percentage-of-bitmapdata-that-is-transparent/322856
**Category:** flash
**Created:** [June 6, 2011, 12:12pm UTC](https://forum.kirupa.com/t/detecting-percentage-of-bitmapdata-that-is-transparent/322856 "2011-06-06T12:12:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)
#### Post date: [June 6, 2011, 12:12pm UTC](https://forum.kirupa.com/t/detecting-percentage-of-bitmapdata-that-is-transparent/322856/1 "2011-06-06T12:12:01Z")

</div>

Say you have an image like this:  
 ![](http://iqandreas.isbetterthanyou.org/public/kirupa.com/images/circle-filled-image.png)

Is there any way of checking what percentage of the BitmapData is filled, and what percentage is transparent?

You could easily brute-force it by looping through each pixel and counting which ones are empty, but does anyone have a more elegant solution?
