Software

ImageMagick

Image compression tool

ImageMagick

ImageMagick is one of the excellent tools for image compression.

What is ImageMagick?

  • ImageMagick (Official): https://imagemagick.org/index.php
  • Free and open-source software used for editing and manipulating digital images.
  • Can be used to create, edit, compose, and convert bitmap images.

ImageMagick

Test Environment

  • PC: MacBook Pro (16-inch, 2019)
  • OS: Sonoma 14.7.2
  • Terminal: zsh

Installation

Open Terminal and install ImageMagick using the package manager Homebrew

brew install imagemagick

Check version

magick --version

The Neil’s encoding introduced in FabAcademy is as follows.

Neil’s encoding

  • list formats:
    • convert -list format
    • JPG: high compressed
    • PNG: less compressed

convert PNG to JPG:

convert input.png output.jpg

convert all PNGs to JPGs:

mogrify -format jpg *.png

convert SVG to PNG at 1000 DPI:

convert -density 1000 -units PixelsPerInch input.svg output.png

compress JPG to quality 50% width 1000:

convert input.jpg -quality 50% -resize 1000 output.jpg

compress all JPGs to quality 50% width 1000:

mogrify -quality 50% -resize 1000 *.jpg

Contact

If you have any questions about using ImageMagick, please feel free to ask our staff.