Below is sample code that can be run in the Mac terminal. I don't have code that will work for all use cases written up, but I'm happy to help people get code that will work for their needs. Sometimes you want to rename a bunch of files so that their names correspond to dates. For instance, the line mogrify -path output -format tif -resize 1200x8000 *png changes all the PNGs in your current folder to TIFFs, resizes them to fit inside the rectangle of width 1200 px and height 8000 px, and saves them to the 'output' folder. You can combine these functions if you want to resize and change format on a folder of images. Similarly, running the line mogrify -resize 1200x8000 -path output *jpg will convert all the JPG files in your current folder to fit inside a rectangle of size 1200x8000 and save the result to the 'output' directory.For all but very, very tall images, this will be the same as changing the width to 940 px (and if you comic is very tall, just replace 8000px with a higher number until it works). Typing the line mogrify -resize 940x8000 -path output *png into your command window and pressing enter will take all the PNG files in your current folder, resize them to the largest size that fits inside a rectangle of width 940px and height 8000px, and save the outputs to the 'output' folder. With the resize flag, you specify a size and the image is resized to fit (not fill) that size. To change the image size, we're going to use the -resize flag.Type mkdir output to create a folder called 'output' where the new images will be saved.Use cd to navigate to the folder containing the images you want to convert.
0 Comments
Leave a Reply. |