For the bit-level image encryption algorithms, pixel values and positions can be changed simultaneously. The operation can enhance the security of image encryption but will require the complicated calculations. Therefore, high security and suitable computation for a new algorithm are needed to be considered. In this paper, a novel image encryption algorithm, which combines the bit-level encryption and the pixel-level encryption methods, is proposed based on the cycle replacement. Firstly, a new 2-dimensional (2D) map with a hyperbolic cosine function (2D-Cosh map) is introduced, which has rich and complex dynamics. Based on the chaotic characteristic of the map, an image encryption algorithm is introduced via the substitution of bit of pixels which can scramble the pixels, and change the image pixel positions effectively. Numerical simulation and security analysis are used to demonstrate the effectiveness and feasibility of the algorithm. From which we can see that the correlation coefficients are almost 0, average entropy = 7.9973, average NPCR = 99.6104%, and average UACI = 33.4664%. It is clear that the algorithm is resistant to differential attacks, interference attacks, and can reduce the correlation of adjacent pixels of the encrypted image greatly. Meanwhile, the algorithm has no limit for the size of a color image in the process of the encryption.