Agar is a gelatinous substance that is widely used in microbiological media, as a thickening agent in food, and in various other industries. Agar is primarily obtained from certain species of red algae, specifically Gelidium and Gracilaria.
Gelidium and Gracilaria are marine red algae that contain agar in their cell walls. These algae are the primary sources for commercial agar production.
Agar is not obtained from other types of algae or plants.
Therefore, the correct answer is both Gelidium and Gracilaria.