bugGNU Octave - Bugs: bug #37712, rgb2ind does not return a colormap


bug #37712: rgb2ind does not return a colormap

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Sun 11 Nov 2012 04:54:25 AM UTC  
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Wed 28 Nov 2012 07:17:26 PM UTC, comment #2: 
Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Thu 15 Nov 2012 06:24:39 PM UTC, comment #1: 

The previous changeset did fix the problem but there was a very very noticeable slow down of the code. The changeset 37a21f6 from https://bitbucket.org/carandraug/octave/ fix this. The code is much much faster and also much more readable (thanks Jordi).

Please pull changesets 89c8d8f and 37a21f6 from there.

Carnë Draug <carandraug>
Project Member
Sun 11 Nov 2012 04:54:25 AM UTC, original submission:  


the colormap returned by rgb2ind is not an actual colormap as its values are the ones in the original image. But a colormap need to be rescale as it must be of class double and its values between [0 1].

When fixing this I noticed another problem. For each image point, a new entry on the colormap is created rather than finding the unique combination of values and indexing them. I have a patch that fixes both of this problems and also increases some matlab compatibility by checking the correct class.

Please see changeset 89c8d8f8f87b from https://bitbucket.org/carandraug/octave/

Pretty much only the documentation and input check is left from the original file.


Carnë Draug <carandraug>
Project Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by carandraug (Submitted the item)

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

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-11-28 jordigh StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2012-11-12 jordigh StatusNone => Patch Submitted

    Back to the top

    Powered by Savane 3.5