Although optically transparent semiconductor diodes and electronics can have a wide range of important potential applications, the development bottleneck is encountered due to the lack of a transparent semiconductor system that can be either por n-type. In this work, we report our design and success in the development of a novel AgCuI alloy semiconductor system that can be either p-type or n-type depending on Ag concentration. We have studied the electronic and optical properties of AgCuI alloyed thin films (AgxCu1-xI, 0 <= x <= 1). The crystal structure is of gamma-CuI for Cu rich, while it is of beta-AgI for Ag rich. By tuning Ag/Cu composition in thin films, we could engineer the energy bandgap from 2.78 to 3.02 eV with excellent transparency. Significantly, all the AgxCu1-xI alloy films are direct-gap semiconductors showing PL emission from exciton band-band transition and the wavelength is found tunable with respect to composition. The electronic valence band, conduction band and Fermi level positions determined from ultraviolet photoelectron spectroscopy show continuous shifts with respect to composition, marking a p-type (Cu rich) to n-type (Ag rich) conduction conversion. The composition analysis presented a full picture of energy levels for AgxCu1-xI alloys, which can serve as reference in band alignments. The achievement in both p-type and n-type for a transparent AgCuI semiconductor system, the light emitting property and tunable electronic bands with desired electrical conductivity in AgxCu1-xI alloys may offer new opportunities in invisible electronics and optoelectronic applications. (c) 2020 Elsevier Ltd. All rights reserved.