Image colorization is the process of assigning different RGB values to each pixel of a given grayscale image to obtain the corresponding colorized image. In this work, we propose a new automatic image colorization method based on the modified cycle-consistent generative adversarial network (CycleGAN). This method can generate a natural color image with only one given gray image without reference image or manual interaction. In the proposed method, we first modify the original network structure by combining a u-shaped network with a skip connection to improve the ability of feature representation in image colorization. Meanwhile, we design a compounded loss function to measure the errors between the ground-truth image and the predicted result to improve the authenticity and naturalness of the colorized image; further, we also add the detail loss function to ensure that the details of the generated color and grayscale images are substantially similar. Finally, the performance of the proposed model is verified on different datasets. Experiments show that our method can generate more realistic color images when compared to other methods.