StupidBeauty
Read times:801Posted at:Fri Oct 18 01:20:02 2013
- no title specified

转载:Batch Convert Images with Image Magick

使用ImageMagick中的mogrify命令可以批量地将图片转换成另一个格式。例如, mogrify -format pgm */*.gif 可将所有子目录下的gif图片转换成pgm格式。

http://lifehacker.com/342308/batch-convert-images-with-image-magick

亮点:

mogrify -format png *.jpg

What's your favorite way to batch image processing actions? Let us know in the comments.

Batch Convert Images Between Formats with Image Magick [Of Zen and Computing]

Discuss

Tyler Durden's Imaginary FriendGina Trapani

Begin IT support rant.

ImageMagick is a all-in-one package whose full featured capabilities come with a potentially very sour poison pill. Building ImageMagick requires libraries for image formats you may not have a need to support, and can be destabilized by changes to libraries for image formats you're not trying to use. If you're attempting to convert from PNG to JPEG, but your TIFF library has received an incompatible upgrade because of some other package, ImageMagick may stop working.

The netpbm package takes the opposite approach. Instead of an all-in-one package, netpbm established a generic non-optimized central data type (portable anymap, portable pixmap, portable graymap, and portable bitmap) and single function conversion tools to change formats between all manner of foreign data types and the netpbm data types, as well as manipulation tools to deal with images within the netpbm data types. With a series of tools in the netpbm package, you can take a JPEG, convert it to a pixmap, manipulate it in a whole myriad of schemes such as resizing, dithering, color alteration, cropping, and rotation, and then convert it back to a JPEG or any other supported image format. And, if something goes off and breaks your TIFF library, everything in netpbm that doesn't actually have to use the TIFF library will still work. 1/08/08 12:25pm

dognoseGina Trapani

I wouldn't use mogrify on images if you don't have backups.

Image Magick has other command line tools though, mainly "convert" which is what you should use in a case like this. combine it with 'find' if you need batch a bunch of images.

Resizing, rotating, adding borders and captions are all easy and could be one command. 1/08/08 12:18pm

da5id_nzGina Trapani

I do use Dash Command's new 'Image' plugin to resize images. You just select some images in explorer, start Dash and start typing 'image' and Image Resize comes up.

From there you can type in a percentage or the actual size you want (width or height, or both) and it converts - leaving the originals and creating new, resized ones with a slightly different filename. 1/08/08 12:35pm

jeffeb3Gina Trapani

I found some nautilus scripts somewhere, and they add the ability to right click on a bunch of images, and there's a choice to convert to jpg right there in the context menu. I'm sure it's just using image magic anyway, but I think it's more reliable than my command line (in general). 1/08/08 1:23pm

dognoseGina Trapani

@ZenBliss Your right that the -format option won't overwrite the original file in this case. However, mogrify will, in almost every other case, modify the original file. From the manual " Mogrify overwrites the original image file, whereas, convert writes to a different image file." 1/08/08 2:44pm

TonyAgudoGina Trapani

Wow, this is exactly what I needed! I have a load of BMP files created from a nice little MMOG I like to play(Second Life), and the 3rd-party vendor sites I use to sell stuff I make in-game don't like BMP format. Before this I had to open the files in GIMP, Eye of Gnome, or any other image viewer and save it back in a different format(preferably PNG or JPG). Total waste of time. Now I just wrote up a little Nautilus script to batch-convert with just a few clicks.

Thanks, Gina! 1/08/08 7:03pm

dbrGina Trapani

ImageMagick can do a lot more than just converting image formats.

[neverfear.org] (Halo 3 Activity Map : Animated)

was a small project I did while ago, to animate a series of images into an animated video. Using ImageMagick I embedded the time the frame was from on the image (Taken from the filename, using the labeling tool.

I made the image sequence into a Quicktime file using Quicktime Pro, image I could have done this is in ImageMagick also. 1/08/08 10:12pm

da5id_nzGina Trapani

@dbr: I think you can do these kinds of conversions (frame to avi and back) with the excellent Bink from [radgametools.com]

It does all kinds of really cool conversions, and it's FREE! 1/09/08 1:36am

anjeshGina Trapani

I have used free xnview in several instances. Also have tried NConvert, command line batch utility for images; looks quite promising. 1/11/08 2:47am

LazarusGina Trapani

I still prefer Irfanview to batch convert. I feel that it gives me a chance to review what Im about to do before I potentially destroy a whole lot of images. 1/08/08 12:13pm

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4