This paper discusses the development of a new chaotic function (proposed chaotic map) as a keystream generator to be used to encrypt and decrypt the image. The proposed chaotic function is obtained through the composition process of two chaotic functions MS map and Tent map, with the aim of increasing data resistances to attacks. The randomness properties of the keystream generated by this function have been tested using Bifurcation diagrams, Lyapunov exponent, and NIST randomness analysis. All the analysis results indicate that the keystream passed the randomness tests and safe to be used for image encryption. The performance of the proposed chaotic function was measured by way of analysis of its initial value sensitivity, key space, and correlation coefficient of the encrypted image. This function can further increase the resilience against brute force attacks, minimizing the possibility of brute attacks, and has key combinations or key space of 1.05 Γ 10 959 that is much greater than the key space generated by MS Map + Tent Map of 5.832 Γ 10 958 . Finaly, quantitative measurements of encrypted image quality show an MSE value of 0 and a PSNR value of β. These values mean that the encrypted image data is the same as its original and both are also visually identical.