A cell or organism that manufactures its own food from CO2 and other small inorganic compounds by the process of photosynthesis.