Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tiff to jpg in python

import cv2, os
base_path = "data/images/"
new_path = "data/ims/"
for infile in os.listdir(base_path):
    print ("file : " + infile)
    read = cv2.imread(base_path + infile)
    outfile = infile.split('.')[0] + '.jpg'
    cv2.imwrite(new_path+outfile,read,[int(cv2.IMWRITE_JPEG_QUALITY), 200])
Comment

PREVIOUS NEXT
Code Example
Python :: openai gym random action 
Python :: how to make every letter capital in python 
Python :: regex for digits python 
Python :: envScriptsactivate.ps1 : File 
Python :: inplace pandas 
Python :: python nested list 
Python :: encrypt password with sha512 + python 
Python :: python get column from grouped dataframe 
Python :: python datetime greater than now 
Python :: python i++ 
Python :: mutiple condition in dataframe 
Python :: check file existence python 
Python :: standardscaler 
Python :: install simple audio in python 
Python :: higlight words in python 
Python :: fill a column based on values in another column pandas 
Python :: how to reference variable in another file python 
Python :: python function with two parameters 
Python :: find commonalities in dictionary python 
Python :: python run code at the same time 
Python :: random.randint 
Python :: Select an element of a list by random 
Python :: django template add numbers 
Python :: pygame collisions 
Python :: yticks matplotlib 
Python :: installing private python packages from requirements.txt 
Python :: How to install packages offline? Ask Question 
Python :: how to encode emoji to text in python 
Python :: rust vs python 
Python :: python pass 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =