Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # python linux create sepia / high contrast / black&white images
- # from current images in directory
- import os
- ds = ['hi-con','sepia','bw']
- for d in ds:
- try:
- os.mkdir(d)
- except:
- pass
- for img in os.listdir("."):
- if ".jpg" in img.lower():
- print('Converting',img)
- hc_img = img
- sep_img = img
- gray_img = img
- os.system("convert -level 07%,87% "+hc_img+" ./hi-con/hi-cont-"+img)
- os.system("convert -sepia-tone 92% "+sep_img+" ./sepia/sepia-"+img)
- os.system("convert -colorspace Gray "+gray_img+" ./bw/Gray-Scale-"+img)
- else:
- print(img)
- print('?????')
Advertisement
Add Comment
Please, Sign In to add comment