more than 256 colors in colormap no longer working
Mostrar comentarios más antiguos
I wondered if anyone has seen this before?
if i use: figure; imagesc(randn(256)) colormap(jet(256))
the image is displayed as i would expect with 256 graduations in the jet color scheme.
but if i change to colormap(jet(300)) it starts to mess up the color map and if increase higher, I end up, eventually, with one colour in the color map.
This used to work fine, and still works on my linux versions of matlab (i think it's 2011a), but on the 64 bit version on windows (both 2011a and 2012a on windows 7) it messes up.
This is causing some grief as i have some plotting functions that use custom colormaps with a large number of colors which no longer work.
anyone any idea why?
Cheers
Richard
2 comentarios
Jan
el 6 de Sept. de 2012
Does this concern e.g. http://www.mathworks.com/matlabcentral/fileexchange/37971-colormaps-with-higher-bit-depth, which has been developped under 2012a?
Peter
el 14 de Oct. de 2013
The linked page that contained the answer has somehow been taken offline. Would anyone still have that answer?
Respuestas (2)
Doug Hull
el 6 de Sept. de 2012
1 voto
Currently, there is a 256 row colormap limit on the PC platform. The workaround is to manually reduce the colormap length, by consolidating colors that are "close enough" into one color. The Image Processing Toolbox contains routines for accomplishing this. Our developers are aware of this limitation and are investigating other possible workarounds.
1 comentario
Richard Smith
el 6 de Sept. de 2012
Richard Smith
el 10 de Oct. de 2012
1 voto
2 comentarios
Dennis
el 3 de En. de 2014
Thanks Richard Smith! Your workaround works for me as well (R2013b 64bit). I do think matlab should solve this issue with their default renderer...
John Ebersole
el 6 de Feb. de 2015
This is great! I've been looking for a while for this.
I perform gamma correction whenever I plot images, so for a PC with a gamma of 2.2, the following looks great:
imagesc(myimage); axis image; colormap(gray(8192).^(1/2.2)); set(gcf,'renderer','OpenGL')
If I only use 256 instead of 8192, deep grays turn black too easily.
Categorías
Más información sobre Blue en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!