This file contains hidden or 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 numpy, numba | |
| import os, pathlib, multiprocessing, subprocess, logging, math, uuid, json, time, argparse | |
| #Border Autocrop 2 R7 | |
| #Requires pyVips, Numpy, Numba | |
| #Requires external libVips library | |
| #Can resize images using Magic Kernel 2013 / 6 Sharp 7 | |
| #Run the script first time to generate JSON with settings | |
| #resizeMode 1 - Numpy MKS 67, 2 - Numpy Lanczos3, 3 - Numpy MKS2013, 4 - Vips Lanczos3 |
This file contains hidden or 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
| from PIL import Image, ImageChops | |
| import pathlib, multiprocessing | |
| inputPath = pathlib.Path("R:/CropResultPng/") | |
| outputPath = pathlib.Path("R:/") | |
| colorPart = "Color" | |
| monoPart = "Monochrome" | |
| upscalePart = "Upscale" | |
| colorThreshold = 20 |
This file contains hidden or 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 numpy, numba | |
| import os, pathlib, multiprocessing, subprocess, logging, math, uuid, json, time, argparse | |
| #Border Autocrop 2 R2 | |
| #Requires pyVips, Numpy, Numba | |
| #Requires external libVips library | |
| #Can resize images using Magic Kernel 6 Sharp 7 | |
| #Run the script first time to generate JSON with settings | |
| #resizeMode 1 - Numpy MKS67, 2 - Numpy Lanczos3, 3 - Vips Lanczos3 |
This file contains hidden or 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
| from PIL import Image | |
| import os, pathlib, multiprocessing, subprocess, logging, numpy | |
| #Border auto-crop R3-rel | |
| #Crops solid-color border from all sides of a picture (PNG/JPG), supports color pictures, outputs PNG and optionally converts to AVIF | |
| #Somewhat resistant to noise and JPEG artifacts | |
| #Multiprocessed | |
| #Auto-resizes pictures to fit a certain screen by width | |
| #Tested on Python 3.12.2, Pillow 10.3.0 and NumPy 1.26.4 |