In order to increase the security and robustness of quantum images, this study combined the quantum DNA codec with quantum Hilbert scrambling to offer an enhanced quantum image encryption technique. Initially, to accomplish pixel-level diffusion and create enough key space for the picture, a quantum DNA codec was created to encode and decode the pixel color information of the quantum image using its special biological properties. Second, we used quantum Hilbert scrambling to muddle the image position data in order to double the encryption effect. In order to enhance the encryption effect, the altered picture was then employed as a key matrix in a quantum XOR operation with the original image. The inverse transformation of the encryption procedure may be used to decrypt the picture since all the quantum operations employed in this research are reversible. The two-dimensional optical image encryption technique presented in this study may significantly strengthen the anti-attack of quantum picture, according to experimental simulation and result analysis. The correlation chart demonstrates that the average information entropy of the RGB three channels is more than 7.999, the average NPCR and UACI are respectively 99.61% and 33.42%, and the peak value of the ciphertext picture histogram is uniform. It offers more security and robustness than earlier algorithms and can withstand statistical analysis and differential assaults.