Created
January 27, 2020 05:07
-
-
Save dangpzanco/4e09ed191016784519550ad3eba92349 to your computer and use it in GitHub Desktop.
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
import pathlib | |
import tqdm | |
import imageio | |
# import PIL.Image | |
# PIL.Image.MAX_IMAGE_PIXELS = 933120000 | |
# input_path = pathlib.Path('Starry Night.jpg') | |
input_path = pathlib.Path('Starry Night (small).jpg') | |
im = imageio.imread(input_path) | |
image_folder = input_path.with_suffix('') | |
image_folder.mkdir(parents=True, exist_ok=True) | |
for i in tqdm.trange(100): | |
image_path = image_folder / f'image{i}.jpg' | |
imageio.imwrite(image_path, im, format='jpg', quality=100-i) | |
im = imageio.imread(image_path) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment