octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52624] gnuplot toolkit binary image is only b


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #52624] gnuplot toolkit binary image is only black pixels
Date: Tue, 12 Dec 2017 20:01:11 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #2, bug #52624 (project octave):

Binary images aren't allowed as RGB (i.e., 3-component) images, so that was a
red herring.

The attached patch should put the gnuplot toolkit in sync with the OpenGL
toolkits.  It turns out that for scaled images, the logical case is no
different than the integer case.  I.e., logical is {0,1} and clim indicates [0
1].  Run that through the formula and it always picks the first or last entry
of the colormap no matter the size.  I then also had to add one for the
"Direct" mode.

Here are some test scripts to put the various image data formats through their
paces relative to OpenGL:


close all;
monoimg(:,:,1) = toeplitz([0:5]) > 2;
graphics_toolkit fltk
figure
h1 = imshow(monoimg);
set(gca, 'ColorMap', jet(4));
set(h1, 'cdatamapping', 'direct');
graphics_toolkit gnuplot
figure
h2 = imshow(monoimg);
set(gca, 'ColorMap', jet(4));
set(h2, 'cdatamapping', 'direct');

close all;
dblimg(:,:,1) = toeplitz([0:5]);
graphics_toolkit fltk
figure
imshow(dblimg/5);
set(gca, 'ColorMap', jet(500));
h1 = imshow(dblimg);
set(gca, 'ColorMap', jet(4));
set(h1, 'cdatamapping', 'direct');
graphics_toolkit gnuplot
figure
imshow(dblimg/5);
set(gca, 'ColorMap', jet(500));
h2 = imshow(dblimg);
set(gca, 'ColorMap', jet(4));
set(h2, 'cdatamapping', 'direct');

close all;
intimg(:,:,1) = uint8(toeplitz([0:5]));
graphics_toolkit fltk
figure
imshow(intimg*100);
set(gca, 'ColorMap', jet(500));
h1 = imshow(intimg);
set(gca, 'ColorMap', jet(4));
set(h1, 'cdatamapping', 'direct');
graphics_toolkit gnuplot
figure
imshow(intimg*100);
set(gca, 'ColorMap', jet(500));
h2 = imshow(intimg);
set(gca, 'ColorMap', jet(4));
set(h2, 'cdatamapping', 'direct');


I've sat for a while thinking about the results, and I'm fine with most
everything except perhaps the "Direct" mode applied to integer data.  I'm not
sure if we should be adding 1 to the integer data (just as double data doesn't
have 1 added).  It might be only the logical case where we should add one. 
That is, rather than the image looking like the current appearance in the
attached add_one_to_integer_cdata.png, I wonder if it should look like the
appearance in attached file not_add_one_to_integer_cdata.png.

(file #42626, file #42627, file #42628)
    _______________________________________________________

Additional Item Attachment:

File name: octave-gnuplot_opengl_consistent_cmap-djs2017dec12.patch Size:1 KB
File name: add_one_to_integer_cdata.png   Size:1 KB
File name: not_add_one_to_integer_cdata.png Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52624>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]