2

On Windows 10, I need to crop and resize whole folders of images. Following the documentation and some answers here i've built this batch:

magick mogrify -path ./cropped -crop 1300x1940+85+130 +repage -resize "800x800^" *.jpg

It mostly works, but when a folder has mixed image formats (some are 24bpp, some are 8bpp, grayscale) this batch skips all the 8bpp ones.

How can i change my command so it accepts and modify every image, no matter what?

Note: i used mogrify as i understand it is needed to process a whole folder and save the result in another one, but i'm unsure it is necessary.

Parduz
  • 662
  • 5
  • 22
  • JPG does not support 8-bit images only 24-bit. What format are your 8-bit images? You can include other formats in the command *.jpg *.png *.bmp *.tiff etc or all files with just * in place of *.jpg. – fmw42 Jul 31 '22 at 16:16
  • Seems a JPG to me: https://imgur.com/axleHxL – Parduz Jul 31 '22 at 16:46
  • My mistake. I was thinking you were asking about 8-bit color. JPG can be grayscale 8-bits. Can you post an example image that is JPG and fails to process? – fmw42 Jul 31 '22 at 18:17
  • I tested some color and grayscale jpg image (smaller than yours) with a similar command and it works just fine for me. Is it possible that your crop goes outside some of your images? What version of IM 7? I was using IM 7.1.0.44 on Mac OSX Monterey. Works fine for me. – fmw42 Jul 31 '22 at 20:58

0 Answers0