Images are one of many forms used to store important information that is easy to use and share, but they are vulnerable to cyber-attacks. An encryption effort is needed to secure the vital information in an image. In this paper, an encryption and decryption algorithm for grayscale and RGB images is proposed using logistic map with feedback control (LMFC). This 2D map which is an improvement from the popular one-dimensional logistic map also exhibits sensitive dependence on initial conditions, known as chaos. This phenomenon is verified through bifurcation diagram and the largest Lyapunov exponent. By using the largest Lyapunov exponent and the control parameters as secret key, LMFC generates two sequences of pseudo-random number related to the original image. Subsequently, a permutation process is proposed, utilizing permutation box to rearrange the pixel positions in the plain image. Finally, a diffusion process is proposed, utilizing XOR operations and keystreams created from the pseudo-random sequence to alter the pixel values, resulting in a visually distinct cipher image. Performance analysis of the proposed algorithm indicates resilience to various cryptanalysis and robust security, as it is sensitive to both secret keys and plain image. Additionally, the proposed decryption algorithm demonstrates the ability to reconstruct the original image with good quality from a cipher image, despite data changes or losses.