Combine 2 images and highlight the most similar areas

brainleak

Well-known member
Joined
Dec 20, 2016
Messages
54
Location
Barcelona area
Programming Experience
3-5
My application draws a rectangle filled with a black brush with a certain degree of transparency on top of a background image. The rectangle is clearly visible except if the background consists of a large gray area, in which case it becomes difficult to distingish.


The way to manually overcome this would be easy enough allowing the user to select on the fly a different (lighter) fill colour, but I was wondering if this could be somehow automated by means of some sort of (bitwise?) operation combining the rectangle and the image below.
 
Couldn't you add a border to the rectangle? The combination of the transparent gray area with a more distinctly colored border will often make it easier to see, even if background has both colors they are not in the same place so the user will see the rectangle either by the interior or the exterior, and usually both too. Although not exactly the same the attached image here show the idea:
outline example.png
 
It has a (white) border already. Still I recently had to deal with a background with dark and light areas such that the colour under the border was difficult to distinguish.
I am considering make the rectangle colour the negative of the background but I'm not sure if that's the best option.
 
Back
Top