Home > Back-end >  How do I apply a colormap between minimum and maximum pixel values in image?
How do I apply a colormap between minimum and maximum pixel values in image?

Time:05-22

I have an 8-bit image ('Example_image.tif') that I would like to pseudo-color using custom RGB values from a .csv file ('Pseudocolor_sheet.csv'). The colormap is for pixel values between 0 and 255, however, I would like to apply the all the colors between the minimum and maximum pixel values present in the image.

Currently, the code yields a grayscale image with the various shades (black/grays/white) applied between the minimum/maximum pixel values. I'm trying to figure out how to apply the colors in this range. Thank you! Here's what I have so far:

clc;
clear;
close all;

%Choose an image
[filename,filepath] = uigetfile({'C:\Users\'},'Select Example Image','*');
ExampleImage = imread(strcat(filepath, filename));

           
  • Related