# Using threshold() to change colours in a bitmap

**URL:** <https://forum.kirupa.com/t/using-threshold-to-change-colours-in-a-bitmap/315667>\
**Category:** flash\
**Created:** [November 1, 2010, 12:33pm UTC](https://forum.kirupa.com/t/using-threshold-to-change-colours-in-a-bitmap/315667 "2010-11-01T12:33:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aniac](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@aniac](https://forum.kirupa.com/u/aniac)\
**Post date:** [November 1, 2010, 12:33pm UTC](https://forum.kirupa.com/t/using-threshold-to-change-colours-in-a-bitmap/315667/1 "2010-11-01T12:33:15Z")

</div>

Hi guys,

I’m trying to use threshold to change the colours in a bitmap image according to a lookup table. I’ve tried the following line of code to convert each colour to another, but without any luck:

```auto
bmd.threshold(bmd, bmd.rect, new Point(), "==", originalColour, newColour);

```

Can someone please tell me if this is possible? I have not had much luck so far, I’ve only managed to generate a black and white image, or nothing at all.

Any advice greatly appreciated!

Thanks

Anton
