1

I develop an app which draw a bounding box in pictures of cats. I wonder which color is the fittest for that purpose.

2

Instead of using a single colour for the border of the bounding box, you could invert the colour underneath the border of the bounding box.

This way you can ensure that there is strong contrast between the bounding box and the surrounding image.


Also as noted by Nathan in the comments:

Note that inversion alone fails miserably for midtones, which change very little (or not at all). This is a perennial problem with tools that use this method. If you go with inversion, you should also attempt to amplify the resulting contrast if you can, and consider handling for colors precisely on the median as a special case.


If necessary, you could apply a hue or grayscale this inverted colour to make it more visually appealing. The important thing is that there's contrast.

This method is commonly used in image editing applications such as Photoshop:

Photoshop bounding box

2
  • 1
    Note that inversion alone fails miserably for midtones, which change very little (or not at all). This is a perennial problem with tools that use this method. If you go with inversion, you should also attempt to amplify the resulting contrast if you can, and consider handling for colors precisely on the median as a special case. – Nathan Christie Jul 31 '17 at 15:34
  • @NathanChristie Thanks for the insight, that's a very good point. I'll modify my answer to address this. I hope you don't mind me quoting you directly? – Joel Tebbett Jul 31 '17 at 17:43
0

I agree with Joel, but if you want to use a constant color through your application, then it's better to use a color that is quite different from the colors common between cats and also attracts attention, So I suggest red or cyan or maybe a vibrant green.

2
  • 1
    It's a bounding box, so it's not about making the colour different to the colour of cats, it's about making it different to the colour of the background behind the cat. Because the background will be arbitrary, you cannot make an assumption about the colour of the background. – Joel Tebbett Jul 31 '17 at 8:28
  • @JoelTebbett I see, but the background color may change through different parts of the bounding box and so making it like a rainbow, which can be a problem maybe, but if that's ok, then your answer is completely sufficient. – Sarah Akhavan Jul 31 '17 at 10:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.