The process by which green plants use sunlight to synthesize food from carbon dioxide and water, releasing oxygen in the process.