The green pigment that traps energy from sunlight is called chlorophyll. This pigment is found in special cell organelles called chloroplasts and it is also found in some special anaerobic bacteria called cyanobacteria. Chloroplasts are found only in the cells of the leaves of green plants.
During the daytime, when sunlight falls on green leaves, it traps the solar energy and converts it into simple carbohydrates such as glucose and starch. Thus, it helps to convert solar energy into chemical form.
This process is called photosynthesis and takes place only in green plants. For photosynthesis to take place, carbon dioxide and water vapor are also necessary. Oxygen is given out during the process of photosynthesis.