|
From: Daniel J S. <dan...@ie...> - 2015-07-03 05:00:46
|
On 07/02/2015 04:29 PM, Juhász Péter wrote:
> Dear.all;
>
> Consider the result of the following script (on full screen if
> possible):
>
> #####################
> cutoff = 300
> set palette defined \
> (0 'white', cutoff-1 'pink',\
> cutoff '#7f0000', cutoff+5 '#ff0000',\
> cutoff+10 '#ff007f', cutoff+15 '#ff7f00',\
> cutoff+20 '#ffff00')
>
> set isosa 1000
> set xr [0:10]
> set yr [0:cutoff+20]
> set cbr [0:cutoff+20]
>
> plot '++' w image
> ######################
>
> This is actually a minimal version of a real script.
> The contrived looking palette is intended to show that variation in the
> data is only interesting as long as it's above the cutoff. The palette
> is rapidly changing above the cutoff, however, and this emphasizes the
> effect of the limited resolution of the colorbox.
>
>
> The culprit is apparently this line in
> draw_inside_color_smooth_box_bitmap in color.c:
>
> int steps = 128; /* I think that nobody can distinguish more colours
> drawn in the palette */
>
> Apparently this assumption is false, especially on large resolution
> bitmap terminals.
>
> Would it be sensible to adjust the number of steps based on the space
> available (yes, I guess, on bitmap terminals, but what about
> vector-based ones)? Or perhaps to make it user-settable?
I seem to recall that limitation and thinking 128 steps isn't much.
Other than the number of steps being limited by the size of the palette
(having more steps would mean interpolation that doesn't add any
detail), there shouldn't be a limit. As with sampling in general, the
step size should reflect the frequency content of the color components
of the palette. That is, a palette could be quickly changing at some
levels and inadequate step size at the level could result in some
noticeable artifacts. We don't want to deal with non-uniform sampling,
so increasing the number of steps would be the way to deal with that.
User settable with some reasonable default seems best to me.
set colorbox {steps N}
set colorbox {samples N}
?
Dan
|