1. A method comprising: generating a light pattern using a display panel; forming a virtual image from the light pattern utilizing one or more optical components, wherein the virtual image is viewable from a viewing location; receiving external light from a real-world environment incident on an optical sensor, wherein the real-world environment is viewable from the viewing location; obtaining an image of the real-world environment from the received external light; identifying a background feature in the image of the real-world environment, wherein the background feature corresponds to a portion of the viewable real-world environment over which the virtual image is overlaid; extracting, from the image of the real-world environment, pixel data indicative of one or more visual characteristics of the background feature; comparing at least one of brightness, hue, or saturation included in the pixel data to an upper threshold value and a lower threshold value; generating a data mask based on the pixel data and increasing, based on the comparison, contrast between the virtual image and the viewable real-world environment by controlling the generation of the light pattern, wherein increasing the contrast comprises blending the virtual image with an enhanced virtual image using the data mask as a blending factor.