Add Colors to Black-White picture with DDColor

1 min readJan 27, 2024


DDColor can provide vivid and natural colorization for historical black and white old photos.

tried DDColor

In this post, I’ll introduce how to run DDColor on Google Colab free-tier, T4.

Step 1. Clone the repo & install dependencies

First we need to install dependencies and this step will take some time.

!git clone
!cd DDColor
!pip install -r requirements.txt
!python develop
!pip install "modelscope[cv]" -f

Step 2. Adding Colors to Image

import cv2
from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from google.colab.patches import cv2_imshow

img_colorization = pipeline(Tasks.image_colorization, model='damo/cv_ddcolor_image-colorization')
result = img_colorization('')
cv2.imwrite('result.png', result[OutputKeys.OUTPUT_IMG])



My Google Colab note is 👇




software engineer works for a Biotechnology Research startup in Brooklyn. #CreativeCoding #Art #IoT #MachineLearning #python #typescript #javascript #reactjs