bugGNU Octave - Bugs: bug #42107, Image colors are inverted when...

 
 

bug #42107: Image colors are inverted when printing a plot to a file with FLTK

Submitted by:  None
Submitted on:  Sun 13 Apr 2014 12:09:42 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Andrea LazzarottoOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 18 Apr 2014 05:13:34 PM UTC, comment #4:

This was a problem with gl2ps which only accepts float inputs. Octave has to convert image formats, like uint8, to float before it delivers it to gl2ps and gl2ps wanted a different conversion than what we were doing.

I fixed it in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/3277514f36da). It will be a part of the next bug fix release 3.8.2.

Rik <rik5>
Project Administrator
Sun 13 Apr 2014 06:29:08 PM UTC, comment #3:

The problem is that the colors are being inverted. Rnew = 1 - Rold, Gnew = 1 - Gold, Bnew = 1 - Bold. Interestingly, this problem does not occur for indexed images. The following code works.

Rik <rik5>
Project Administrator
Sun 13 Apr 2014 04:20:43 PM UTC, comment #2:

With some more testing, I've found that this problem occurs for images with many different output formats (jpg, png, pdf, eps). It also does not depend on the overlay. The following is enough to demonstrate the bug.

Octave is probably invoking the gl2ps library incorrectly.

Rik <rik5>
Project Administrator
Sun 13 Apr 2014 04:02:53 PM UTC, comment #1:

Confirmed. This bug is present in all major branches that I tested including 3.4.X, 3.6.X, 3.8.X, and the development branch.

Rik <rik5>
Project Administrator
Sun 13 Apr 2014 12:09:42 PM UTC, original submission:

The attached example contains code which:

  1. shows a picture with imshow
  2. plots some data over it in blue
  3. displays the figure
  4. saves the figure to a file
  5. repeats the steps with GNUPlot

The figure display correctly on video, while the resulting output picture has a "correct" blue line, but inverted colors. This happens only with FLTK on my machine.

Expected result: I would expect to get a printed picture with correct colors, like GNUPlot does.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31160:  code.m added by None (310B - text/x-objcsrc)
file #31161:  rainbow.jpg added by None (19KiB - image/jpeg)
file #31162:  output_fltk.jpg added by None (44KiB - image/jpeg)
file #31163:  output_gnuplot.jpg added by None (42KiB - image/jpeg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Apr 2014 05:13:34 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sun 13 Apr 2014 04:02:53 PM UTCrik5StatusNone=>Confirmed
    Sun 13 Apr 2014 12:09:42 PM UTCNoneAttached File-=>Added code.m, #31160
      Attached File-=>Added rainbow.jpg, #31161
      Attached File-=>Added output_fltk.jpg, #31162
      Attached File-=>Added output_gnuplot.jpg, #31163

    Back to the top


    Powered by Savane 3.1-cleanup1