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.