Mogrify is a tool from the imagemagick suite of programs and performs many actions such as resize and convert upon image files. In contrast to convert, another imagemagick tool, mogrify overwrites original image files.
Questions tagged [mogrify]
141 questions
103
votes
4 answers
Batch resize images and output images to new folder with ImageMagick
Current image folder path:
public_html/images/thumbs
Output image folder path:
public_html/images/new-thumbs
I have 10 video thumbs per video in current folder, named of image thumbs:
1-1.jpg
1-2.jpg
1-3.jpg
1-4.jpg
1-5.jpg…

richard
- 1,456
- 4
- 15
- 22
33
votes
1 answer
How to convert jpg files into png files with linux command? + Difficulty = Subfolders
I want to convert several jpg files into png files. As far as I know, one can use this command
mogrify -format png *.*
I have one problem, I have a lot of subfolders. Let's say a is my main folder and b,c and d are subfolders. The images are in the…

Merrythought
- 355
- 1
- 3
- 4
31
votes
2 answers
Resize image with mogrify without keeping aspect ratio
I feel silly for having to ask such a simple question, but I have spent the past hour having absolutely no luck whatsoever finding a solution to this. Everyone seems like they need to do the exact opposite of what I need to do.
My question is simply…

ozdrgnaDiies
- 1,909
- 1
- 19
- 34
21
votes
3 answers
ImageMagick: How to resize proportionally with mogrify without a background
I was following this example http://cubiq.org/create-fixed-size-thumbnails-with-imagemagick, and it's exactly what I want to do with the image, with the exception of having the background leftovers (i.e. the white borders). Is there a way to do…

cj5
- 785
- 3
- 12
- 34
12
votes
2 answers
How to use mogrify to crop an image
I would like to use the Linux' mogrify tool to remove the lower 20 pixels of several images with all different dimensions.
Example: Image width is 800px, image heigth is 600px. I would like to crop the image that the new size is 800x580px where the…

user1876422
- 457
- 2
- 5
- 13
8
votes
3 answers
using mogrify on lot of images gives error
I am using mogrify to resize the images in a directory using the following command
mogrify -resize 100x100 *.jpg
due to the huge number of images, I get the following error
/usr/bin/mogrify: Argument list too long
Any suggestions?
Thanks

Shan
- 18,563
- 39
- 97
- 132
7
votes
2 answers
Recursive Mogrify Script
Another question from a newbie linux scripter. I'm trying to batch mogrify all the files in a folder using this command
find -name "*.jpg" -exec mogrify -resize 320 -quality 75 {} \;
The command runs but nothing seems to happen.
Thanks in advance

Michael Farah
- 325
- 1
- 7
- 20
6
votes
1 answer
ImageMagick mogrify doesn't work
This works:
convert 005_R.JPG -fuzz 20% -fill white -opaque "#eceaeb" 005_R_magic.JPG
.. but this doesn't:
mogrify * -fuzz 20% -fill white -opaque "#eceaeb"
what am I doing wrong here?
Thanks!

eozzy
- 66,048
- 104
- 272
- 428
6
votes
1 answer
How to mogrify recursive folders compacting the files
I need to excute in ubuntu something like this:
find ./ -name '*.jpg' -execdir "mogrify -quality 50 *.jpg" {} \;
To compact all the *.jpg to 50% of your quality but this need to be recursive, because i have 1350 files in a long tree of…

FencherLC
- 161
- 1
- 5
6
votes
1 answer
Prevent ImageMagick from using indexed colors?
I have some PNG images with transparency. However, whenever I do any operations with ImageMagick on the image (e.g. cropping), it changes some of the images to be "indexed" color instead of RGB. The images that change are ones where there happens to…

DisgruntledGoat
- 70,219
- 68
- 205
- 290
6
votes
1 answer
ImageMagick JPEG quality/size
I'm using the following command to generate a thumbnail:
mogrify -resize 128x128 -quality 75 "some thumb file"
For a sample file:
If i don't specify quality 75, i get a 40Kb file
If i specify quality 75, i get a 36 kb file and it looks awful
The…

Marius
- 3,976
- 5
- 37
- 52
5
votes
1 answer
How can I avoid dropouts when using (imagemagick) `mogrify` to convert webp files to animated gif?
Using this code
mogrify -format gif *.webp
that I found in another forum
https://superuser.com/questions/1506337/batch-convert-webp-files-to-gif-files-offline/1506428 to convert a webp file, to an animated gif...
I was wondering if anyone else…

LOlliffe
- 1,647
- 5
- 22
- 43
5
votes
3 answers
Need to crop+resize ~300000 files. Runtime = 4+ days. How can I speed up my bash script?
I am working on creating a video timelapse. All the photos I took are .jpg images shot at 4:3 aspect ratio. 2592x1944 resolution. I want them all to be 16:9 at 1920x1080.
I have written a little script to do this, but the process is not very fast.…

Brian C
- 1,333
- 3
- 19
- 36
4
votes
2 answers
ImageMagick and mogrify crop
I have having problems getting a crop to work on an image (I have got the resize working fine)
The orginal image is x and after a resize:
mogrify -resize x75 /my/path/image.jpg
i can see the resize has worked properly after performing…

Lizard
- 43,732
- 39
- 106
- 167
4
votes
3 answers
Perform Resize and Fill canvas using Mogrify
The imagemagick site has a demo on this page: http://www.imagemagick.org/Usage/resize/#resize
I want to perform the action in this example:
convert logo: -resize 80x80\> \
-size 80x80 xc:blue +swap -gravity center -composite \
…

akoumjian
- 1,594
- 1
- 15
- 20