In this work, we demonstrate that a third route to the engineering of the electronic properties in the growth plane of a semiconductor can be achieved by exploiting the effect hydrogen has on dilute nitrides, such as GaAs1–xNx/GaAs (and GaP1–xNx/GaP), as we anticipated in the literature. In these material systems, the replacement of a tiny fraction (x ?1%) of arsenic (phosphorus) atoms by nitrogen atoms leads to highly nonlinear effects in the electronic properties of the host lattice. These include a giant reduction in the bandgap energy and a deformation of the conduction-band structure, which render this material as having high potential for telecommunications through fiber-optic cables, multijunction solar cells, heterojunction bipolar transistors, and terahertz applications. Previous experiments have shown that post-growth irradiation of GaAs1–xNx with atomic hydrogen leads to a complete reversal of the drastic bandgap reduction, as well as of other material parameters, caused by nitrogen incorporation. Here, by deposition of metallic masks on and subsequent hydrogen irradiation of GaAs1–xNx, we create a planar heterostructure with zones having the bandgap of a GaAs1–xNx well surrounded by GaAs-like barriers. Alternatively, by focusing an energetic electron beam on the surface of hydrogenated GaAs1–xNx we displace hydrogen atoms from their nitrogen passivation sites, thus leading to a controlled decrease of the crystal bandgap in the spatial region where the electron beam is steered