bugGNU Octave - Bugs: bug #56175, "cdata" property should...


bug #56175: "cdata" property should be documented

Submitted by:  None
Submitted on:  Sat 20 Apr 2019 04:39:19 AM UTC  
Category:  Documentation Severity:  2 - Minor
Priority:  3 - Low Item Group:  Documentation
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open 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.


Mon 22 Apr 2019 04:33:55 PM UTC, comment #2: 

Matlab does the same thing, i.e., it produces a yellow square for the given input.

Rik <rik5>
Project Administrator
Sat 20 Apr 2019 09:09:36 AM UTC, comment #1: 

I don't know if it is properly documented somewhere in Octave's manual, but what you observe is expected, at least if your "rgb_img" is of type "double": in this case the range of useful values for rgb channels is [0 1] and thus "RGBdouble = [255 1 0]" is equivalent to "RGBdouble = [1 1 0]".

If the image was of type uint8, then 255 (intmax("uint8")) would be the saturation value and so on. Here is a script that demonstrates how color matrices are handled:

RGBdouble = zeros (4,4,3);
RGBdouble(:,:,1) = 1;
RGBdouble(:,:,2) = 1;

subplot (3,2,1)
imshow (RGBdouble)
title "Double type: R and G saturated"

subplot (3,2,2)
RGBdouble(:,:,1) = 255;
imshow (RGBdouble)

subplot (3,2,3)
RGBdouble(:,:,1) = 255;
imshow (uint8(RGBdouble))
title "Double type: R saturated"

subplot (3,2,4)
RGBdouble(:,:,1) = 1000;
imshow (uint8(RGBdouble))

subplot (3,2,5)
RGBdouble(:,:,1) = intmax ("uint16");
imshow (uint16(RGBdouble))
title "Double type: R saturated"

subplot (3,2,6)
RGBdouble(:,:,1) = 1e5;
imshow (uint16(RGBdouble))

I'll turn this report into a request for documentation, at least image's "cdata" property should be documented:

Changing title and other items accordingly.

Pantxo Diribarne <pantxo>
Project Member
Sat 20 Apr 2019 04:39:19 AM UTC, original submission:  

The following rgb_img matrix appears as a bright yellow image block although the red band has almost 100% of the energy?

>> rgb_img

rgb_img =

ans(:,:,1) =

   255   255
   255   255

ans(:,:,2) =

   1   1
   1   1

ans(:,:,3) =

   0   0
   0   0




(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 rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by None (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-31 mtmiller CategoryPlotting => Documentation
        Priority5 - Normal => 3 - Low
        Release5.1.0 => dev
    2019-04-22 rik5 SummaryImage "cdata" property should be documented => "cdata" property should be documented
    2019-04-20 pantxo CategoryNone => Plotting
        Severity3 - Normal => 2 - Minor
        Item GroupNone => Documentation
        StatusNone => Confirmed
        Operating SystemMicrosoft Windows => Any
        Summaryimshow doesn't show proper colours => Image "cdata" property should be documented

    Back to the top

    Powered by Savane 3.5