Would rewriting my code in C help reduce RAM usage?
The simplest approach to reducing RAM usage of the program shown is to get rid of the three 128-byte pixel arrays.  They are not needed for the program to function.

Instead of writing

pixelsArray1[i]=analogRead(A1)/4;
pixelsArray2[i]=analogRead(A2)/4;
pixelsArray3[i]=analogRead(A3)/4;


write

if (analogRead(A1)/4 == 0 &amp;&amp; analogRead(A2)/4 == 0 &amp;&amp; analogRead(A3)/4 == 0) ++foundZero;


where foundZero is initialized to zero before the loop.  After the loop, you say something like

while (foundZero--) {
  digitalWrite(1, HIGH);
  delay(2000);
  digitalWrite(1, LOW);
  delay(2000);
}


to toggle pin 1 as many times as there were three zero pixels.

Note, the timing of the if (...) ++foundZero; statement may differ from pixel to pixel because the &amp;&amp; evaluation may short circuit.  If the timing matters, save data in temporary variables, or check if the sum of the three is zero, etc.