function protRGB = protanopia(normalRGB) %PROTANOPIA Simulate an image with L-cone deficiency (protanopia). % % PROT = PROTANOPIA(RGB) % % Reference: http://www.tsi.enst.fr/~brettel/CRA24/table2.html cmaps = load('color_anomalies.mat'); % Convert the RGB image to an indexed image using the normal colormap. normalInd = rgb2ind(normalRGB, cmaps.normal ./ 255); % Convert back to an RGB image using the anomalous colormap. protRGB = ind2rgb(normalInd, cmaps.prot ./ 255);