octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imread.m


From: Daniel J Sebald
Subject: Re: imread.m
Date: Tue, 15 Jul 2008 20:02:26 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Daniel J Sebald wrote:
On 15-Jul-2008, Thomas L. Scofield wrote:

| Just got your message about it being imshow. Can it be the source of | the problem I describe here, too?

Yes, I think the problem is that uint8 images of size MxNx3 are not
displayed properly by imshow.  For example, try this:

 imshow (uint8 (repmat (kron ((0:255)', ones (1, 200)), [1, 1, 3])))

It should show a smooth black to white gradient from top to bottom,
but I see the attached image instead.

I haven't updated to Mercurial and the latest code yet so can't put together a 
patch.  But I think I see what the problem is.  Perhaps a lower level routine 
no longer automatically ranges the data.  This test in imshow.m is true for 
your example:

 elseif (size (im, 3) == 3)
   if (ismember (class (im), {"uint8", "uint16", "double", "single"}))
     true_color = true;

This means it is to be an rgb image in "truecolor".  In that case, scaling of 
data is NOT done:

 ## Scale the image to the interval [0, 1] according to display_range.
 if (! (true_color || indexed || islogical (im)))

So, the questions are.  What does "truecolor" mean here?  Does it simply mean RGB?  Or 
does it mean RGB and no data scaling?  The help for imshow simply says that RGB.  If the data came 
from a file, I could see that no scaling should be applied.  (But that is already present as 
"indexed".)  But if the data comes from the command line, like John's example, I'd say no.

My thinking is that "true_color" should be removed from the scaling test above. 
 I don't think TrueColor images have any implicit scaling properties, just that a 
colormap is not used.

Dan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]