Forrest logo
back to the mogrify tool

mogrify:tldr:43568

mogrify: Resize all JPEG images in the directory to 50% of their initial size.
$ mogrify -resize ${50%} ${*-jpg}
try on your machine

The command "mogrify -resize ${50%} ${*-jpg}" uses the "mogrify" utility from the ImageMagick software package to resize multiple image files.

Here is a breakdown of the command:

  • "mogrify": It is a command-line tool that allows you to modify and transform images. It is part of the ImageMagick software package, which is commonly used for image manipulation.

  • "-resize ${50%}": This option resizes the images. "${50%}" is a shell parameter expansion that resolves to 50% of the original size. So, it reduces the size of the images to 50% of their original dimensions.

  • "${-jpg}": This specifies the images to be resized. The "${}" is a shell parameter that expands to all the arguments passed to the command. In this case, it represents all the files in the current directory. "jpg" is the file extension or pattern filter, specifying that only files ending with the ".jpg" extension will be resized.

Combining these parts, the command will resize all the JPEG files in the current directory to 50% of their original size. The resized images will overwrite the original files.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mogrify tool