<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Colormap Manipulations</title>
	<atom:link href="http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-32142</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Fri, 25 Mar 2011 11:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-32142</guid>
		<description>Alex-

What I meant is that the colors weren&#039;t mapped to the full gray scale since X, the clown, only has values from 1 to 81, not 1 to 256.

--Loren</description>
		<content:encoded><![CDATA[<p>Alex-</p>
<p>What I meant is that the colors weren&#8217;t mapped to the full gray scale since X, the clown, only has values from 1 to 81, not 1 to 256.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Matyushov</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-32141</link>
		<dc:creator>Alex Matyushov</dc:creator>
		<pubDate>Thu, 24 Mar 2011 23:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-32141</guid>
		<description>Hi Lauren,

Why did you say this: &quot;Colormap is not double or not in the correct range (between 0 and 1).&quot;?

I loaded up the clown sample pic just like you did, and then I did:
&gt;&gt; figure, image(X), colormap(gray(256))
&gt;&gt; cmap = get(gcf,&#039;colormap&#039;);

The resulting image looks just like yours that you posted here. But the cmap variable is indeed of type double, and it does range from 0 to 1. 

Thanks</description>
		<content:encoded><![CDATA[<p>Hi Lauren,</p>
<p>Why did you say this: &#8220;Colormap is not double or not in the correct range (between 0 and 1).&#8221;?</p>
<p>I loaded up the clown sample pic just like you did, and then I did:<br />
&gt;&gt; figure, image(X), colormap(gray(256))<br />
&gt;&gt; cmap = get(gcf,&#8217;colormap&#8217;);</p>
<p>The resulting image looks just like yours that you posted here. But the cmap variable is indeed of type double, and it does range from 0 to 1. </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-31069</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 10 Feb 2010 19:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-31069</guid>
		<description>Scott-

&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html&quot; rel=&quot;nofollow&quot;&gt;Here&#039;s&lt;/a&gt; the doc for learning how to set graphics defaults.

--Loren</description>
		<content:encoded><![CDATA[<p>Scott-</p>
<p><a href="http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html" rel="nofollow">Here&#8217;s</a> the doc for learning how to set graphics defaults.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-31068</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Wed, 10 Feb 2010 19:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-31068</guid>
		<description>The default colormaps for version 4 and 5 are listed, but how do I change that default setting?</description>
		<content:encoded><![CDATA[<p>The default colormaps for version 4 and 5 are listed, but how do I change that default setting?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendan Hannigan</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-22669</link>
		<dc:creator>Brendan Hannigan</dc:creator>
		<pubDate>Wed, 05 Dec 2007 17:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-22669</guid>
		<description>Hi Eric, 

The values of MATLAB colormaps must be in the range [0..1].  You can see if you try to set one otherwise you will get an error:

close
f = figure(&#039;colormap&#039;,[1.1 1.2 1])
??? Error using ==&gt; figure
All colormap intensities must be between 0 and 1
&gt;&gt; 

As for the number of rows allowed in a grayscale colormap, it depends on the figure renderer.  By default, figures displaying images use the &#039;Painters&#039; renderer.  This renderer has the limitation that it cannot correctly display images with colormaps with more than 256 entries in them.  You can see this in the following example:

close
size = 300;
im = repmat(1:size,size,1);
him = image(im,&#039;CDataMapping&#039;,&#039;direct&#039;);
set(gcf,&#039;Colormap&#039;,gray(size));
colorbar southOutside
&gt;&gt; get(gcf,&#039;Renderer&#039;)
ans =
painters
&gt;&gt;

Here you can see that the entries at the end of the colormap are not rendering correctly.  This limitation may be removed in a future version of MATLAB.

One solution is to change the figure&#039;s renderer property to either &#039;zbuffer&#039; or &#039;opengl&#039;, like this:

close
size = 300;
im = repmat(1:size,size,1);
him = image(im,&#039;CDataMapping&#039;,&#039;direct&#039;);
set(gcf,&#039;Colormap&#039;,gray(size));
colorbar southOutside
set(gcf,&#039;Renderer&#039;,&#039;zbuffer&#039;)

Now we see that the gradient goes smoothly all the way to the edge of the image, and the colormap entries beyond #256 are rendering correctly.

If you are displaying indexed images using the IMSHOW function, we check for this issue and change the renderer to &#039;zbuffer&#039; automatically when trying to display indexed images with long colormaps, like this:

close
size = 300;
im = repmat(1:size,size,1);
him = imshow(im,gray(size));
colorbar southOutside
get(gcf,&#039;Renderer&#039;)
ans =
zbuffer
&gt;&gt;

hope this helps!
Brendan</description>
		<content:encoded><![CDATA[<p>Hi Eric, </p>
<p>The values of MATLAB colormaps must be in the range [0..1].  You can see if you try to set one otherwise you will get an error:</p>
<p>close<br />
f = figure(&#8216;colormap&#8217;,[1.1 1.2 1])<br />
??? Error using ==&gt; figure<br />
All colormap intensities must be between 0 and 1<br />
&gt;&gt; </p>
<p>As for the number of rows allowed in a grayscale colormap, it depends on the figure renderer.  By default, figures displaying images use the &#8216;Painters&#8217; renderer.  This renderer has the limitation that it cannot correctly display images with colormaps with more than 256 entries in them.  You can see this in the following example:</p>
<p>close<br />
size = 300;<br />
im = repmat(1:size,size,1);<br />
him = image(im,&#8217;CDataMapping&#8217;,'direct&#8217;);<br />
set(gcf,&#8217;Colormap&#8217;,gray(size));<br />
colorbar southOutside<br />
&gt;&gt; get(gcf,&#8217;Renderer&#8217;)<br />
ans =<br />
painters<br />
&gt;&gt;</p>
<p>Here you can see that the entries at the end of the colormap are not rendering correctly.  This limitation may be removed in a future version of MATLAB.</p>
<p>One solution is to change the figure&#8217;s renderer property to either &#8216;zbuffer&#8217; or &#8216;opengl&#8217;, like this:</p>
<p>close<br />
size = 300;<br />
im = repmat(1:size,size,1);<br />
him = image(im,&#8217;CDataMapping&#8217;,'direct&#8217;);<br />
set(gcf,&#8217;Colormap&#8217;,gray(size));<br />
colorbar southOutside<br />
set(gcf,&#8217;Renderer&#8217;,'zbuffer&#8217;)</p>
<p>Now we see that the gradient goes smoothly all the way to the edge of the image, and the colormap entries beyond #256 are rendering correctly.</p>
<p>If you are displaying indexed images using the IMSHOW function, we check for this issue and change the renderer to &#8216;zbuffer&#8217; automatically when trying to display indexed images with long colormaps, like this:</p>
<p>close<br />
size = 300;<br />
im = repmat(1:size,size,1);<br />
him = imshow(im,gray(size));<br />
colorbar southOutside<br />
get(gcf,&#8217;Renderer&#8217;)<br />
ans =<br />
zbuffer<br />
&gt;&gt;</p>
<p>hope this helps!<br />
Brendan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Dick</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-22533</link>
		<dc:creator>Eric Dick</dc:creator>
		<pubDate>Sun, 02 Dec 2007 22:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-22533</guid>
		<description>Hi Loren,

I&#039;m interested in colormaps with respect to the imshow function.  What are the limitations, if any, on the number of grayscale shades that can be displayed with imshow (ie. is it limited to 255 bins from 0 to 1) ?

Thank You,

-Eric</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>I&#8217;m interested in colormaps with respect to the imshow function.  What are the limitations, if any, on the number of grayscale shades that can be displayed with imshow (ie. is it limited to 255 bins from 0 to 1) ?</p>
<p>Thank You,</p>
<p>-Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wang</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-16290</link>
		<dc:creator>Wang</dc:creator>
		<pubDate>Mon, 11 Jun 2007 15:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-16290</guid>
		<description>Hey Loren:
I just need to estimate the blur kernel of the images, as you know, if the image is m-by-n matrix, it&#039;s blur matrix is m-by-n by m-by-n sparse matrix. If we don&#039;t know the value of the blur kernel, we can only represent it as the symbolic format. Thank you very much.
Wang</description>
		<content:encoded><![CDATA[<p>Hey Loren:<br />
I just need to estimate the blur kernel of the images, as you know, if the image is m-by-n matrix, it&#8217;s blur matrix is m-by-n by m-by-n sparse matrix. If we don&#8217;t know the value of the blur kernel, we can only represent it as the symbolic format. Thank you very much.<br />
Wang</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-16289</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 11 Jun 2007 00:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-16289</guid>
		<description>Wang-

sparse only works on certain numeric types.  Can you describe your use case for needing sparse with symbolic variables?

--loren</description>
		<content:encoded><![CDATA[<p>Wang-</p>
<p>sparse only works on certain numeric types.  Can you describe your use case for needing sparse with symbolic variables?</p>
<p>&#8211;loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wang</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-16282</link>
		<dc:creator>Wang</dc:creator>
		<pubDate>Thu, 07 Jun 2007 03:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-16282</guid>
		<description>Hey Loren:
Do you know how to construct a sparse symbolic matrix, it seems sparse command doesn&#039;t support Syms Data
Thanks
Wang</description>
		<content:encoded><![CDATA[<p>Hey Loren:<br />
Do you know how to construct a sparse symbolic matrix, it seems sparse command doesn&#8217;t support Syms Data<br />
Thanks<br />
Wang</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/#comment-16029</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 31 Jan 2007 14:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=73#comment-16029</guid>
		<description>Jody-

Your request for multiple colormaps per figure is in our enhancement database and will be incorporated into a future release (not sure which one yet since that&#039;s only a piece of what the team is working on).

--Loren</description>
		<content:encoded><![CDATA[<p>Jody-</p>
<p>Your request for multiple colormaps per figure is in our enhancement database and will be incorporated into a future release (not sure which one yet since that&#8217;s only a piece of what the team is working on).</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

