from PIL import Image
img = Image.open('image.png')
rgb_img = img.convert('RGB')
rgb_img.save('image.jpg')
from PIL import Image
import glob
counter = 0
for image in glob.glob("./*.jpg"):
counter = counter + 1
img = Image.open(image)
img.save(str(counter)+'new_image.png','png')