Semiconductor processing is becoming more challenging as integrated circuit dimensions shrink. An increasing number of technologies are being developed for the purpose of ensuring pattern fidelity, and source and mask optimization (SMO) method has outstanding performances. In recent times, owing to the development of the process, more attention has been paid to the process window (PW). As a crucial parameter in lithography, the normalized image log slope (NILS) is strongly correlated with the PW. However, previous methods ignored the NILS in the inverse lithography model of the SMO. They regarded the NILS as the measurement index for forward lithography. This implies that the optimization of the NILS is the result of passive rather than active control, and the final optimization effect is unpredictable. In this study, the NILS is introduced in inverse lithography. The initial NILS is controlled by adding a penalty function to ensure that it continuously increases, thus increasing the exposure latitude and enhancing the PW. For the simulation, two masks typical of a 45-nm-node are selected. The results indicate that this method can effectively enhance the PW. With guaranteed pattern fidelity, the NILS of the two mask layouts increase by 16% and 9%, and the exposure latitudes increase by 21.5% and 21.7%.