clc;
clear
close all;
%%
I=rgb2gray(imread('peppers.png'));
my_file_org=imread('peppers.png');
figure,imshow(my_file_org);title('my org file')
figure,imshow(I);title('Gray Image');
[R,C]=size(I);
Block=zeros(R,C);
K(:,:,1)=Block;
K(:,:,2)=Block;
K(:,:,3)=Block;
for r=1:R
    for c=1:C
        Current_pixel=I(r,c);
        if     Current_pixel >= 0 && Current_pixel < 50      % FF0022 H ==> rgb(255,0,34)
            K(r,c,1)=255;
			K(r,c,2)=0;
            K(r,c,3)=34;
        elseif Current_pixel >= 50 && Current_pixel < 100    % 00FF00 H ==> rgb(0,255,0)
            K(r,c,1)=0;
			K(r,c,2)=255;
            K(r,c,3)=0;
		elseif Current_pixel >= 100 && Current_pixel <200    % 1100AA H ==> rgb(17,0,170)
            K(r,c,1)=17;
			K(r,c,2)=0;	
            K(r,c,3)=170;
        elseif Current_pixel >= 200 && Current_pixel <= 255  % 9922EE H ==> rgb(153,34,238)
            K(r,c,1)=153;
			K(r,c,2)=34;
            K(r,c,3)=238;
        end
    end
end
figure,imshow(K);title('Colored Image');