Showing posts with label lighting. Show all posts
Showing posts with label lighting. Show all posts

Friday, September 25, 2026

LED lights won't kill you

 kw: risk analysis, lighting, light sensitivity, color vision, hype

Perhaps you've seen online warnings, that we must discard all our LED lamps Right Now! Fear not, they are no more dangerous than old-fashioned incandescent bulbs, and frequently much safer. The ones to be wary of are fluorescent bulbs, whether spiral or straight tubes, because they contain mercury.

Two sorts of fears are expressed about LED lamps. Firstly, they are said to have lots of blue light, which can damage eyes and cause loss of sleep. Secondly, cheaper ones may flicker, which can cause eye strain and even nausea for some people.

I studied color vision professionally, and I've been a spectroscopist. So let's tackle the color issue first: Do LED lamps produce more blue light than other types? I will show next that the answer is Yes for some and No for others. This has to do with the concept of Color Temperature.

Most of us are familiar with the terms "red hot", "yellow hot" and "white hot", in order of increasing temperature. Not many people know there is also "blue hot", which is even hotter. If you use metal tongs to hold a small nail in the fire in a fireplace, it can be heated red hot. It takes a hotter flame to make it glow more brightly with an orange light. And we tend to think of "white hot" as the color of molten iron as seen in a steel plant. Actually, the light from the filament of a 100-watt incandescent light bulb is even whiter than the light from liquid iron, because it is several hundred degrees hotter.

Most incandescent lamps use a filament temperature near 2,700 K, where "K" refers to Kelvins, the temperature standard used in physics. In everyday terms, 2,700 K = 2,427°C = 4,400°F. The light from incandescent lamps is actually orange, which is why when you are outside on an overcast day, particularly in the early evening, the light coming out the windows of houses looks yellow or orange, compared to the gray or blue-gray sky. Your eye is actually tuned to see a cloudy sky as white. That "gray sky" color is the true color of the Sun.

The color temperature of the Sun is close to 6,500 K (~6,230°C or 11,250°F). This high temperature produces much more blue light, so sunlight is bluer than the light from a light bulb.

Before compact fluorescent lamps were invented, to get a brighter, slightly bluer light, a couple of technologies were invented to use lamps with a filament temperature of 3,000 K. This is called "cool white", and it is bluer than the "warm white" of an ordinary incandescent bulb. To get even bluer light required a filter.

Both compact fluorescent lamps (CFL's) and LED lamps use fluorescence to create broad-spectrum light. In a CFL, mercury in a glass tube is stimulated by an electric arc to emit strong ultraviolet light. Phosphors (fluorescent powders) coating the inside of the tube convert nearly all of this UV light to the many wavelengths of "white" light. It happens that mercury also emits a deep blue wavelength, plus green, yellow, and red, but there are sharp "lines" with narrow bandwidths. The phosphors (there are several) add more blue, green, yellow and red in wider bands that make a more pleasant light. The mix of phosphors can be varied to make CFL's that have "warm" or "white" or "cool white" colors—although the "cool white" actually matches a super-hot object, hotter than any earthly material—, and "daylight" which is even more bluish.

LED's are even more flexible. They all work by producing a primary blue color and having phosphors set to intercept some of this and convert it to the rest of the colors. In contrast to CFL's, which can produce only one color temperature at a time, LED's can be color-variable. The light-emitting elements are very small (a few millimeters or smaller), so many are placed side by side. If some of these are blue-only, then extra blue light can be added to shift the visual appearance from warm white to daylight and all points in between. Also, when you buy a single-color CFL or LED lamp, it will be described according to both a term like "cool white" and a color temperature like 3,000 K. A "daylight" lamp will be reported as a color temperature of 6,500 K, and a "bright white" lamp will be in between, usually 5,000 K. 

Our psychology associates yellower light with early morning or late evening or firelight, and makes us feel restful. "Warm white" light promotes sleep. Bluer light is associated with daylight and makes us alert and wakeful. For this reason most office spaces are lighted with "bright white" 5,000 K lamps. Daylight colored lamps were tried in the past, but the light is considered too harsh and it makes people irritable. "5K" is a good compromise.

The spectrum of my shop light (it is variable, and I have it set to 5,000 K) is shown here:


This image's colors are a composite of the lamp's spectrum and the camera's sensors, which are not the same as the color sensors in our eye. Thus, one of the features of this image is the narrow, rather dim yellow section; to the eye, it looks wider and brighter. But another feature is very important for understanding how these lamps work, and why some folks are alarmed. Between the green band and the blue band there is a much dimmer section where "sky blue" should be. There is actually some, but not much. The narrow, deep blue band is the original light from the blue-emitting element. All the other colors are from the phosphors.

The main way that color temperature is varied in LED lamps is by setting the percentage of the blue light that the phosphor section intercepts. In a variable LED, which may contain a few dozen emitters, some of them are blue-only and the variability is produced by increasing or reducing the current to these.

Therefore, a "warm white" LED produces only a little blue light, while a "bright white" LED will produce much more blue by comparison. I use lamps specified as "warm white", or 2,700 K, in my bedside lamp and in the bathroom. I tested their spectra as compared to an incandescent bulb (I still have a few squirrelled away). In this image the incandescent lamp's spectrum is at the top, and spectra for two versions of LED are second and third:


The color temperature of the incandescent bulb is 2,700 K. The two warm white LED's match this very well, although they have a little less of the deepest blue. The phosphors are better than those in my shop light; they even show sky blue (cyan) colors.

The "LED Danger" hype is firstly based on blue light from LED's making it hard to go to sleep. This is simply remedied by using warm white lamps in the bedroom and bathroom. If you get fixtures with color-variable lamps for the rest of the house, you can set them to be bluer (4,000 K or 5,000 K) in the daytime and yellower (2,700 K) after sundown. If your cell phone has an "evening" or "night" setting, use that appropriately. Phones by default are close to daylight color on average (6,500 K). Going "orange" in the evening entirely solves the "blue white at night" issue!

For those who may have technical questions about taking spectra, I use an "inside out spectrograph" I made. This picture shows the three lamps used to make the triple spectrum above. This 3-socket fixture is covered by a black hood with a long slit. My camera is mounted ten feet down a darkened hall. I have a little holder mounted on the camera with a grating sold by Rainbow Symphony; you can buy them for a few dollars each. I just point the camera where the spectrum is and zoom in on it.

Now, about flickering. The LED lamps shown in this picture are of different ages. The older one is at the bottom, and it flickers in two ways. Firstly, it pulses at the rate of 120 Hz the same way old fluorescent tubes do. This is not as strong an effect as in the old tubes, but I can notice it if I sweep my eyes past the lighted lamp; a little banding is evident. This shouldn't bother most people, but some people might notice the pulsing in peripheral vision, with is more motion sensitive.

The other kind of flickering is more evident. These "pseudo-filament" bulbs look nice, but older ones can have momentary disconnections inside as they heat up. This causes a brief dimming that looks like a power interruption. It is, but inside the lamp itself. Further, some really cheap lamps have poor circuitry inside the base of the lamp that can also flicker like that. If you notice this kind of flickering, try putting a better quality lamp in the fixture and see if it continues. I replaced the lower lamp with one of the other kind (with yellow-colored filaments), and both kinds of flickering no longer happen. The 120 Hz pulsing is dealt with by using phosphors that have a little "dwell"; they emit light for a fraction of a second longer than the flash from the blue LED element.

There you have it. LED's are at least as safe as incandescent bulbs, and they produce much less heat. Use a comment to ask follow-up questions.

Tuesday, August 18, 2026

The concept of image gamma

 kw: photo essays, lighting, gamma, image editing, low key, high key, key adjustment, gamma adjustment

I was asked to explain gamma in images. There is a mathematical explanation, but not many folks would have a gut-level understanding of the math. Instead I'll describe the concept: 

Gamma is the relationship between the brightness of the light at every point in a scene and the numbers used to store each point in a pixel and display it. In an image file, adjusting the gamma of the image raises or lowers these numbers to "brighten" or "darken" the image, while keeping the zero and 100% points fixed.

When the gamma equals 1.0 the relationship between light intensity and the stored values is a straight line. In such a case, when a pixel received half the amount of light compared to the brightest pixel in the image, the number stored for it is 0.5 times the maximum possible number. For most digital images, the numbers range from 0 to 255, so the midpoint is 127 (only integers are used, so the extra half a digit is dropped). When gamma is changed for an image to a number other than 1.0, the relationship becomes a curve. The result is an image that appears brighter or darker, as if the exposure had been different.

Adjusting gamma is different from changing the overall brightness. Raising "brightness" using most image editing software just adds the same amount to every pixel's value, and lowering it subtracts a fixed amount from every pixel's value. Just a little of this may be OK for some images, but a more nuanced approach works better.


This is the "Color Curves" tool in GIMP (a freeware program similar to Photoshop). Moving portions of the straight line that goes from lower left to upper right adjusts the relationship between the values in an initial image and those in an adjusted image.

Note that below the histogram the "Curve type" is Smooth. For simple changes, we can click and drag a point on the line up or down. The program obligingly adjusts the image so we can see the result in real time.

If we drag the center of the line upward, for example, the line changes to a curve passing through that point, showing the change caused by adjusting gamma. Dragging a point not at the center uses a different function, related to gamma but not the same.

The next image shows how the curve looks when the center point is raised a little.



The center point started with a value of 128, seen in the "Input...Output" indicators, and it now has been changed to 160.

The whole line was not shifted as a straight line, but is now a curve that passes smoothly from 0 to the midpoint to the upper right at 255.

In terms of gamma, this raises it from 1.0 to a higher amount. The effect on the picture is to brighten the midrange the most, with less and less brightening towards either end of the histogram.

Next I'll show how the red, green, and blue histograms are affected by this change, and then the image itself and its adjusted version. These histograms were produced using IrfanView:



The images I used are small, only 800 pixels across, so the "before" on the left is jittery, and the "after" on the right is positively seismic! In the portion of the histogram that was stretched the values were shifted, which "pulled them apart", leaving "holes" between. The overall shape of the histograms reveal that the values were all shifted to the right (brighter), stretching the leftward (darker) portion and squeezing the rightward portion. 

Next we see first the image I started with and then its adjusted version. The primary visual differences are that more detail is seen in the shadows, the whole shop appears a bit brighter, and there is a little more emphasis on the woman.



The original image was 1,376x768 pixels; these are 800x447. I used a rather short prompt: "The essence of ingenuity with a steampunk vibe", using the Google Flow site, which makes use of the Nano Banana family of art engines for still images. Unless the prompt includes a request for a bright image, or high key, this engine, like all the others I have used, tends to produce medium-to-high contrast, moderately low key (sorta dark) images. Sometimes the image can be quite dark, as we will see.

When I want to adjust gamma only to raise the key of an image, I edit with IrfanView, which has a control to set a numeric value between zero (totally black except those pixels that started out with a value of 255) to 10 (almost totally white). GIMP doesn't use numeric gamma so I don't know the exact value GIMP used for the adjustment I made, but it is probably about 1.2.

Now let's see how gamma adjustment affects images that were deliberately produced at either high key (lots of white) or low key (lots of dark gray and black).

Here is a common treatment of a baby picture: overexposed on a white background. The attached histogram shows that there are very few darker pixels. The slightly dimmer peak at the right is the shadow, barely visible to the left of the baby's head. The "baby pixels" make up the "mountain".


I used a gamma adjustment of 0.75 to bring out more color in the baby's face. Although the shadow is a bit more distinct, I like this picture better overall.


Next, here is a low key example. I have made a lot of images of imaginary caves. This is one of a series I call Spelunker's Paradise, based on a 15-word prompt. While cave imagery tends to be low key, this was the darkest of the bunch. The engine was Ideogram in Leonardo AI. The histogram has a big peak near "black" and not much else, and in the image one can see only hints of the scenery.


I use IrfanView with a gamma adjustment of 1.2 or 1.3 for moderately low key images. In this case more drastic treatment is needed; I first used 1.5:


A lot more is visible. Based on my own spelunking experience, this is probably realistic. However, I also tried a gamma adjustment of 2:


If I were going to print the image for hanging on my dining room wall, this is the version I would use. You can see in the histogram that all but a few of the darkest areas have now been pushed to be brighter than nearly all of the first image. If the gamma were to be raised even higher it would look unnatural.

In all the histograms of gamma-adjusted images, the jitter-to-zero shows that when RGB values were changed to be larger, gaps resulted. The human visual system is very forgiving of small glitches in color. If I wanted to produce an image with strongly adjusted gamma, and still have a smoother color histogram, I would upscale the image 2:1 using Upscayl, adjust gamma, then reduce the result again to the original size. The final image would have a smoother histogram and this would also potentially reduce image artifacts that could show up otherwise.

The key takeaway is that adjusting gamma is like changing the exposure after the fact.

Sunday, November 19, 2017

Lamp spectra - first try

kw: analysis, spectroscopy, lighting

In the past few years we have tried several lower-wattage "bug lights" as an alternative to the yellow 40-watt incandescent bulbs we've used before in our porch light fixture. When the one we had 4 years ago burnt out we got a 13 watt, yellow compact fluorescent spiral lamp by Sylvania. Though it was not marketed as a bug light, it worked pretty well, though some insects came to it. The next year I saw a 6 watt LED bug light, marketed as such by Feit, so we got that. It worked about equally well. Then I went looking for something that might be a little bit better, and got a 3 watt amber bug light, also by Feit. It doesn't draw insects, but it is pretty dim.

I decided to find out whether a little blue light is getting out of these lamps, so I made a crude spectroscope from a piece of diffraction grating and a short length of PVC pipe plus some odds and ends. In this photo it is on a tripod aimed at a test lamp. I aim a camera with a telephoto lens at the black aperture at the left, where the spectrum emerges.

I cut the end of the PVC for the grating at an angle so the spectrum would exit at right angles to the grating. It has the added benefit that, for visual use, looking the "back way" yields a spectrum about twice as wide. But the focal plane is strongly tilted, making it a poor choice for photography (though I tried!). The instrument has a number of shortcomings, but I think I know how to produce a better next version. For one thing, I'll use a different exit angle, so the diffraction grating doesn't reflect the camera and photographer! (see below)

I photographed the spectrum of nine lamps, the three test bug lights and several others either for spectrum reference or to see the spectral coverage of both incandescent and non-incandescent lamps. Eight of the lamps are shown here, and their spectra are tagged in the next image, followed by some explanation.

These are in the order listed in the spectra image.



The first three spectra are for reference. The 4000K (cool white) CFL shows a combination of spectral lines for mercury (Hg) and for the phosphors used to "whiten" the harsh blue-green light of raw Hg lamps. Mercury has a strong green spectral line at 546 nm, as seen in both this lamp and the 13W yellow CFL (A nearby strong green line is from a phosphor) and a strong blue-violet line at 405 nm, which excites some of the fluorescence, but a stronger near-UV line at 365 nm does most of that. The strong red-orange line at or near 615 nm is from a phosphor, as are the yellow-orange-green and green-blue-violet bands. The 40W incandescent lamp shows the smooth spectrum characteristic of a thermal source. The near-lack of yellow in this spectrum is because a camera's sensor sees colors differently from our eyes, but this is only evident when photographing spectra! The 60W "Reveal" lamp has a filter that cuts out most of the yellow and yellow-orange, making the light appear bluer and closer to daylight.

The next three spectra are for the bug lights. The 13W yellow CFL has the same spectrum as the white CFL from green through red, but with extra yellow and orange, and the green-blue-violet phosphor is left out. Also, a filter removes the blue and violet lines of Hg. The two LED's have nearly identical spectra. The blue-violet light from the fluorescence-exciting blue LED is filtered out, leaving only light from the broad band phosphors. The 3W lamp has a little more red-orange than the 6W lamp, and this is visible when they are lit side-by-side; the 3W lamp's color is amber. In the photo of the lamps above, the filter is inside the 3W lamp's envelope, which is white. For these three spectra, the brownish features seen below the green band are reflections of either me or the camera off the diffraction grating film.

The 8.5W LED is the kind of "warm white" bulb we have begun to use around the house. It has a spectrum very similar to incandescent; it just has a dip in the mid-blue range, and a bright band in the blue-violet range, which is from the fluorescence-exciting LED. The UV CFL is a "black light", very similar to old black light fluorescent tubes used at parties, but in spiral form. Most of the visible light is filtered out. The green and violet lines at 546 and 405 nm are a little visible anyway, and the camera is barely able to record the 365 nm line that does all the work of making fluorescent things glow. I am puzzled by the line in between, at about 385 nm. I don't know what it could be from. However, I know that these lamps use a phosphor that responds to a strong Hg line at 254 nm and converts it to longer-wave UV, to get more "black light". Perhaps it is the source of the 385 nm line and other faint features in that space, but I think it mainly adds more 365 nm light.

Finally, the 40W fluorescent tube is of the kind that has been in use for nearly my whole life (7 decades), now mostly supplanted by CFL's and LED's. The two lines of Hg in blue-violet and green come through, but broad-band phosphors fill out the light making these pretty good for most uses. They actually have better color rendering values than CFL's, at the cost of using nearly twice the power: a 40W "tube" and a 23W CFL both emit about 1,600 lumens, but strongly colored items may look a little odd with the CFL.

As crude as it is, this simple spectroscope helped me understand these lamps better. I think the reason that some insects still come to the three non-incandescent bug lights is that they can see the green light. I don't have an incandescent bug light, but I suspect it to have less green light than the CFL or the LED's. This has been an instructive exercise.

Monday, July 11, 2011

It is not just the lamps

kw: book reviews, nonfiction, light, lighting, technology, infrastructure

When I began to read Brilliant: The Evolution of Artificial Light by Jane Brox, I was first prompted to consider the various technologies that have been used to light our homes and environment, from campfires to oil lamps to kerosene/mantle lamps to the electric filament bulb to fluorescents and LEDs. And what is next? Thinking about these things, and the continuing quest to produce more light and less heat, was behind this post of a couple days ago.

Ms Brox's book does indeed outline the progress of technologies used to create light, but I realized there is much more involved. There are three basic stages of light production, and each has been supported by a particular infrastructure, without which the light-producing device itself is of comparatively little use.

First, consider the technology of oil lamps, which are basically bowls with a wick and some melted or meltable oily substance. During the thousands (millions?) of years that this technology prevailed, there were the parallel technologies of oil/fat production and rendering, of producing the wicks, of passing the fire from place to place, and of starting the fire if yours has gone out and no near neighbor has any. This last was usually accomplished using a twirled hardwood rod, a dimple or hole in a piece of pine or other softwood, and some tinder.

When more volatile fuels such as light whale oil, kerosene and later coal gas came into use, primarily in Europe and America, there was a parallel development of chemical knowledge. Thus, while a technology for distributing fuels grew until it culminated in the neighborhood gas house and the piping systems that brought gaslight to homes and street corners, strikable matches and flint/steel strikers were also developed to make it easier to light one's lamps.

Finally, although the first incandescent electric light was energized in 1802 by Humphrey Davy, it took another 77 years of experimentation by many, including Edison's technicians, for a practical lamp to be produced. We give Edison credit for the bulb, but forget that his greater accomplishment was the infrastructure that made the bulb practical. The batteries of the day could only energize one of his bulbs for a short time, perhaps a few hours. Keeping that first bulb lit for fourteen hours until its glass envelope cracked was no mean feat, requiring the swapping of batteries in relays.

Thomas Edison envisioned a system of dynamos and underground, shielded wiring that would take care of the needs of a neighborhood at a time. His preference (almost a mania) for DC rather than AC current eventually led to his system being eclipsed by an AC infrastructure developed by George Westinghouse, based on Edison's but with the addition of transforming equipment so that power sent over a longer distance could be boosted to a higher voltage, reducing resistive losses in the wiring.

One characteristic of each successive infrastructure system has been increasing fragility. Thus, a few late chapters in the book cover the great blackout of 1965 and subsequent blackout events, and the efforts that are still being made to make "the grid" ever more robust and reliable. To meet the needs of the later 21st Century in America and Europe, at the very least, new trunk lines and newer switching equipment needs to be set up. It won't be cheap, but not doing it will eventually be hugely more costly. China, India and other major developing countries in Asia and Africa are watching our progress, so they can get their infrastructure right the first time.

With many business places lit entirely by fluorescent light, lighting consumes less than 8% of our energy budget. With many middle class homes using more and more CFL lamps, and a switch to LED's just beginning, this amount will decrease even more. But our use of light is the most visible manifestation of our electrical society. As we learn to make more light while using less energy to produce it, we also need to improve the efficiency of all our uses of energy.

I am reminded of something I learned forty years ago. AC power has this characteristic, that its use is less efficient if the voltage and current get out of phase. "Inductive" loads, such as electric motors, cause current to lag the voltage. "Capacitive" loads, and there are no simple examples, cause the current to lead instead. There are nearly no large electricity consuming devices that are capacitive, meaning that most industry operates with lagging current and its inherent inefficiencies. As it turns out, a type of electric motor called a synchronous motor acts as a large capacitive load. I don't understand the physics of it, so I can't explain why. Anyway, the primary market for large synchronous motors is major industrial plants that install them and keep them running just to balance the phase of their electricity, which significantly reduces their electric bill! I wonder if this would work at the house level. If I look at the transformers on the power poles up the street, I can see that some are accompanied by large capacitors, almost the size of the transformers, that the power company has installed to keep their own system in balance. Maybe there is a way to add a large capacitor or a synchronous motor in parallel with my furnace fan (the largest motor in the house). Don't hold your breath, but I do plan to look into this. Haven't given the matter any thought since 1970 until today!

The last chapter of the book is devoted to the loss of dark skies as we have gone to more and more street and exterior lighting. Not only is it inefficient, there is growing concern that it doesn't do as much as we thought to reduce crime. Perhaps just a little light is better than too much, while still being better than none at all. On my last visit to Japan, while my father-in-law was still living, I was told that he had installed most of the neighborhood's walkway lights. They were a series of single-tube fluorescent fixtures, and while they were nowhere near as bright as the lighting in my neighborhood, they were quite adequate for finding one's way around after dark. It was also easier to see the stars in the sky, which I much enjoy. His lights are probably very close to the amount of light we genuinely need, and a lot more economical than the way most American cities are lighted at present. Thanks to the author of Brilliant for such a thought-provoking book!