Embedding additional information into digital images is an effective method of data privacy protection. A data hiding scheme needs to have a high level of imperceptibility to provide a high level of security. At the same time, it is necessary to maintain good capacity and ability to extract information in its original form. In this study, we propose an adaptive scheme for embedding data into the hybrid spatial-frequency domain of images based on the quantization index modulation (QIM) method. Information embedding is performed by small changes in pixels in the spatial domain using a change matrix. A genetic algorithm finds the optimal change matrix for each image block. The objective function combines visual invisibility, statistical invisibility, and extraction stability metrics. Information extraction is performed in the Discrete Cosine Transform (DCT) domain. Using the hybrid spatial-frequency domain reduces the number of DCTs and inverse DCTs when calculating objective function values during optimization. Additionally, we adaptively select quantization step values. Experimental results show that the proposed scheme is efficient in terms of embedding quality indicators. Moreover, the influence of additional information embedding on image histogram in the frequency domain is minimized. In terms of imperceptibility, our scheme achieves an average PSNR of 44.0920 dB, SSIM of 0.9995, and NCC of 0.9998 with an average capacity of 0.4640 bpp. The embedded information is extracted without errors in all cases and no additional information or re-optimization is required during extraction.