This feels a bit backwards to me
img = Image.new("RGB", (2400, 2400), "white") width = img.size[0] height = img.size[1]compared to this
WIDTH = 2400 HEIGHT = 2400 img = Image.new("RGB", (WIDTH, HEIGHT), "white")You can avoideliminate all the
floatcalls by putting this at the top, or bybecause you are using Python 3: where true division is the default.from __future__ import divisionforloops are generally preferred overwhileloops. A possible way to arrange the inner loop is this:z = 0 for iteration in range(MAX_COUNT): z = z**2 + c if abs(z) >= 2: fill = (255 - iteration, 255 - iteration, 255 - iteration) break else: fill="black" draw.point((col, row), fill=fill)