Nickon
Nickon

Reputation: 10156

Replace black areas with white color

I'm looking for a fast algorithm which will replace black areas with a white color. I have a set of images (some examples below).

As you can see the images can contain elements of black color (e.g. text, borders - maps) - so I can't just simply replace the colors... You can notice that the black areas always start from the border of an image. How to get rid of them?

Thanks in advance for any help!

Upvotes: 0

Views: 348

Answers (1)

maniek
maniek

Reputation: 7307

Flood fill the black area, starting from the borders. Paint areas larger than a threshold white.

Upvotes: 3

Related Questions