PENNSYLVANIA (WHTM) — Each fall, the trees in Pennsylvania exchange their green leaves for reds, yellows, oranges, and browns. A lot goes on behind the scenes of this beautiful natural process.

Leaves get their green color from a pigment called chlorophyll, which is involved in the photosynthesis process through which trees produce their own food, explained Ryan Reed, natural resource program specialist in the Pennsylvania Department of Conservation and Natural Resources Bureau of Forestry communications section.

When the growing season ends each year, trees stop producing this pigment. “It doesn’t make sense to continue producing chlorophyll anymore because pretty soon we’ll be at low light conditions, the temperatures will start to get much cooler, and that also inhibits photosynthesis,” Reed said.

As leaves’ chlorophyll breaks down, they start to take on the color of other pigments, some of which are also involved in absorbing sunlight for photosynthesis. Carotenoid pigments create orange tones in leaves, xanthophylls create yellows, and anthocyanins can create more purple and brown colors, Reed explained.

Deciduous trees shed their leaves in the fall to best retain water.

“It’s kind of like a cost-benefit analysis for a tree. They say, ‘It’s actually better for my health to lose my leaves because then I don’t have to lose all my water through the dry period of winter through the process of transpiration,'” Reed said. (Transpiration is the release of water vapor through plants’ leaves.)

Before their leaves drop, though, trees take on the brilliant colors associated so closely with fall. Reed explained that red maple trees and oak trees adopt shades of red and burgundy, while yellow poplars and northern hardwoods like birch trees turn yellow.

Reed said that mid-October is usually the best time to see fall foliage in Central Pennsylvania.

“Generally we have a very long fall foliage season in Pennsylvania, and that is because we do have two very distinct forest types that meet in Pennsylvania — those northern forests meeting and mingling with the southern species like oaks and hickories,” Reed said.

This creates essentially two fall foliage peaks with trees from different regions shifting colors at different times, explained Reed.

Several factors, including tree species, influence the exact time at which leaves change color, but overall it is decreasing day length that leads the process, Reed said.

Once the days start to get shorter, seasonal elements like cold weather and rain can influence when exactly the leaves change color, how vibrant they become, and how long the fall foliage sticks around before the leaves drop.

A rapid and sustained decrease in temperatures can trigger the leaves’ transition to fall colors, Reed said, and a series of cooler days and nights — maybe three to six consecutive days with temperatures between the upper 30s and the 50s — can lead to a vibrant, colorful fall.

Windy weather can shorten the life of fall foliage, knocking the leaves right out of the trees, while excessively rainy weather can cause brown or black fungi to grow on the leaves, muting their colors, Reed explained.

The trick to a perfect fall is just the right amount of rain mixed with cool temperatures.