Smooth spectrum for Mandelbrot Set rendering

后端 未结 7 1988
梦毁少年i
梦毁少年i 2020-11-28 04:40

I\'m currently writing a program to generate really enormous (65536x65536 pixels and above) Mandelbrot images, and I\'d like to devise a spectrum and coloring scheme that do

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 05:31

    Seems simple to do by trial and error. Assume you can define HSV1 and HSV2 (hue, saturation, value) of the endpoint colors you wish to use (black and white; blue and yellow; dark red and light green; etc.), and assume you have an algorithm to assign a value P between 0.0 and 1.0 to each of your pixels. Then that pixel's color becomes

    (H2 - H1) * P + H1 = HP
    (S2 - S1) * P + S1 = SP
    (V2 - V1) * P + V1 = VP
    

    With that done, just observe the results and see how you like them. If the algorithm to assign P is continuous, then the gradient should be smooth as well.

提交回复
热议问题