Code covered by the BSD License  

Highlights from
Color Image Compression / Decompression by using Hybrid Wavelet Transform and Cosine Transform

image thumbnail

Color Image Compression / Decompression by using Hybrid Wavelet Transform and Cosine Transform

by

 

Color Image Compression CIC2011 , by using Discrete Wavelet Transform and Discrete Cosine Transform

ColorData=Code_Color_Image_DWT_DCT(Im,Quantize,Save_Path,Wavelet_Name)
function ColorData=Code_Color_Image_DWT_DCT(Im,Quantize,Save_Path,Wavelet_Name)
% This fucntion is used for Compress Color image  Type RGB
% Color Image Compression (CIC2011)
% This function is represents new image compression algorithm
% Desinged by : Mohammed Mustafa Siddeq
% Date 28-Nov.- 2011
%-------------------------------------------------------------------------
% INPUT \
%     Im           :- RGB color image
%     Quantize     :- contains quntized values range = [0.01 - 0.1]
%                      for some images user can uses more 0.1 (i.e. range= [0.01 - 0.8])
%     Save_Path    :-  path for save compressed image
%     Wavelet_Name :- wavelet family name

% OUTPUT \ the output of this function is saved compressed RGB image, and
% "ColorData" which is represents Header compressed data contains all
% information about compressed file....

%-------------------------------------------------------------------------
% Example -1- (in this example the compressed image data are saved)
%    Im = imread('D:\image11.bmp');
%    Quantize=[0.01, 0.1, 0.1];
%    CompressedData=Code_Color_DWT_DCT(Im,Quantize,'c:\comp.CIC','db5');

% Example -2 - (in this example the compressed image data not saved)
%    Im = imread('D:\image11.bmp');
%    Quantize=[0.01, 0.2, 0.3];
%    CompressedData=Code_Color_DWT_DCT(Im,Quantize,'','db5');
%-------------------------------------------------------------------------

% See the decode function :- " Decode_Color_Image_DWT_DCT.m"
%-------------------------------------------------------------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%Im = imread('D:\lectures\images\image11.bmp');
% Save_Path='C:\mycolor.CIC';%%%%%%%%%%%%%%%%%%%%
% Wavelet_Name='db5';%%%%%%%%%%%%%%%%%%%%%%%%%%%%


YCC = rgb2ycbcr(Im); % convert RGB to Y Cb Cr 

Layer1(:,:)=YCC(:,:,1);
Layer2(:,:)=YCC(:,:,2);
Layer3(:,:)=YCC(:,:,3);

Y1=Image_code_DWT_DCT(Layer1,Quantize(1),'',Wavelet_Name); 
Cb=Image_code_DWT_DCT(Layer2,Quantize(2),'',Wavelet_Name);
Cr=Image_code_DWT_DCT(Layer3,Quantize(3),'',Wavelet_Name);

ColorData.Y1=Y1;
ColorData.Cb=Cb;
ColorData.Cr=Cr;

save(Save_Path,'ColorData');
%-----------------------------------------------------------
end

Contact us