clear all; close all; clc; img=imread('colorbar.jpg');%('ngc6543a.jpg'); %img=mat2gray(img); %[0,1]; [m n dim]=size(img); imshow(img); %picture RGB img=double(img); R=img(:,:,1); G=img(:,:,2); B=img(:,:,3); %%RGB2YCbCr Y=zeros(m,n); % Cb=zeros(m,n);…