% HSI color components of a 4x4 RGB subimage
% RGB color components of a 4x4 HSI subimage
clear
%
xr=double([245  246  246  248;
  246  247  246  247;
  246  246  245  248; 
  248  247  246  248])/255; % normalized red component
xg=double([191  196  193  190;
  192  197  192  189;
  192  197  192  189; 
  192  198  191  188])/255; % normalized green component 
xb=double([222  225  223  223;
  223  226  223  222;
  223  225  222  222; 
  223  224  221  224 ])/255; % normalized blue component
%
hsi=rgb22hsi_fun(xr,xg,xb); % rgb to hsi
% HSI components of a 4x4 subimage
hsi_h= (hsi(:,:,1)) % H component
hsi_s= (hsi(:,:,2)) % S component
hsi_i= (hsi(:,:,3)) % I component
rgb=hsi22rgb_fun(hsi); % rgb to hsi
rgb=round(255*rgb)
