bugGNU Octave - Bugs: bug #46872, imread not loading certain indexed...

 
 

bug #46872: imread not loading certain indexed png correctly

Submitter:  Hari <kkharinarayanan>
Submitted:  Mon 11 Jan 2016 05:48:22 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Harinarayanan Open/Closed:  * Open
Release:  * 4.0.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 06 Apr 2022 11:06:59 PM UTC, comment #5: 

I am unable to recreate this bug using the attached images, is this already fixed?

Maged Rifaat <magedrifaat>
Mon 22 Feb 2016 05:50:11 PM UTC, comment #4: 

Just ran across bug #41584, this may be describing the same symptom as that one.

Mike Miller <mtmiller>
Group Member
Mon 22 Feb 2016 05:43:45 PM UTC, comment #3: 

Same here, and I can confirm that I can use "gm convert" to reformat the provided image to a full-color image file, and then imread loads it accurately.

Here is the output of "gm identify -verbose"


Image: problem_image_original.png
  Format: PNG (Portable Network Graphics)
  Geometry: 285x238
  Class: PseudoClass
  Type: palette
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      1 bits
    Green:    1 bits
    Blue:     8 bits
  Channel Statistics:
    Red:
      Minimum:                     0.00 (0.0000)
      Maximum:                 65535.00 (1.0000)
      Mean:                    25971.49 (0.3963)
      Standard Deviation:      32055.24 (0.4891)
    Green:
      Minimum:                     0.00 (0.0000)
      Maximum:                     0.00 (0.0000)
      Mean:                        0.00 (0.0000)
      Standard Deviation:          0.00 (0.0000)
    Blue:
      Minimum:                     0.00 (0.0000)
      Maximum:                 65535.00 (1.0000)
      Mean:                    20123.00 (0.3071)
      Standard Deviation:      16567.25 (0.2528)
  Colors: 5
    0: (255,  0,  0)          red
    1: (  0,  0,128)          navy
    2: (  0,  0,255)          blue
    3: (  0,  0,  0)          black
    4: (255,255,255)          white
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Filesize: 1.1Ki
  Interlace: No
  Orientation: Unknown
  Background Color: #FEFEFE
  Border Color: #DFDFDF
  Matte Color: #BDBDBD
  Page geometry: 285x238+0+0
  Compose: Over
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Png:IHDR.color-type-orig: 3
  Png:IHDR.bit-depth-orig: 4
  Date:create: 2016-01-08T12:57:34+05:00
  Date:modify: 2003-09-17T15:35:00+05:00
  Signature: 1991ee2b0e4f2f9ec5621aa95832eac73296ace27f66cd3308f34293efdb77f8
  Tainted: False
  User Time: 0.020u


Mike Miller <mtmiller>
Group Member
Tue 16 Feb 2016 02:22:15 AM UTC, comment #2: 

I can confirm that loading that figure with  imread  (in the prehistoric version of Octave I have at work) gives a matrix with only 0s and 1s.  I'm using fltk, but it is a reading problem, not a plotting problem.

For reference, Matlab correctly distinguishes values 0, 1, 2 and 3 in that image.

Lachlan Andrew <lachlan>
Wed 13 Jan 2016 02:34:30 AM UTC, comment #1: 

Looks like in the problem case that the color range might be too small so that both the dark blue and light blue are mapped to the maximum range value.  What graphics toolkit are you using?  E.g.,

octave:1> graphics_toolkit
ans = gnuplot

What commands to load?

Dan Sebald <sebald>
Mon 11 Jan 2016 05:48:22 AM UTC, original submission:  

upon loading the problem_image_original.png, the array has only two unique values as seen in problem_image_loaded.png.

The other two images are just for reference of an image which loads without any problems.

Please see attachments

Hari <kkharinarayanan>

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by magedrifaat (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by kkharinarayanan (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-22 mtmiller SummaryIncorrect loading of images imread not loading certain indexed png correctly
    2016-02-16 lachlan StatusNone Confirmed
    2016-01-11 kkharinarayanan Attached File- Added problem_image_original.png, #35980
        Attached File- Added no_problem_image_original.png, #35981
        Attached File- Added problem_image_loaded.png, #35982
        Attached File- Added no_problem_image_loaded.png, #35983

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code