-
-
Save dexhunter/60fcc4464da98232840c514338b44242 to your computer and use it in GitHub Desktop.
Convert all png images in current folder to jpg using OpenCV cv2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from glob import glob | |
import cv2 | |
pngs = glob('./*.png') | |
for j in pngs: | |
img = cv2.imread(j) | |
cv2.imwrite(j[:-3] + 'jpg', img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment