Applying hydrostatic and biaxial lattice expansion, the optical properties of InAs, InSb and their ternary alloys InAsxSb1−x have been investigated using density functional theory by employing the WIEN2k package. Under hydrostatic lattice expansion, we observe a conversion to narrow or zero band gap semiconductors, while under biaxial lattice expansion a conversion to topological semiconductors occurs. We further investigate how the optical properties, investigated within the random phase approximation, changes upon the transformation to topological semiconductors, narrow or zero gap semiconductors. Under hydrostatic lattice expansion, for all compounds except for InAs, the static dielectric constant increases linearly. According to our results, moderate biaxial lattice expansions between 1% to 4% cause a conversion to topological semiconducting state while the static dielectric constant of these compounds is found to increase smoothly during the transformation. With the strain increasing, the optical absorption spectra can be red-shifted significantly , and the optical absorption can be enhanced in some regions of electromagnetism spectrum.