I'd like to combine two byte arrays which represent images (so they're the same size) into a third byte array which will be the average of the two starting images. Here's the code I'm trying at the moment:
byte[] facemash = new byte[data1.length];
for (int i=0; i < data1.length; ++i){
facemash[i] = ((data1[i]/2)+(data2[i]/2));
}
What I'm getting in Eclipse is an error telling me 'Type mismatch: cannot convert from int to byte.' Can anyone see where I'm going wrong here?
Many thanks