ImageMagick¶
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 hundreds of megabytes when cloning your project or viewing your website. Using this is also way faster than opening photoshop for every image you make.
How do I install it?¶
ImageMagick can be installed on arch based systems using:
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:
Image compression command examples¶
This image compresses the image and strips it of all it's details like date and location.
Same as above but resizes the image to 800 width and keeps the aspect ratio.
How to make a image smaller¶
Where 20% is placed you could also place anything else, For example 800x800 or just 800x then it will keep the aspect ratio.Batch conversion¶
For this project I take a lot of pictures and I don't wanna convert them one by one so i use this command to convert them all at the same time. Warning: It overwrites the files so make backups.
Rules for uploading images to git¶
Use jpg's instead of png. Jpg's are compressed and way smaller. Try to keep images under 200 kilobytes.