Hi, you need to save the return value of Image.create().
img = img.create(1200, 1200, false, Image.FORMAT_RGB8)