Skip to content

Instantly share code, notes, and snippets.

@gireeshkbogu
Last active March 5, 2020 20:27
Show Gist options
  • Save gireeshkbogu/f2bf2fa35cc7c45dd4af6ee09d033248 to your computer and use it in GitHub Desktop.
Save gireeshkbogu/f2bf2fa35cc7c45dd4af6ee09d033248 to your computer and use it in GitHub Desktop.
Convert JPEG format to PNG
from glob import glob
import cv2
jpgs = glob('./*.jpg')
for image in jpgs:
img = cv2.imread(image)
cv2.imwrite(image[:-3] + 'png', img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment