← 返回命令列表

Linux command

mogrify 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Resize images in place

mogrify -resize [800x600] [*.jpg]

Convert format

mogrify -format [png] [*.jpg]

Rotate images

mogrify -rotate [90] [*.jpg]

Add watermark

mogrify -draw "text 10,10 'Copyright'" [*.jpg]

Compress quality

mogrify -quality [80] [*.jpg]

Strip metadata

mogrify -strip [*.jpg]

说明

mogrify modifies images in place. It's ImageMagick's batch processing tool. The tool transforms multiple images at once. Unlike convert, it overwrites originals.

参数

-resize _GEOM_
Resize geometry.
-format _FMT_
Output format.
-rotate _DEG_
Rotation degrees.
-quality _NUM_
Compression quality.
-strip
Remove metadata (EXIF, color profiles).
-crop _GEOM_
Crop the image to the given region (e.g. `100x100+10+10`).
-thumbnail _GEOM_
Faster resize that also strips metadata.
-flip / -flop
Mirror vertically / horizontally.
-trim
Trim uniform edges (e.g. whitespace borders).
-path _DIR_
Write output files to DIR instead of overwriting.
-auto-orient
Rotate by EXIF orientation so the image displays correctly.
--help
Display help information.

FAQ

What is the mogrify command used for?

mogrify modifies images in place. It's ImageMagick's batch processing tool. The tool transforms multiple images at once. Unlike convert, it overwrites originals.

How do I run a basic mogrify example?

Run `mogrify -resize [800x600] [*.jpg]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -resize _GEOM_ do in mogrify?

Resize geometry.