madalin1990
Full Member level 2
I need help in converting a 256 colour image in an 8 colour image and the save the bits of this image in a file.This file will the be read using verilog function readmemh.
Here it is what I have so far:
-i have read the original image
-i think i converted it to 8 colours:
But now i do not know how to read the pixels to a file.
I would be grateful if someone could verify what i have so far and also tell me how to save these pixels.
Here it is what I have so far:
-i have read the original image
Code:
imfile = fullfile('griphon.jpg');
original_image = imread(imfile,'JPG');
figure('Name','RGB Truecolor Image')
imagesc(original_image)
axis image
zoom(0)
Code:
% % Convert RGB to an indexed image with 8 colors
[IND,map] = rgb2ind(original_image,8);
figure('Name','Indexed image with 8 Colors')
imagesc(IND)
colormap(map)
axis image
zoom(0)
But now i do not know how to read the pixels to a file.
I would be grateful if someone could verify what i have so far and also tell me how to save these pixels.