mirror of
https://gitlab.waag.org/make/fablab/interns/2025/sam.git
synced 2025-08-03 11:54:58 +00:00
ImageMagick docs
This commit is contained in:
@@ -1,15 +1,33 @@
|
||||
# Commands
|
||||
# ImageMagick
|
||||
|
||||
## Image compression
|
||||
## What is ImageMagick and why use it?
|
||||
ImageMagick is a tool to resize, convert or compress images. You can do all sorts of things with it. But right now we will be using it to compress images. So other people don't have to download hunderds of megabytes when cloning your project or viewing your website.
|
||||
|
||||
## How do I install it?
|
||||
ImageMagick can be installed on arch based systems using:
|
||||
```bash
|
||||
sudo pacman -Syu imagemagick
|
||||
```
|
||||
|
||||
## How do I use it?
|
||||
ImageMagick is a CLI tool so you need to use some kind of terminal. On arch based systems you can use it by typing `magick` after you've installed it.
|
||||
A ImageMagick command is build up with a input and a output and in between all the parameters for the conversion. Example:
|
||||
```bash
|
||||
magick imageInput.jpg -strip -quality 80% imageOutput.jpg
|
||||
```
|
||||
|
||||
## Image compression command examples
|
||||
This image compresses the image and strips it of all it's details like date and location.
|
||||
```bash
|
||||
magick source.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% result.jpg
|
||||
```
|
||||
|
||||
* Also resizes the image to 800 width
|
||||
Same as above but resizes the image to 800 width and keeps the aspect ratio.
|
||||
```bash
|
||||
magick customising_mkdocs.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -resize 800x customising_mkdocs.jpg
|
||||
magick source.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -resize 800x result.jpg
|
||||
```
|
||||
|
||||
## Sources
|
||||
* [installing ImageMagick](https://imagemagick.org/script/download.php)
|
||||
* [command source](https://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick)
|
||||
* [image resizing](https://legacy.imagemagick.org/Usage/resize/)
|
||||
|
||||
|
Reference in New Issue
Block a user