We propose a novel image encryption scheme that utilizes chaotic maps and random scan patterns to protect image content. Our scheme includes three stages: pixel permutation via random scan patterns, block pixel diffusion, and block permutation. In the first stage, the input image is partitioned into overlapping blocks, and random scan patterns controlled by chaotic maps are exploited to scramble pixels of blocks. In the second stage, content-based keys are generated from the input image, and the content-based keys and chaotic maps are used to calculate secure matrices for achieving diffusion. The block pixel diffusion is conducted by performing element-wise XOR operation between blocks and their corresponding secure matrices. In the third stage, the image is partitioned into non-overlapping blocks, and all blocks are randomly permuted to further improve security. Key space analysis shows that the key space of the proposed scheme is bigger than those of some existing schemes. Experiments on standard test images are conducted by using some well-known metrics, such as histogram, χ2 test, correlation coefficient, entropy, the number of pixels change rate, the unified average changing intensity, and peak signal-to-noise ratio. The results demonstrate that the proposed scheme reaches the state-of-the-art performance in security and speed. [ABSTRACT FROM AUTHOR]