Encrypting image transmission has been one of the most complex challenges with communication technology ever. Millions of people utilize and share photographs via the internet for personal and professional purposes. One approach to secure picture transfer over the network is to use encryption techniques to transform the original picture into an unreadable or garbled version. Several novel and encouraging possibilities for creating secure Image data encryption techniques are presented by cryptographic algorithms grounded in chaotic logistic theory. Developing a foolproof method for encrypting both black-and-white and color image is the primary focus of this work. Both grayscale and color images can be encrypted using the keys generated by combining the chaotic logistic with the image's density in the first stage of the proposed system's encryption process. The original image can then be recovered in the second stage, which is the inverse of the encryption process. Two publicly available standard grayscale and color photographs were analyzed to evaluate the suggested approach. Peak signal-to-noise ratio (PSNR), unified average changing intensity (UACI), and number of pixels change rate (NPCR) were found to be 6.6268, 51.3011, and 100, respectively, according to the test findings.