Logo by stardust4ever - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 16, 2024, 07:20:51 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Determining color  (Read 3329 times)
0 Members and 1 Guest are viewing this topic.
Duncan C
Fractal Fanatic
****
Posts: 348



WWW
« Reply #15 on: January 21, 2011, 08:00:20 PM »

I see what you are saying but using HSLToColor works exactly the same.
For example if the outcome of (Iterations * CAmount) is 173, you would have
HSLToColor(173, 100, 50). It is above 100 so it automatically wraps around and makes the same color as HSLToColor(73, 100, 50)
So any number, even 20945820958 can be plugged into it.

This is an old post. Not sure if you're still looking for updates.

What you need to do is come up with a non-linear mapping from iteration number to pixel color.

The rate of change in iteration value over distance for high iteration pixels is MUCH higher than the rate of change for low iteration pixels. If you use a linear color change, the color change is too gradual at low iteration values and way too large for high iteration areas. As a result, the highest iteration parts of your plot get a riot of colors that your eyes can't make sense of.

It helps if you come up with a scheme where you generate a value from 0 to 1. At 0, you use the starting color. At 1, you use the end color.

One way to handle it is to use the log of the iteration number to calculate the color from start color to end color. You need a way to normalize the numbers so you can plot from start color to end color.


If you calculate the log of the lowest iteration value in the plot {log(min_iterations)}, and the log of the highest iteration in the plot {log(max_iterations)}, you can then calculate the color value for any pixel with color = (log(pixel_iteration) = log(min_iterations)) / (log(max_itrations) - log(min_iterations))

That gives you a value that varies from 0 to 1, where the value changes quite rapidly at the low iteration ranges in your plot, and much more slowly at higher iteration values, and thus reduces the amount of visual noise for high iteration pixels.

As the article you link says, an even better way is to use a histogram of the iteration counts in the image to calculate a color value. For any given pixel, you can use something like:

color = (sum of pixel count for all iteration values < pixel_iterations) / total_non_mandelbrot_pixels_in_plot.

That way, the lowest iteration pixel in the plot gets a color value of 0 (starting color.) The highest iteration non_mandelbrot pixel in the plot gets a color value of 1 (end color) and pixels in-between get a color that's proportional to the total number of pixels with a lower iteration value. This does a great job of evenly distributing color values.

I took a stab at recreating your plot using histogram-based colors in my App, FractalWorks. Here's the result:


Logged

Regards,

Duncan C
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Color bands Mandelbulb 3d bib 6 1593 Last post March 10, 2011, 10:23:13 PM
by marius
It's all about color Mandelbulb 3d chaos_crystal 4 1770 Last post March 07, 2011, 07:32:54 PM
by Madman
Fine tune color Mandelbulber scheven_architect 2 1837 Last post May 02, 2011, 11:40:47 AM
by taurus
Map for the diffuse color Mandelbulb 3d mario837 5 1970 Last post August 30, 2011, 09:05:32 PM
by kameelian
Color Box Gestaltlupe Gallery trafassel 0 1194 Last post October 02, 2011, 08:32:30 PM
by trafassel

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.144 seconds with 24 queries. (Pretty URLs adds 0.004s, 2q)