1.6 KiB
Image Resizing on Mac with ImageMagick via Homebrew
This guide provides steps to install ImageMagick using Homebrew and resize an image on a Mac.
Installing ImageMagick
-
Open Terminal: You can find Terminal in Applications under Utilities or use Spotlight to search for it.
-
Install Homebrew: If you don't have Homebrew installed, execute the following command in Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install ImageMagick: Once Homebrew is installed, run this command to install ImageMagick:
brew install imagemagick
Resizing an Image
-
Navigate to Image Folder: Change the directory to where your image is located.
cd /path/to/your/image/directory -
Resize the Image: Use the
convertcommand from ImageMagick to resize the image. For example, to resize an image namedoriginal.jpgto a width of 600 pixels while keeping the aspect ratio, use:
convert original.jpg -resize 600x resized.jpg
This will create a new resized image named resized.jpg in the same directory.
Notes
- The
600xin the resize command specifies the width in pixels. The height will be adjusted automatically to maintain the aspect ratio. - If you want to overwrite the original image, use the same name for the output file.
- For more advanced options, refer to the ImageMagick documentation or use
man convertin Terminal to see the manual.
This guide should help you install ImageMagick using Homebrew and resize images easily on your Mac.