I want to fill an area of a bitmap object. Area will be selected by user, so it can be anything, rectangle, circle or whatever will be its shape that area will be filled by color of its base. Eg. you want to remove text from an image, you have selected that area and only text will be removed from that image and filled color must match with images background color. Dont wish to fill with a solid color, it can be gradient also. **Bitmap only takes rectangular area, how can I take an area(any shape) and fill it with its base color…? How to detect base color(can different for same area) for an area?**Any help is appreciated.
Assuming your text is monochrome, you can use threshhold() with a second bitmapData object to create a mask.
Filling in the color based on the background color requires interpolation of the surrounding pixels. The difficulty is determining which axis to base the interpolation on. Depending upon your text’s thickness, you may be able to use a recursive pixel shift in the four base directions, though with a complex image, that would give some shall we say intereseting results.