# HighlightImage does not work consistently with Line

Bug introduced in 10.2, fixed in 11

HighlightImage is supposed to work with graphics-primitives like Line and Circle too. Very simple examples show, that this does not work consistently.

The documentation clearly indicates, that it should be possible to call (omitting the Graphics!)

HighlightImage[img, Rectangle[{132.5, 88.5}, {220.5, 176.5}], ...]


but if you try it, surprising results are thrown at you. Please look at the differences:

img = Image[Table[i, {i, 0, 255}, {256}], "Byte"];
lines = Table[Line[{{i, 1}, {i, 256}}], {i, 1, 256, 8}];
HighlightImage[img, lines]
HighlightImage[img, Graphics[lines]]


(this seems to work in version 10.3)

One is missing lines and the other one is blurry (although we have perfect pixel positions). A even more amusing one is this

HighlightImage[img, lines, "HighlightColor" -> Blue, Method -> {"Boundary", 1}]


In version 10.3, this call returns an error

Additionally, there seems to be issues regarding the rasterization-quality

circles = Table[Circle[{128, 128}, r], {r, 1, 128, 10}];
HighlightImage[img, circles]
HighlightImage[img, Graphics@circles]


This looks like it was not well tested before thrown at users. I needed the highlighting with lines and ended up writing the 10 lines of code myself, after fiddling around with HighlightImage for half an hour.

• To meet the requirements for the bugs tag, let's state for the record that I encountered this bug under v10.2 Win7-64 as well, though my first picture looks slightly different. – Sjoerd C. de Vries Jul 26 '15 at 19:34
• @SjoerdC.deVries I'm very generous with the bug-tag when I'm sure it is not intended behavior and the margin for it being a feature is impossibly small :-) Btw, I encountered the issue at work on OSX and wrote this post with images generated at home on Linux. But thanks very much for testing it. – halirutan Jul 26 '15 at 20:48
• 10.3 issues are fixed in 10.4 (or earlier). – kirma Mar 2 '16 at 16:34