Page 1 of 1

How to search for a defined color?

Posted: Tue May 21, 2024 9:59 am
by Peter2
In my CAD-drawings, I have a lots of areas (example: land properties) which should be drawn without gaps between its borders. Of course sometimes there are mistakes - very small gaps between the areas. In CAD it is not easy to find them, so I would like to create a plot (an image file) where all areas are coloured, but the gaps stay uncoloured (white).

Now I would like to open it in XnView and start a command:
"Search the next pixel which is white"

Is it possible right now? Or are there other solutions or workarounds?

Regards
Peter

Re: How to search for a defined color?

Posted: Tue May 21, 2024 11:55 am
by michel038
Here's how I'd do it, using a graphics editor (like photofiltre6, which is easy to use)

Assume the gaps are 1 pix and white, the same color as the map background. (And the picture is clean, png instead of jpg ?)

1) Using the "paint pot" tool, fill an area, say red.
If it overflows into the neighboring area, there's a gap : undo.
Try filling the other areas...
You'll be left with a few pairs of untreated areas where you'll have to look for the gap and correct it with a thin pencil. (zoom up to 200x)
At the end, "replace a color", red, with the original background color.

2) If there are too many gaps, proceed in the opposite direction, filling in the communicating areas in blue. Only the correctly closed areas will remain in white. (less "undo" to do)

Translated with DeepL.com (free version)

Re: How to search for a defined color?

Posted: Thu Aug 22, 2024 7:16 pm
by Peter2
Hi michel038

sorry for my late reply.

As mentioned, I have big images with a lot of areas - small ones and big ones, and there is no way to do this manually. I was looking for a kind of "searching / database function": start the command with "search for color ff0080" - and it checks every pixel for this color.

But at the moment this task was solved in another way, and I will see if I have to come back to this topic.