Im doing a project on ppm files where i have to take a image and make it grayscale and flip the image. the method is to take the average of the numbers.
P3
255
....
200 200 200
300 300 300
Thus the average would be 200, and 300.
Averages=[200,300]
for i in averages:
print(str(i)*3,"\n")
this gives me
200200200
300300300
How do i make it look like the original? My methodology is read each line as a string convert to list then take sum and average of each list then output it like the original. is this good way of going about this question.
1 Answer