Hi
I am trying to read a jpg file and write it out as ASCII text (so I
can use it to drive rtl). This is what my .m file contains.
***************************
clear;
rgb = imread('c:/testmathlab/flamingo.jpg');
imfinfo('C:/testmathlab/flamingo.jpg');
imshow(rgb);
imwrite(rgb,'c:/testmathlab/flamingo.ppm', 'Encoding','ASCII');
***********************************
I get the following in the .ppm file.
P3 2560 1920 255
46 51 28 33 38 16 21 24 3 16 19 2 17 17 5 20 17
10 23 20 15 28 20 18 32 23 24 30 20 21 27 17 16 25
Many lines like this and then the last 2 lines are like this
164 137 108 170 144 117 171 145 118 163 139 113 162 138 112 162 140
116 157 135 111
Wondering if
a) the values are listed as R,G,B..... or is it in some other order
b) I seem to get 17 values per line, how can I make it 16
c) The first line - what is P3; I can guess what the other things mean
but where is this documented. Could not find it easily enough.
d) is there another format I can use, I only need the ascii format so
I can see the values and drive a rtl module in modelsim
Thanks a lot for your help
ac