Adjusting color limits on displayed color images
When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white.When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white. When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white. imagesc, clim, cdata, colormap, impixelinfo, image MATLAB Answers — New Questions