Semester assignments for the course "Digital Image Processing" of THMMY in AUTH university.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
644 B

function q = imagequant(x, w1, w2, w3)
%imagequant quantizes the pixel values of a tri-chromatic image
% Usage q = imagequant(x, w1, w2, w3), where:
% Inputs
% - x is the input image who's values are going to be quantized
% - w1 is the quantization step size for the first channel (red)
% - w2 is the quantization step size for the second channel (green)
% - w3 is the quantization step size for the third channel (blue)
%
% Output
% - q is the image with the quantized values
q = struct;
q.red = myquant(x.red, w1);
q.green = myquant(x.green, w2);
q.blue = myquant(x.blue, w3);
end