The band gap of a semiconductor can be tuned through various methods. Doping with foreign atoms, alloying, and creating heterostructures are common strategies. For example, doping TiO2 with nitrogen can narrow its band gap, enabling it to absorb visible light. Similarly, quantum dots can be engineered to have precise band gaps by controlling their size.