The process by which plants, algae, and some bacteria convert light energy into chemical energy in the form of glucose or other sugars. It occurs in the chloroplasts of plant cells, and it requires carbon dioxide and water as raw materials. It produces glucose and oxygen.