Fixed bugs in color image generation (part 5).