Bokeh is all about the aesthetic qualities of blur. When out-of-focus objects, or highlights, are blurred in a soft and graduated fashion the blur is pleasing to the eye so we refer to it as good bokeh. When blur reveals evidence of sharp edges, detail or identifiable patterns or texture, the eye may perceive detail which does not really exist and the result is described as bad bokeh.
Ideally, detail such as lines would fall smoothly out of focus as they become more remote from the plane of focus, but in practice they do not do this. Complex multi-element lenses incorporate various compromises and have all sorts of imperfections. The blurring they produce is consequently not ideal. The lines in the diagram above , on the right, were blurred using a Gaussian filter and demonstrate how lenses should ideally blur objects. The image below illustrates a typical result obtained using a real lens - in this case a Nikon 105mm f/2.8 prime. Lenses are designed to minimize aberrations for in-focus images. The nature of the aberrations in out-of-focus image areas, and hence the quality of the bokeh, is dependent upon the details of the particular lens design and the compromises made in its design.
In the left-hand image the lens is focused at a distance further away from the camera than the plane of the line diagram. In the right-hand image the lens is focused at a distance nearer to the camera than the plane of the line diagram. It is possible to see that the lines have not blurred in an ideal manner. In some areas shapes have been created at the intersections of lines, and detail may be perceived where none existed in the original pattern. Patterns such as these are aesthetically less pleasing than a smooth Gaussian blur and consequently classified as examples of less-than-ideal or bad bokeh. Some chromatic effects are also visible in the color of the blur patterns.