Sunday, June 22, 2008

Assign 9 Q1


Problem
Take thge images from Assignment 6 # 3 part(c) and convert them to an image with only 64 colors.
Do this by rounding the color values for every image so that each of the red, blue and green channels have values that are in the set {0, 85, 170, 255} (alternatively, if you are working with matrices with values between 0 and 1 then you will want to take your values to be 0, 1/3, 2/3 and 1. You will be representing the image by at most 4 x 4 x4 = 64 different colors.

Solution

pkg load image
cd c:\users\admin\pictures
A=imread("P1.jpg");
B=floor((A)/64)*85;
C=255*B;
imshow(C)

No comments: