Filetype: jpg, jpeg, png, tif, tiff, bmp, webp, psd, psb. Usage: main.py ] ] ] ] ] Python script that convert images to a certain dpi, max long side resolution and rgb color space. To run the script two modules are required (listed inside requirements.txt): Python version equal or greater than 3.9 must be installed before following the instructions paragraph. During the saving phase, the script sets the dpi to 72.ĭefault: main.py -dpi 72 -size 1000 -filter 0 -no-colorspace -quality 80 -optimize -alert -wait Requirements If the images are in other filetypes except png and jpeg (jpg) then it converts them to the latter and delete the original ones (otherwise it overwrites the file in jpg or png). Maximum images resolution allowed in Megapixel: 0 (None).īy default the script try to open the images, check the dimension are downscale them to fit into 1000x1000 pixel box if bigger (no upscaling) using the Nearest filter.Color space: No color space conversion to RGB.Filter: Downscale filter used is Nearest.Size: downscaling if bigger than 1000x1000 while mantaining the same aspect ratio.Path: the folder where the script is located.Convert images that are not in jpg, jpeg and png filetype into the former.If there are no arguments given to the script, the following is the normal behaviour: Warning: psd and psb file types have not been fully tested.īatch Image Converter search recursively for all recognized images inside the path (included subfolders) and converts them. The following formats are recognised: jpg, jpeg, png, tif, tiff, bmp, webp, psd, psb. It also prints out a list of all corrupted images and any other files found. There is the possibility to convert all images to the RGB colour space (Important: ICC colour profiles are not used for this conversion so switching between different formats may result in incorrect colours). Simple script written in Python that converts all images found within the folder where the script is located (and all sub-folders) if the images are not in png or jpg (and jpeg) type, then it converts them to the latter one.Īmong the options there is the possibility of setting the quality, the maximum resolution in pixels of the long side of the image while maintaining the aspect ratio (without upscaling if smaller) and changing the dpi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |