Image Generation (Newton Raphson 2)

This is a continuation of the work in Image Generation – Newton Raphson 1 with a small update to add colours to the render.

From the polynomial order we know the number of roots we are going to find to automatically pick nice colours we pick the colours in HSV space which has 3 parmeters:

  • A hue – The main differentiator of colour, this runs form 0 to 360 in HSV space (0 and 360 being the same) we spead the roots out evenly and assign to each pixel the hue that it converges to (if it doesnt converge we set it to black)
  • A saturation – The intenisty of the colour this we set to full in our example
  • A value of how light / dark the colour is we set this to be proportionate to the number of iterations to converge out of the maximum.

Final Result.

(A colour image of the iteration time of z^6 + 20z^3 = -1)

This was relatively quick but seemed to work well. I could look at some other colour mappings from the roots and values to get interesting effects at some point.