Skip to content

Instantly share code, notes, and snippets.

@salihkaragoz
Last active January 26, 2018 06:17
Show Gist options
  • Save salihkaragoz/28ed2ba7c6264924308ee78033389c31 to your computer and use it in GitHub Desktop.
Save salihkaragoz/28ed2ba7c6264924308ee78033389c31 to your computer and use it in GitHub Desktop.
Convert PNGs to JPGs under a folder with opencv
# Written by MSK
import glob
import cv2
pngs = glob('./*.png')
for png in pngs:
img = cv2.imread(png)
cv2.imwrite(png[:-3] + 'jpg', img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment