Patent attributes
An electronic device may have a display panel with an array of display pixels. Light from the display panel may be focused by a lens assembly towards a viewer. The presence of the lens assembly may cause geometric distortion for a viewer viewing images on the display through the lens assembly. To mitigate geometric distortion, geometric distortion compensation may be performed in the electronic device. The electronic device may include both a fixed lens element and a removable lens element in the lens assembly. The removable lens element may be changed, allowing the distortion function associated with the lens assembly to change over time. To dynamically compensate for geometric distortion caused by a lens assembly with a removable lens, ray tracing may be used to determine the geometric distortion caused by the lens assembly depending upon the particular removable lens that is present in the lens assembly.