Trees use carbon dioxide and produce oxygen in the presence of sunlight.
But is there any other source?
If yes, are trees the most important source of oxygen, or is there any other source which produce more than trees do?
71% of the earth's surface is taken up by water. Not surprisingly therefore, the seas are an important source of oxygen. National Geographic claims that photosynthesis by phytoplankton (mostly single-celled phototrophs, such as cyanobacteria, green algae and diatoms) account for half of the earth's oxygen production. The other half, they claim, is produced on land by trees, shrubs, grasses, and other plants.
Based on these reports, hence, marine phototrophs account for 50 - 80% of the earth's oxygen production.
With regard to terrestrial oxygen production, NASA reports that 30% of the land is covered by trees, and as much as 45 percent of the carbon stored on land is tied up in forests. So on land, trees are definitely large contributors to oxygen production.
I am not sure which class of organisms have the highest contribution in oxygen production but diatoms do have a significant contribution. The introduction in this paper says that diatoms account for 40% of marine photosynthesis which according to this site is "1/4 of the oxygen we breathe."
Trees are definitely not the only source of oxygen. First, all green plants do photosynthesis, not only trees. Moreover, about half of all photosynthesis on earth is done by microorganisms in the oceans known as phytoplankton.
I thought it was fairly well understood that trees make NO net contribution to the oxygen supply.
As a tree (or any plant) grows, it locks carbon within itself and releases the O from the CO2 into the atmosphere. When that tree dies, it decays by being consumed. All of the C gets recombined with O2 during the decay. Therefore, a quantity of oxygen is lost from the atmosphere and this loss is, by definition, exactly equal the the oxygen produced when it grew.
The best we can say is that trees are constantly locking up a huge quantity of carbon (and therefore allowing an equally huge amount of free oxygen to exist in the atmosphere) but no net gain/loss ever takes place.
Of course, this still doesn't excuse destroying rain forests because that definitely does release CO2 and absorb oxygen in the process.