Photosynthesis occurs primarily in the chloroplasts, which are specialized organelles found in the mesophyll cells of plant leaves. Inside the chloroplasts, photosynthesis takes place in structures called thylakoids that contain the pigment chlorophyll, which captures light energy. The mesophyll cells in the leaves are the main site of photosynthesis, although this process can also occur to a lesser extent in other green parts of the plant. The gas exchange necessary for photosynthesis takes place through stomata, small openings typically found on the underside of leaves.