Python 3.6.3
How do i do the following without saving and loading the picture over and over again, is there a way to convert the image between the two formats? (Allowing me to only load the picture once at the beginning and save once at the end.)
from PIL import Image
import cv2
import numpy as np
img = Image.open(r'C:\Users\Chris\Desktop\programs\pic.jpg')
#modify picture using PIL functions
img.save(r'C:\Users\Chris\Desktop\programs\pic.jpg')
img = cv2.imread("pic.jpg")
#modify picture using cv2 functions
cv2.imwrite("pic.jpg", img)
img = Image.open(r'C:\Users\Chris\Desktop\programs\pic.jpg')
#modify picture using PIL functions
img.save(r'C:\Users\Chris\Desktop\programs\pic.jpg)')