Linux command
magick 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Convert image format
magick [input.png] [output.jpg]
Resize image
magick [input.jpg] -resize [800x600] [output.jpg]
Create thumbnail
magick [input.jpg] -thumbnail [100x100] [thumb.jpg]
Rotate image
magick [input.jpg] -rotate [90] [output.jpg]
Add text watermark
magick [input.jpg] -gravity south -annotate +0+10 "[text]" [output.jpg]
Batch convert
magick mogrify -format jpg [*.png]
Create montage
magick montage [*.jpg] -geometry +2+2 [montage.jpg]
说明
magick is the primary command for ImageMagick 7+, replacing convert, mogrify, and identify. It performs image manipulation including format conversion, resizing, and compositing. The tool supports over 200 image formats and provides extensive transformation capabilities.
参数
- -resize _geometry_
- Resize image.
- -crop _geometry_
- Crop image.
- -rotate _degrees_
- Rotate image.
- -flip
- Flip vertically.
- -flop
- Flip horizontally.
- -quality _n_
- JPEG/PNG quality.
- -strip
- Remove metadata.
- -colorspace _space_
- Convert colorspace.
- -density _dpi_
- Set resolution.
- -gravity _type_
- Positioning reference.
- -annotate _+x+y_ _text_
- Add text.
- -composite
- Combine images.
- -blur _radius_x_sigma_
- Blur the image.
- -sharpen _radius_x_sigma_
- Sharpen the image.
- -auto-orient
- Adjust orientation based on EXIF data.
- -format _type_
- Set output format (used with mogrify).
FAQ
What is the magick command used for?
magick is the primary command for ImageMagick 7+, replacing convert, mogrify, and identify. It performs image manipulation including format conversion, resizing, and compositing. The tool supports over 200 image formats and provides extensive transformation capabilities.
How do I run a basic magick example?
Run `magick [input.png] [output.jpg]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -resize _geometry_ do in magick?
Resize image.