Montage = montage.crop((0, 0, max_x, max_y))īasename = strftime("Montage %Y-%m-%d at %H.%M.%S.png")Įxedir = os.path.dirname(os.path.abspath(sys.argv))įilename = os.path. Max_y = max(max_y, offset_y + image.size) Max_x = max(max_x, offset_x + image.size) Height = sum(image.size + margin for image in images) Width = max(image.size + margin for image in images)*row_size The following lines have no effect, since the variables are overwritten / never used: width = 0Īll in all, the code could look like this: #!/usr/bin/env pythonĭef generate_montage(filenames, output_fn): Instead of having to update the counter i, you can change the for loop to for i,image in enumerate(images): montage.py, so you may want to use a abspath to allow the invocation from the current directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |