You need to install imagemagick. On Debian type: # apt-get install imagemagick
Simple command to convert a large number of images into jpeg-format. Will delete originals after conversion.
To resize photos without changing exif datas, pretty cool for gps tagging. (Require ImageMagick)
-geometry (preserves values of height and width given, and aspect ratio). WARNING: While 'resize' creates resized copies of original files, 'mogrify' works on the original files, replacing them. It will overwrite the source files, use with caution, and backup regularly.
mogrify can be used like convert. The difference is that mogrify overwrites files: http://www.imagemagick.org/www/mogrify.html Of course, other source colors can be used as well.
Just starting to get in love with mogrify.
Imagemagick library is used.
This command requires the imagemagick libraries and will resize all files with the .jpg extension to a width of 1024 pixels and will keep the same proportions as the original image.
That should be a short as it can get.
The input images are assume to have the "JPG" extension. Mogrify will overwrite any gif images with the same name! Will not work with names with spaces. Show Sample Output
Resizes all images in the curent directory to x resolution. It is better than `mogrify -resize *.jpg` because of independence from extension of image (e.g. .jpg and .JPG) (: Show Sample Output
- Backup data before reszie as it over write original -To preserve aspect ratio remove !
optipng *.png
http://www.mobileread.com/forums/showpost.php?p=147076&postcount=7
-dither FloydSteinberg produces a more uniform dither than the default.
The "find $stuff -print0 | xargs -0 $command" pattern causes both find and xargs to use null-delineated paths, greatly reducing the probability of either hiccuping on even the weirdest of file/path names.
It's also not strictly necessary to add the {} at the end of the xargs command line, as it'll put the files there automatically.
Mind, in most environments, you could use find's "-exec" option to bypass xargs entirely:
find . -name '*.jpg' -o -name '*.JPG' -exec mogrify -resize 1024">" -quality 40 {} +
will use xargs-like "make sure the command line isn't too long" logic to run the mogrify command as few times as necessary (to run once per file, use a ';' instead of a '+' - just be sure to escape it properly).
The find command can do this on it's own. This is a shorter faster version, it also includes more advanced regex (it will find .Jpg etc). Find doesn't need a pipe, you can run it directly from the command.
The mogrify command is also part of the ImageMagick suite, and is made to make changes to files in place.
Requires ImageMagick to be installed; mogrify is the lesser-known sibling to convert -- it overwrites your original images, but allows you to work on batches of files without resorting to a loop.
Converts all the png files in a directory to a bunch of gifs - changing only the file extension. Converts them in parallel - simply change the '4' to match the number of CPUs you have, or the number you want to dedicate to the conversion process.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: