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: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich 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:

Pulled and merged:


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 File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by carandraug (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Nov 2012 07:17:26 PM UTCjordighStatusPatch Submitted=>Fixed
    Mon 12 Nov 2012 03:33:19 PM UTCjordighStatusNone=>Patch Submitted

    Back to the top

    Powered by Savane 3.1-cleanup