barium sulfate in medicine

Yes. According to the FDA and other regulatory agencies globally, “titanium dioxide may be safely used for coloring foods”. Titanium dioxide is safe to use, and the FDA provides strict guidance on how much can be used in food. The amount of food-grade titanium dioxide that is used is extremely small; the FDA has set a limit of 1 percent titanium dioxide for food. There is currently no indication of a health risk at this level of exposure through the diet.

...

We've used titanium dioxide safely for decades. However, recently its safety was called into question. 
 
At CRIS, we've explored the safety of titanium dioxide for nearly half a decade, including conducting double-blind research to test the safety of food-grade titanium dioxide (E171). Our study shows that when exposed to food-grade titanium dioxide in normal conditions, research animals did not experience adverse health outcomes.
 
It's important to emphasize that in a National Institutes of Health study, experimental animals were exposed to titanium dioxide in amounts as high as 5% of their diet for a lifetime and showed no evidence of adverse effects. 
 
A handful of studies greatly influenced the decisions made by the European Food Safety Authority (EFSA). Unfortunately, these studies did not consider that titanium dioxide exposure comes from food, not drinking water. Additionally, CRIS researchers could not reproduce the adverse outcomes identified by the studies through typical food ingestion. Regardless, the EFSA banned E171 as a food ingredient and for use in other capacities in the summer of 2022.
 
In 2022, the United States, United Kingdom, and Canada maintained that the scientific evidence supports that titanium dioxide (E171) is safe for humans to use and consume.

...

An inorganic chemical, titanium dioxide is used as a dye to help products achieve a certain appearance, including whitening a product. Some experts and publications have described it as being akin to a paint primer that's used before the color is added to food in order to give products a uniform shine. Its presence is common in many items beyond Skittles including coffee creamers, cake mixes, and chewing gum. It's also used for pigment and in cosmetics manufacturing.

...

One of the key areas of focus for TiO2 technology manufacturers is environmental sustainability. With increasing concerns about climate change and environmental impact, TiO2 manufacturers are exploring ways to reduce their carbon footprint and minimize waste in their production processes. By implementing new technologies, such as recycling and waste reduction initiatives, TiO2 manufacturers are able to produce TiO2 products in a more eco-friendly manner.

...