bugGNU Octave - Bugs: bug #52401, color images too dark wth...

 
 

bug #52401: color images too dark wth graphics_toolkit gnuplot

Submitter:  None
Submitted:  Mon 13 Nov 2017 05:10:48 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  R.S:Carmenes Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 07 Dec 2017 06:50:11 PM UTC, comment #4: 

This bug should be fixed by the patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/d8626fd6bb36) that also fixed bug #52599.

It will be part of the 4.2.2 bug fix release scheduled for the end of this year.

Rik <rik5>
Group administrator
Mon 20 Nov 2017 07:59:23 PM UTC, comment #3: 

Sorry for the delay on addressing this.  I got to discussing this with the gnuplot developers, and the alteration and syntax chosen for gnuplot seemed clumsy so I guess I was hoping they'd see the sense in making syntax consistent, thereby avoiding changing something just to change it again a year from now.  This gnuplot mod has me wondering.

Dan Sebald <sebald>
Fri 17 Nov 2017 09:37:24 PM UTC, comment #2: 

The attached naif patch may be useful for those interested in showing or printing color images using graphics_toolkit gnuplot 5.2 and later until a proper patch is prepared by the developers. It works for me but I did not test it that much and cannot tell if this might have unexpected side-effects.

Ricardo.

(file #42418)

Anonymous
Mon 13 Nov 2017 05:52:56 PM UTC, comment #1: 

Thanks for looking into the source of the problem.  I'll inquire with gnuplot developers why the change then come up with a patch to apply.  The easiest solution might be to just add autoscaling to Octave, which would work for older and newer gnuplot, I think.

Dan Sebald <sebald>
Mon 13 Nov 2017 05:10:48 PM UTC, original submission:  

Hello,

Color images are far too dark when shown and exported using graphics_toolkit gnuplot. This equally affects imshow and imagesc, as well as any subsequent print, at least with octave 4.0.3 to 4.2.1, and with gnuplot 5.2.0 or later, including the current cvs version. However, colors are correctly shown with gnuplot 5.0.7 or earlier. Gray and B&W images are unaffected.

The following code reproduces the problem and generates a gnuplot file for testing.


graphics_toolkit gnuplot
I=uint8(zeros(16,16,3));
for i=1:16; I(i,:,1)=i*16-1; end
for i=1:16; I(:,i,2)=i*16-1; end
for i=1:16; I(:,i,3)=[i-1:15,0:i-2]*16+15; end
imshow(I)
drawnow('x11','/dev/null','debug.gp')


After investigating, all this is due to the change introduced in gnuplot 5.2.0 regarding the use of cbrange. See the gnuplot ChangeLog:


2017-08-22  Dima Kogan  <dima@secretsauce.net>

        * src/plot2d.c src/plot3d.c src/graphics.c (process_image):
        Do not apply cbrange to rgbimage data.  Do not use rgbimage range to
        autoscale cbrange.  For now this means that rgbimage color components
        must be in the range [0:255], as they are for png, jpeg, etc.


Currently, octave uses set cbrange [1:64]; but this has no effect on rgb images since gnuplot 5.2, resulting in dark color images with any output device when handled through the gnuplot engine. Therefore octave should be updated to cope with the new gnuplot specifications.

The fltk graphics toolkit shows color images correctly but seems unable to export them, so it is not (yet) a valid solution (at least for me).

Hope this can be fixed.

Ricardo.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42418:  gnucolor.patch added by None (492B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-07 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2017-11-17 None Attached File- Added gnucolor.patch, #42418

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code