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)
27 t = time.process_time()
28 im2=im.resize((256, 256))
29 im2.save("lena3.jpg",quality=quality)
30 elapsed_time += time.process_time() - t
32 print("time resize + pil",elapsed_time)
37 img = cv2.imread('lena.jpg')
42 t = time.process_time()
43 cv2.imwrite("lena4.jpg", img,[int(cv2.IMWRITE_JPEG_QUALITY), quality])
44 elapsed_time += time.process_time() - t
46 print("time cv2",elapsed_time)
51 t = time.process_time()
52 resized = cv2.resize(img, (256,256), interpolation=cv2.INTER_LINEAR)
53 cv2.imwrite("lena5.jpg", resized,[int(cv2.IMWRITE_JPEG_QUALITY), quality])
54 elapsed_time += time.process_time() - t
56 print("time resize + cv2",elapsed_time)
60 t = time.process_time()
61 proc=subprocess.Popen("scp lena4.jpg bilbo:/tmp", shell=True)
63 elapsed_time += time.process_time() - t
65 print("ssh normal",elapsed_time)
70 t = time.process_time()
71 proc=subprocess.Popen("scp lena5.jpg bilbo:/tmp", shell=True)
73 elapsed_time += time.process_time() - t
75 print("ssh reduce",elapsed_time)