Hi,
You need always a readline and almost 1 read, as readline reads one line from the file and read gets a value from this line. When you have more than 1 value on the line, then you need more reads behind the readline, for example when your input file is:
9 4 3
2 6 2
You need 1 readline and 3 reads, the first gets value 9, the second value 4, the third value 3.
The exit is not necessary as the while ends when you reach end of file (or index has reached a value).
pixelimage(index) has to be declared. The read expects a variable, so you can declare it inside the procedure as a variable. From your previous post you declared it outside as a signal. Then you need to declare the pixelImage as a signal in the procedure parameter declaration and you can use a temp variable in the read and on the next line pixelImage(index) <= temp_var;
Devas