How do you use the convert command in Linux?
The convert command is a part of the ImageMagick software package, used for converting image files, resizing, rotating, and other operations. Here are some common uses of the convert command:
- Basic conversion: converting an image file into a different format of image file.
- Change the format of input.jpg to output.png.
- Resize: Adjust the size of the image file.
- Change the dimensions of input.jpg to 800×600 and save it as output.jpg.
- Rotate image: Rotate the image file by a specified angle.
- Change the orientation of input.jpg by 90 degrees and save it as output.jpg.
- Image cropping: trimming a portion of an image file.
- Crop input.jpg to a size of 400×300 pixels starting from coordinates (100,50) and save it as output.jpg.
- Image merging: Combining multiple image files into one.
- Combine image1.jpg, image2.jpg, and image3.jpg horizontally into one image named output.jpg.
- Image transparency: making a specified color in an image file transparent.
- change the color red to transparent in the input.png file and save it as output.png
- Blurry image: applying a blur effect to image files.
- Change the input.jpg to output.jpg with a blur effect of 0x8.
The above are just some common usages of the convert command, for more options you can refer to the official documentation or view the help information by using the convert –help command.