function newcol = prosim(oldcol)
  % Protanope simulation
  % Algorithm based on Vienot et al. 
  % http://vision.psychol.cam.ac.uk/jdmollon/papers/colourmaps.pdf
  % 
  % Usage: newcol = prosim(oldcol)
  %   
  % where oldcol is a colormap to be converted
  % e.g. projet = prosim(jet(12));
  %  
  % Ed Hawkins, 2014  
  
  % convert IJK to RGB 
  F=2.2;
  rgb=oldcol.^F;
  rgb2=rgb.*0.992052 + 0.003974;
  
  % convert RGB to LMS
  RtoL = [17.8824 43.5161 4.11935;
          3.45565  27.1554 3.86714;
          0.0299566 0.184309 1.46709];
  
  lms = RtoL*rgb2';
  
  % apply Protanope transformation in LMS space
  dtrans = [0 2.02344 -2.52581; 0 1 0; 0 0 1];
  lmsd = dtrans*lms;
  
  % convert back to RGB and then IJK
  rgbd = inv(RtoL)*lmsd;
  newcol = rgbd'.^(1.0/F);
  
  % ensure no values below zero or above one
  newcol=max(min(newcol,1.0),0.0);

  return;
  