Lab Lightness

Lab color mode can be used for brightness, contrast, and color enhancements in somewhat different ways than RGB mode. Where RGB mode provides a composite channel (RGB) that is composed of red, green and blue channels, Lab mode provides a composite channel (Lab) that is a composite of Lightness, “a” and “b.” The a and b channels encode the color information, while the Lightness channel, as it name suggests, encodes the grayscale values.

Image of a man, showing Lab and lightness channels

Sample image with Lab and lightness channels

Continue reading ‘Lab Lightness’

Fresnel Ring Moires

This Processing applet shows how overlapping Fresnel rings create moirĂ© patterns that are either straight lines or Fresnel rings. The animation moves the two Fresnel rings together and apart at a constant rate, but the moirĂ© patterns accelerate and decelerate. Animation works best when your browser isn’t doing a lot of other tasks that interrupt the applet–download it for best results.

Click in the applet and type “m” to use the mouse to drag the rings left and right. Type “a” to animate again. Source Code: moire. Made with Processing.

The Fresnel rings are drawn with circles using different stroke widths and no fill. The stroke widths derived by subtracting the diameters of a series of circles proportional to successive square roots of a sequence of integers 1..N.

  for (int i = 0; i < rings; i++) {
    diameters[i] = (float) Math.sqrt(i + 1) * max_diameter;

Fresnel lenses are composed of prisms arrayed in Fresnel rings. In the 50s, plastic lens that you could slap onto your teevee to magnify the picture were popular. Large ones are used in solar cookers. The advantage over regular lenses is that Fresnels can be much lighter. They can also be built of modules that fit into a frame--this made them very efficient for focusing lighthouse lights, as they could be transported in sections and assembled on site.

Incidentally, putting a Java applet (from Processing) into a WordPress post was not simple. Following advice in the Processing forum, I resorted to the (deprecated) <applet> tag instead of using the markup generated by Processing. If anyone knows how to use that more current markup (or something similar), please post a comment. I had to do my final edits in the HTML editor and insert the <applet> tag with no linebreaks. Do not go back the visual editor if you do this--it will clobber the applet markup (you could probably fine tune MCEdit to get around this).

You can see this applet its own page, generated by Processing, here.