We have studied transmission of light through two-dimensional photonic crystals of finite width, with the radii of the cylinders in the middle row altered in comparison to the host cylinders. Either the cylinder or the host material (for cylindrical holes) is a semiconductor, modeled by a realistic dielectric constant that takes into account free electrons, free holes, and lattice vibrations, as well as the dissipation related to each of these contributions. We considered both an intrinsic, narrow-gap semiconductor (InSb) and an extrinsic elemental semiconductor (Si). Our simulations of the transmission peak due to the line defects demonstrate that it can be substantially tuned by varying the temperature (for InSb) or the density of injected charge (for Si). The downside is absorption, which rapidly increases with temperature and impurity density. An optimized structure is suggested for experimental purposes. © 2005 American Institute of Physics.