20060224- All about pixel colors: Reference information

原文:http://blogs.mathworks.com/steve/2006/02/24/all-about-pixel-colors-reference-information/

In this posting I want to summarize all of the factors that control image pixel colors in MATLAB. This information is in the MATLAB documentation, but it is scattered around in several locations. If this is way too much detail for you, that's OK - just come on back next week!

image - CData dimensionality
  • If the image CData is three-dimensional, with the size of the third dimension equal to 3, then the CData values are taken to represent RGB values directly. No other image, axes, or figure properties affect the displayed colors. We sometimes call these "truecolor images."
  • If the image CData is two-dimensional, then the image display colors come from the figure colormap. CData values are used (either directly or in scaled form) as lookup indices into the colormap.
image - CData class
  • For truecolor images, the class of the CData array (uint8, uint16, or double) affects which values are displayed as white. The triple [0 0 0] is always black. For double CData, [1 1 1] is white. For uint8 CData, [255 255 255] is white. For uint16 CData, [65535 65535 65535] is white.
  • For direct indexed images, the class of the CData array affects the indexing operation. For double CData arrays, the value 1 corresponds to the first colormap color. For uint8 or uint16 CData arrays, the value 0 corresponds to the first colormap color.
image - CDataMapping

If the image CData is two-dimensional, then the image display colors come from the figure's colormap, and the image CDataMapping property controls how the colormap lookup is done.

  • If CDataMapping is 'direct', then CData values are used directly as lookup indices into the colormap.
  • If CDataMapping is 'scaled', then CData values are scaled to form lookup indices into the colormap.

For truecolor images, the CDataMapping property has no effect on the displayed pixel colors.

axes - CLim

If the image CData is two-dimensional, and if the image CDataMapping is scaled, then the two-element axes CLim property determines the scaling function. The first element gives the value that maps to the first colormap color, and the second element gives the value that maps to the last colormap color.
For truecolor images, or if the image CDataMapping property is 'direct', the CLim property has no effect on the displayed pixel colors.

figure - Colormap

If the image CData is two-dimensional, then all displayed pixel colors come from the figure Colormap.
For truecolor images, the Colormap property has no effect on the displayed pixel colors.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值