8 quality=int(sys.argv[1])
9 print("quality ",quality)
11 im=Image.open("lena.jpg")
15 t = time.process_time()
16 im.save("lena2.jpg",quality=quality)
17 elapsed_time += time.process_time() - t
19 print("time pil",elapsed_time)
26 t = time.process_time()
27 im2=im.resize((256, 256))
28 im2.save("lena3.jpg",quality=quality)
29 elapsed_time += time.process_time() - t
31 print("time resize + pil",elapsed_time)
36 img = cv2.imread('lena.jpg')
41 t = time.process_time()
42 cv2.imwrite("lena4.jpg", img,[int(cv2.IMWRITE_JPEG_QUALITY), quality])
43 elapsed_time += time.process_time() - t
45 print("time cv2",elapsed_time)
50 t = time.process_time()
51 resized = cv2.resize(img, (256,256), interpolation=cv2.INTER_LINEAR)
52 cv2.imwrite("lena5.jpg", resized,[int(cv2.IMWRITE_JPEG_QUALITY), quality])
53 elapsed_time += time.process_time() - t
55 print("time resize + cv2",elapsed_time)
60 t = time.process_time()
63 proc=subprocess.Popen("scp lena2.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
66 elapsed_time += time.process_time() - t
67 print("ssh normal",elapsed_time)
71 t = time.process_time()
74 proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
77 elapsed_time += time.process_time() - t
78 print("ssh reduce",elapsed_time)