Slashdot Mirror


The Definitive Guide to ImageMagick

Michael J. Ross writes "To modify a digital image, most computer users turn to a GUI-based image processing application, such as Photoshop. However, while Photoshop and many other similar programs can process multiple images in batch mode, they still require manual usage, and thus typically are unable to process images via a command line or within a second application. Those capabilities call for a programmatic digital image manipulation tool such as ImageMagick, which is explored in a relatively new book, The Definitive Guide to ImageMagick." Read the rest of Michael's review. The Definitive Guide to ImageMagick author Michael Still pages 335 publisher Apress rating 7 reviewer Michael J. Ross ISBN 1590595904 summary An introduction to using ImageMagick for digital image manipulation.

The author of this title is Michael Still, a programmer who gained experience with ImageMagick during his eight years of working on imaging applications, as well as writing articles on ImageMagick for IBM DeveloperWorks. Apress maintains a Web page for the title, where a visitor can purchase the electronic version of the book, read its table of contents, or download its source code or a sample chapter (Chapter 4 — Using Other ImageMagick Tools) in PDF format. They also have a link where readers can submit errata — and apparently be the first to do so, as there are no existing errata listed on the Web page.

The book's 335 pages are organized into a dozen chapters, following an introduction and a few other standard sections, including a forward written by ImageMagick's principal architect, Christy, who briefly explains the product's 20 years of history, development, and lack of decent documentation. That is where this book is intended to fill the gap, and Christy notes that most future questions about ImageMagick will be answered by pointing people to this book, as is also noted on ImageMagick's homepage.

The first chapter of the book explains how to install and configure ImageMagick, for several Linux distros, as well as Microsoft Windows — using the precompiled versions, or by compiling from ImageMagick's source code. The chapter is wrapped up with a brief description of ImageMagick's online help, debug output, verbose output, and version information. The next ten chapters fall into two categories: ImageMagick usage as a standalone, and from within other applications. The first category of chapters covers basic image manipulation, compression, other metadata, ImageMagick tools, artistic transformations, other image transformations, and drawing commands. The second category discusses how to utilize ImageMagick from within programs written in Perl, C, Ruby, and PHP. The 12th and final chapter is quite brief, and describes where to find online help (Web sites, blogs, mailing lists, and forums) and where to report any apparent bug in ImageMagick.

For Windows users, the first chapter may begin badly, as the author fails to explain which precompiled version the reader should select if they wish to install ImageMagick on a Windows PC. For each version, there are four flavors to choose from. But which one is right for the reader? "static" vs. "dll?" "Q16" vs. "Q8?" What are the differences? The ImageMagick Web site and FTP file listings appear to have no README file or installation help file to explain which flavor you should download. The book should provide some assistance here, but does not. The former topic, static versus DLL, is mentioned only in reference to compiling ImageMagick from source — information which the reader will probably never see, should they choose to install the precompiled binaries and get started on ImageMagick as quickly as possible.

The latter topic is not covered at all — not even in the index, where a "quantum depth" entry would be useful. For those readers who are interested, "Q8" indicates 8 bits-per-pixel components, and "Q16" means 16 bits-per-pixel. The latter allows one to read or write 16-bit images without losing precision, but requires twice as much resources as Q8. Apparently Q16 is the best choice for medical or scientific images, or those with limited contrast. Otherwise, Q8 should be sufficient, and offers greater performance.

The material most likely to be read, referenced, and valued in this book, is the chapters devoted to explaining how to use ImageMagick for resizing, compressing, transforming, and drawing digital images. Most of these first-category chapters begin with a concise summary of the theory put into practice throughout the rest of the respective chapter — a wise inclusion in each case, since even the most experienced computer programmers and other users have had no instruction or experience in image theory. All of these chapters do a competent job of explaining what each ImageMagick command is used for, and then illustrating it with a straightforward example.

The most glaring deficiency in these chapters, and the book as a whole, is that far too many of the book's figures (digital images, naturally) fail to reflect what is intended to be conveyed by each figure. This is primarily because they are all in black-and-white, and in many cases do not offer the size and resolution necessary. In other words, there are many cases where the "before" and "after" images look almost identical. In the cases of color manipulation, most of those black-and-white images are of little value — occasionally laughably so.

The second-category chapters, covering ImageMagick usage with Perl, C, Ruby, and PHP, proved disappointing, primarily due to their narrow focus, and lack of tips, recommendations, and coverage of the APIs' capabilities. The details are presented in the form of a single example for each language. For instance, the Perl chapter devotes too many pages to source code listings of a Perl program written by the author, that few readers would probably download from the publisher's Web site, much less read.

Nonetheless, this book should be useful to any programmer interested in making the most of ImageMagick's capabilities, and that is not just because it is the only ImageMagick book on the market. Michael Still certainly had his work cut out for him when he agreed to document the bulk of what ImageMagick can do. It is unfortunate that the color images that he created for the book cannot be seen by the reader, and that the Windows binary versions and ImageMagick APIs, were given short shrift. We can hope that future editions of this book will be significantly strengthened, such as including color and higher resolution images where needed — even if it requires grouping them together within the book, if that reduces production costs.

Lastly, it should be mentioned that, as a smaller technical publisher, Apress is not resting on its laurels, and is not only scheduled to release an impressive variety of programming books this year, but their customer support — at least in my experience — was outstanding, as there was a problem with the shipping of this title, and they bent over backwards to make it right.

Michael J. Ross is a freelance writer, computer consultant, and the editor of the free newsletter of PristinePlanet.com."

You can purchase The Definitive Guide to ImageMagick from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

173 comments

  1. yes, you can command line photoshop by Anonymous Coward · · Score: 4, Interesting

    Just create an action which does what you want, then you can export an "EXE" which takes as command line argument the file you want to process, and optionally, the output. Works like a charm.

    1. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 5, Insightful
      Oh, yes, that's much easier than
      for img in `ls *.jpg`
      do
        convert -sample 25%x25% $img thumb-$img
      done
      And the million other things you can do from the command line without making task-specific exes.

    2. Re:yes, you can command line photoshop by Black+Perl · · Score: 2, Informative

      Command-line control implies a bit more than creation of a canned .exe file. OK, let's say I need to automate the creation of graphical "Tabs" for a web layout. They have to contain text (determined at runtime from, say, a database), blended and drop-shadowed. Can I do this using the technique you mentioned? Nope. I can do it in imagemagick though.

      --
      bp
    3. Re:yes, you can command line photoshop by Short+Circuit · · Score: 2, Insightful

      On Windows, maybe. But what about Linux? And what are the license restrictions for including the exported EXE with other applications?

    4. Re:yes, you can command line photoshop by tpgp · · Score: 4, Insightful

      Just create an action which does what you want, then you can export an "EXE" which takes as command line argument the file you want to process, and optionally, the output. Works like a charm.

      Maybe the author should have said 'useful commmand line processing' or similar.

      1) Exes are not very useful for osx or linux users.

      2) You need a copy of photoshop for every server you wish to run your exported exe on.

      3) You have to create a different 'exe' for each action.

      Photoshop is not even slightly useful for the sort of areas that imagemagick excels in.

      --
      My pics.
    5. Re:yes, you can command line photoshop by base_chakra · · Score: 4, Informative

      Just create an action which does what you want, then you can export an "EXE" which takes as command line argument the file you want to process, and optionally, the output. Works like a charm.

      I've batch-processed sets comprising about 2,500–4,000 images (greyscale GIFs) both with command-line tools and with Photoshop CS. On each occasion, Photoshop took several hours longer than the specialized CLI apps to complete the jobs. The difference is even more dramatic when executing Photoshop Actions from within Photoshop, since the screen updates further increase processing time (an effect only slightly mitigated by hiding subwindows).

    6. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 0, Interesting

      You can even create Javascript based script files to automate Photoshop, this article writer is terribly missinformaed... You could even do this with Macromedia Fireworks long before Photoshop added this feature...

    7. Re:yes, you can command line photoshop by niskel · · Score: 0

      Except for when you run into an image with a space in the name :)

    8. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 2, Funny

      Real_men_don\'t_put_spaces_in_file_names.

    9. Re:yes, you can command line photoshop by SeeMyNuts! · · Score: 1


      This is why applications that can be scripted aren't always applications that should be scripted. Conversely, programs that are CLI from the beginning, like ImageMagick, work in scripts like a charm. These days, the simple UNIX shell is perhaps the most underrated tool for professionals, IMO (just don't get into quoting strings 3 deep, and it's great!).

    10. Re:yes, you can command line photoshop by niskel · · Score: 1

      Can you do that from a server? Can you do it for free? Can you do it for less specific tasks than a single custom EXE can do? Can you do it on platforms that aren't Windows or OSX?

    11. Re:yes, you can command line photoshop by pclminion · · Score: 4, Funny
      for img in `ls *.jpg`

      Am I the only person who laughed out loud?

    12. Re:yes, you can command line photoshop by garcia · · Score: 1

      You know, I don't know what the problem is but whenever I try to do a large batch (20 or so images) with ImageMagick inside a loop it hangs my machine. It only started happening when I upgraded to a 7MP camera and the images (not at full resolution either!) were in the 4.5MB range.

      Now I have to break the images up into batches of 5 and run the script each time for those. Bleh.

    13. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 5, Informative

      don't be a dummy

      for i in *jpg; do
        convert -sample 25%x25% "$i" "thumb-$i"
      done

      works perfectly with any special characters, including spaces and newlines, in the filename

    14. Re:yes, you can command line photoshop by lubricated · · Score: 1

      only after you pointed it out. I kind of scanned over it and missed it the the first time ;) .
      Yeah, that was a rookie move.

      --
      It has been statistically shown that helmets increase the risk of head injury.
    15. Re:yes, you can command line photoshop by kesuki · · Score: 2, Informative

      if you're using windows, and are taking directly from the camera or memory card, it's a bug in the Mass storage class driver.

      The MSC driver can hard lock (requireng removal of the USB device).

      If the problem happens no matter where you locate the images (local hd) then it've got no clue what your problem is. but from the sounds of it you've been using IM to parse pics from your cmaera directly to some local folder, likely the new camaera has faster memory that causes the MSC lock up issue (it does not happen with slower/older devices)

    16. Re:yes, you can command line photoshop by niskel · · Score: 3, Informative

      I was refering to the original script that used `ls *.jpg` instead of simply *.jpg. The original script will choke on images with a space in the file name.

    17. Re:yes, you can command line photoshop by temojen · · Score: 1

      I've got no problem with 85MB files (14MPix 16b tiffs). But when I do my 6x6 and 4x5 stuff I have to let it run all night (768MB RAM, Athlon 2600+, Linux 2.6).

    18. Re:yes, you can command line photoshop by foxtrot · · Score: 4, Interesting

      Am I the only person who laughed out loud?

      Probably not, but I think it's kinda silly. If you're on a machine where you're worried about spawning off one more process, I feel sorry for you. :)

      Remember, there's More Than One Way To Do It. That's kinda the beauty of Unix. I do like that 'for i in *.jpg' takes a lot fewer keystrokes, mind, but just because it uses fewer keystrokes and doesn't exec ls doesn't make it the Only Right Way.

      Indeed, for some things, it may not be the Right Way at all. Ferinstance:

      for i in `ls fullsize`
      do
      convert -scale 800x800 fullsize/$i $i
      convert -scale 150x150 fullsize/$i thumbnails/$i
      done

      It's cheaper to exec ls here than it is to crunch $i each time to strip 'fullsize/' off the front. If you really wanted to streamline it (and if you're that worried about it, why the heck are you writing a shell script?) you could throw $PWD at a temporary variable, cd into fullsize, run your converts, but why bother with the extra typing or lines of code when this runs correctly, makes sense, and is only exec'ing the ls once?

      But really what it boils down to, to me, is if exec'ing ls once instead of using the shell builtin * is causing problems on your system, you've got bigger problems than your shellscript-fu.

      -F

    19. Re:yes, you can command line photoshop by Mr.+Underbridge · · Score: 4, Funny
      works perfectly with any special characters, including spaces and newlines, in the filename

      Wow. Anyone who puts newlines in a filename should be beaten publically.

    20. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 1, Funny

      >convert /?
      Converts FAT volumes to NTFS.

      No! Argh! I don't want to do that!
      Anyway, with the demise of popular text adventures, it probably is easier for artists.

    21. Re:yes, you can command line photoshop by garcia · · Score: 1

      Straight from the local HD. Not from the memory card and not on Windows.

    22. Re:yes, you can command line photoshop by pclminion · · Score: 1

      What a long, strained, and ultimately pointless defense of an obvious GOOF. Congratulations, you've won the weekly Overthinking Award.

    23. Re:yes, you can command line photoshop by Arandir · · Score: 1

      A friend of mine uses Photoshop "batch" processing, and he is always cursing it. It is very slow, image DPIs are frequently messed up, and if the entire process frequently implodes if he puts any other load on the system. I showed him how to do the same thing in ImageMagick in only five minutes with flawless results. He said it was "too difficult". It takes him about a week to get a camera load of images up on the web. It takes me an hour, with 55 minutes of that hour being typing in the captions. Sigh.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    24. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 2, Informative

      As a long-time Photoshop user, I completely agree - exporting Actions as an .exe is useful in only a limited way.

      And I don't think Adobe would disagree with you. For large-scale image processing (including the ability to alter a Photoshop text layer dynamically), there is the Adobe Graphics Server (see http://www.adobe.com/products/server/graphics/main .html).

      It isn't cheap ($7500 per CPU, with a 2-CPU minimum I think). And it is only supported on Windows Server versions and Solaris. But it's the only product that I'm aware of that will do things with Photoshop-specific elements (layers, text layers, support for PDF or EPS, clipping paths & vector masks, etc.)

      Many of the big Content Management and Digital Asset Management make use of it (including the company that I work for) (see http://www.adobe.com/products/server/graphics/part ners.html.

    25. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 0

      You don't happen to be on an athlon machine using the amd768 chipset (k7d master-L for one) would you? I had a problem where if I read or wrote about 100 MB in under a second from the harddrive, the machine would crash.

      Turns out the '768 has an errata that basically reads "We don't know why but the 768 fucks up sometimes. This has never been observed on a machine with a PS/2 mouse plugged in." Sure enough, I plugged in a PS2 mouse (it just hangs there, I still use my USB mouse) and it never happened again.

    26. Re:yes, you can command line photoshop by ObsessiveMathsFreak · · Score: 1

      Wow. Anyone who puts newlines in a filename should be beaten publically.

      OK, before the riots begin, I've got dibs on the flogging stick.

      --
      May the Maths Be with you!
    27. Re:yes, you can command line photoshop by ObsessiveMathsFreak · · Score: 1
      for img in `ls *.jpg`


      Am I the only person who laughed out loud?

      Given the syntaxtical bedlam that is shell scripting, most who got the "joke" are long past the point of amusement.
      --
      May the Maths Be with you!
    28. Re:yes, you can command line photoshop by Heembo · · Score: 1

      Uh, like on Solaris in a web application enviornment where you are getting 1000 imageing requests a second? No way, in that scenario ImageMagick is one of the only tools that really wins. Sir, with respecet I say you are not tuned into what ImageMagick is really for!

      --
      Horns are really just a broken halo.
    29. Re:yes, you can command line photoshop by Tusaki · · Score: 1

      I love your sig :P

    30. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 0
      What a long, strained, and ultimately pointless defense of an obvious GOOF. Congratulations, you've won the weekly Overthinking Award.

      That's what makes us Nerds. What are you, some kind of Jock?

    31. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 0

      Care to share your wisdom with the command-line-uninitiated?

    32. Re:yes, you can command line photoshop by Old+Duck · · Score: 1
      How about:

      find -iname "*.jpg" -exec convert {} -scale 1024 {} \;

      I use this all the time to scale down photos from digital camera before emailing them to friends. Just be careful, as find by default will recursively search all child directories and thus could convert more than what you originally had in mind.

      --
      There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
    33. Re:yes, you can command line photoshop by mcphail · · Score: 1
      Try this in a dirctory with no .jpg files:
      for img in *.jpg; do
      echo "$img"
      done
      On my box, "*.jpg" is output. Now try:
      for img in `ls *.jpg 2>/dev/null`; do
      echo "$img"
      done
      which seems to do the right thing.
      --
      Testiculos habet et bene pendentes.
    34. Re:yes, you can command line photoshop by pclminion · · Score: 1

      That behavior can be modified with the "nullglob" setting (in bash, at least). I prefer wildcards to always expand, even if the expansion is empty, for exactly this reason.

    35. Re:yes, you can command line photoshop by pclminion · · Score: 1
      Basically, the AC's script uses a superfluous step to expand the file name list. Instead of

      for i in `ls *.jpg`

      He could have just used:

      for i in *.jpg

      As some others have pointed out, running ls in a subshell gets around the problem of what happens if there are no JPG files in the directory, but it also has its own problems, specifically when there are file names present which contain spaces.

      Another common goof (harmless, but still superfluous) is to type some complex, piped command which begins with an invocation of 'cat'. For instance:

      cat foo.txt | doohickey

      Can always be written as:

      doohickey < foo.txt

    36. Re:yes, you can command line photoshop by jkauzlar · · Score: 1
      Well, you have to do the detail-work on your own, but ImageMagick has an option to add text to an image using the font of your choice. Someone correct me if I'm wrong, but there isn't a drop-shadow option, and I'm not sure what you mean by blend.

      Personally, I'm having a bitch of a time trying to extract a portion of an image into a separate file w/ ImageMagick (and have the target image actually cropped). At this point, I don't think it can be done. Which is why I wish Gimp had a client-server interface for perl/python-fu. (Maybe they do?) That would be sooo awesome..

    37. Re:yes, you can command line photoshop by McDutchie · · Score: 1

      So, since we're having fun being nerdy and pedantic, here is a way that works even if there aren't any JPG files in the directory and even with JPG files with a different file name extension (or without any):

      file * | grep "JPEG image data" | cut -f 1 -d ":" | while read i; do
        convert -sample 25%x25% "$i" "thumb-$i"
      done

    38. Re:yes, you can command line photoshop by Anonymous Coward · · Score: 0

      Hi

      Just a thought: What if i gave u a picture named e.g.
      " ; rm * ; ".jpg

      Think the proper way is to use find with -exec

    39. Re:yes, you can command line photoshop by munpfazy · · Score: 1
      No it's not. You have to reach into Photoshop with 'javascript' in order to get any use of it at all. With imagemagick the whole toolset is a collection of standalone executables, which you can write scripts for in any imaginable scripting language.

      It's a significant difference.


      Yup.

      There's no comparison between the ease of use one gets by being able to call software from within a script rather than trying to run scripts from within a software suite.

      I'm always amazed at the amount of time the developers of gui-driven applications put into creating barely passable, complicated scripting languages. Every cad program seems to come with some arcane list of buggy, quirky script commands. For the vast majority of tasks, it ends up taking much longer to become familiar with their scripting language than to simply do things by hand. On those rare occasions when automation really is useful, I've so far always found it easier to generate some intermediate file format using a real language and then import it into the gui afterward.

      I use imagemagick a few times a year. Each and every time I more or less start from scratch. But within five minutes (the first two spent reading man pages) I can cobble together something that will do exactly what I want to any group of files. And, I can add filesystem manipulation, all the math functions one could dream of, and arbitrarily complicated string processing. It would take me twenty times as long just to get the basics of the photoshop scripting syntax.

      There's no internal scripting language on earth as powerful as "every language you can think of, including the ones you already know." (Well, with the arguable exception of emacs-lisp, if we want to stray dangerously close to a religious debate.)
    40. Re:yes, you can command line photoshop by ajs318 · · Score: 1

      That's because the PS/2 mouse hardware generates interrupts; the processor has to stop what it's doing in order to see what was trying to interrupt it and decide if or not it's important enough to deal with there and then or it can wait. This fraction of a second is just long enough to relieve whatever condition was causing the processor to foul up. My guess, since it involves reading and writing large quantities of data in a contiguous fashion, is some sort of race hazard where if two logic inputs change state in the wrong order, the output is not what you were expecting. But I Am No Chip Designer.

      --
      Je fume. Tu fumes. Nous fûmes!
    41. Re:yes, you can command line photoshop by ajs318 · · Score: 1

      $ convert -crop widthxheight+xoffset+yoffset filename1 filename2

      If you want to overwrite the original then use the more dangerous

      $ mogrify -crop widthxheight+xoffset+yoffset filename

      This book sounds as though it is very necessary.

      --
      Je fume. Tu fumes. Nous fûmes!
    42. Re:yes, you can command line photoshop by jkauzlar · · Score: 1

      Thanks, but I've had problems with 'crop' retaining the size of the original image, so that it's gray (or whatever) in all but the cropped area... been awhile since I've tried it, but believe me, I scoured every help file available.. yes, the book might be useful (but consider the scathing reviews on amazon..)

    43. Re:yes, you can command line photoshop by ajs318 · · Score: 1

      Well, that worked fine for me ..... maybe it's a problem your end? If it's worked before and you've since installed something that broke cropping, you probably need to check your libraries. Check the output of ldd on each of the main ImageMagick executables {probably in /usr/X11/bin/ or /usr/bin, but try something like which convert if you're not sure} and make sure the files referred to are OK. In the worst case, you may have to re-compile ImageMagick from source. If you aren't using your own distribution's specific source package, change the PREFIX to match wherever the old versions were installed, so they will be overwritten by the new ones.

      --
      Je fume. Tu fumes. Nous fûmes!
    44. Re:yes, you can command line photoshop by Glenn+R-P · · Score: 1

      Recent versions of ImageMagick retain the original dimensions when cropping
      and storing in an image format (PNG, GIF, others) that are capable of
      storing offsets. You can use the +page or +repage option to get rid of the
      offset info.

    45. Re:yes, you can command line photoshop by jkauzlar · · Score: 1

      Hey, thanks! This has been a roadblock for so long, I'd almost given up on imagemagick.. ah, progress.. now I can write the script that will save me hours of headaches :)

    46. Re:yes, you can command line photoshop by networkBoy · · Score: 1

      not so fast. It's killer on making those files inaccessable to mere mortals!
      I love linux and windows mismatch on filenaming. my samba server has tons of files that can't exist in windows land and thus my regular users don't muck with them (big shared drive in a lab).
      -nB

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  2. sigh ... ImageMagick again slides toward obscurity by Anonymous Coward · · Score: 0

    It's a shame. ImageMagick offers some absolutely excellent tools but they have never made the leap into the mainstream. I think they are like a really good sys admin -- 'ick makes things look easy and trouble free. Furthermore the 'ick folks are busy making things work and the doc's reflect that; there is also frame of reference problem -- the developers are so deeply on the inside they can't imagine users NOT knowing how to do basic things and understanding the basics of image types. ImageMagick is an old project and it shows in the attitude toward providing user information.

  3. Manual vs. Automatic by sdirrim · · Score: 1

    Why would one need batch-sized automatic image editing? Although I can see one wanting to edit many pictures at a time, I think that you would still need to manually specify what you want done, and where. Unless you wanted to do almost identical edits to many different pictures (read: destalinization), then the application seems not to have much use.

    --
    Not only "land of the free" but "land of the lawyers" who love a good old 1st amendment smackdown. Shihar 153932
    1. Re:Manual vs. Automatic by wanerious · · Score: 4, Informative

      As an example, in my previous job for a weather company, we'd generate large images of geographic data for a certain area of interest, and separately generate radar or satellite or lightning maps over the same area. We'd then use ImageMagick to combine all the separate images together, along with further generated warning areas, icons, and forecasts representing weather phenomena of interest (tornadoes, mesocyclones, hurricanes) and usually some sort of written annotation (time of image, source). ImageMagick was/is really useful.

    2. Re:Manual vs. Automatic by pilkul · · Score: 2, Informative

      Maybe you don't need it, but a lot of people do. For example, game developers often work with loads of images in similar formats. As a really simple example, you might want to convert a thousand files from gif to png. Or let's say you have 100 images containing blue text and you want to make the text white.

    3. Re:Manual vs. Automatic by Anonymous Coward · · Score: 0

      We convert millions of scanned images to various file formats each year, this is done in batch each day. I personally convert batches of photos with a single BASH line.

      Other applications link to ImageMagik to perform their tasks too.

      Just because you personally have no use (a windows use by any chance?), plenty of others do.

    4. Re:Manual vs. Automatic by syphax · · Score: 5, Informative

      Why would one need batch-sized automatic image editing?

      Examples of edits that don't need to be manual: Thumbnails. Resizing. Addition of timestamps/watermarks/copyright info. Conversion to other formats. Motion detection. Mosaics. Proof sheets.

      Gentle readers: just because something doesn't seem useful or make sense to you does not mean that it is categorically useless or senseless for everyone.

      --
      Simple Unexpected Concrete Credible Emotional Stories
    5. Re:Manual vs. Automatic by fan777 · · Score: 3, Interesting

      Automatic editing is especially useful for web applications where image manipulation occurs based on form choices or happens in the background e.g. thumbnails being created on the fly, allowing certain types of filtering, etc.

      In my senior year of college, we came up with a project to create an online photo storage and editing site much like Yahoo's Flickr. This site allowed users to crop photos, transform pictures to black and white, and adjust contrast amongst other things. We used ImageMagick to do all this, shooting in actions from the command line.

    6. Re:Manual vs. Automatic by prockcore · · Score: 3, Informative

      Why would one need batch-sized automatic image editing?

      How do you think flickr makes perfect square thumbnails automatically?

      convert in.jpg -thumbnail x200 -resize '200x' -resize 50% -gravity center -crop 100x100+0+0 +repage out.jpg

      Any website that takes a user-uploaded photo needs to do something to it. From thumbnails to capping the image size.

    7. Re:Manual vs. Automatic by Anonymous Coward · · Score: 0

      Daily newspapers running dozens if not hundreds of small images would benefit greatly from this type of automation. I work at one, I know. Newspapers today require very low overhead while achieving very quick turnaround.

      Photoshop is unmatched for what it does, but this is an area it was largely unintended for.

    8. Re:Manual vs. Automatic by novapyro · · Score: 1


        Why would one need batch-sized automatic image editing?



      Why indeed. My company operates on millions to tens of millions of images in a typical job. In fact, while ImageMagick is a wonderful tool, it is far too slow for our level of production. We use if to proof very small runs, or to test ideas. It is wonderful software. Now, as the poster suggests, our "edits" are repetitive, even algorithmic. And the need for such a thing is very, very common.

    9. Re:Manual vs. Automatic by ErikZ · · Score: 1

      I know a woman who draws a online comic. Each page is one large JPG, when a story arc is done, she zips them all up and uploads them to my server.

      I make her resize them all to 80% the original size, reducing the file size by quite a bit. I taught her how to batch processing in Photoshop to do this, but if she used linux, I would have set up something for her using ImageMagick.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    10. Re:Manual vs. Automatic by prockcore · · Score: 1

      Dang.. should preview my posts :)

      that should be -resize '200x<'

    11. Re:Manual vs. Automatic by temojen · · Score: 3, Informative

      If you're doing multiple transformations to the same file, PerlMagick is much faster than ImageMagick, since you only have to load and convert to internal format once for each file. One project I worked on thrashed badly as a BASH-ImageMagick script, but could be run in the background while the computer scanned (300 DPI, legal size, with a document feeder, 4ppm) as a PerlMagick script.

    12. Re:Manual vs. Automatic by Assassin+bug · · Score: 1

      Well, I havn't used ImageMagik for batch processing (although I'd like to). However, I have used Photoshop batch processing to perform serveral preprocessing steps for leaf-area analysis for entomological reasons. Also, I've used batch processing a lot for signing copyright information and watermarks for photographs and to downsize photos for posting on the web. If you deal with bulk images and have a painfully repetative task to perform on them, then batch processing is great!

    13. Re:Manual vs. Automatic by Todd1 · · Score: 1

      We use ImageMagick behind the scenes on our website to combine images of letters of the alphabet into name prints that are appropriately sized for printing. It's an incredible tool for that purpose.

    14. Re:Manual vs. Automatic by lscotte · · Score: 1

      Why would one need batch-sized automatic image editing?

      I do this all the time. I take all my digital camera pictures at camera res (2048x1536), but I scale them to 640x480 or 800x600 (depending) before posting. Sometimes it's just one or two pictures, sometimes it's a hundred. ImageMagick makes this incredibly painless and easy, not to mention quick.

      There's just one example...

      --
      This post is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
    15. Re:Manual vs. Automatic by Anonymous Coward · · Score: 0

      in my previous job for a weather company

      What sort of weather do you guys make? It's been a dreary February here in Michigan, I'm in the market for something sunny and 70-ish.

    16. Re:Manual vs. Automatic by CableModemSniper · · Score: 1

      Just a guess but I'm sure that if imagemagick was only good enough for small runs they would be aware of, and would have tried using the bindings to the library. (Whether C, Perl or whatever).

      --
      Why not fork?
    17. Re:Manual vs. Automatic by macemoneta · · Score: 1

      I batch process about 35,000 images each day to enhance the images before converting them into an mpeg2 video for DVD burning. ImageMagick also helps me validate each image (so I can replace the frame if necessary), without having to manually examine each one. Thank you ImageMagick.

      --

      Can You Say Linux? I Knew That You Could.

    18. Re:Manual vs. Automatic by Arandir · · Score: 1

      Gentle readers: just because something doesn't seem useful or make sense to you does not mean that it is categorically useless or senseless for everyone.

      Oh wow! My head is reeling in the implication of your wisdom! My whole world view is turning upside down. Must... fight... sanity...

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    19. Re:Manual vs. Automatic by Anonymous Coward · · Score: 0

      I write software for various advertising publications, where the image volume daily can be from 300 to 3000 images, required for the publications, web sites and other 3rd party systems. A single image can get processed out 10 times. After doing the math, I certain wouldn't want to do that by hand ;)

    20. Re:Manual vs. Automatic by plover · · Score: 3, Interesting
      We use it for "normalizing" images. We have a device with a fixed resolution and some pretty severe limitations on the sizes, resolutions, formats, etc., of images we can send to it.

      The original developer had his "submit image here" web page load the image into some Windows "object" format, and then do a bunch of tests, like 'reject if is it > 500 pixels wide' and 'warn if color depth > 2' and 'reject if not .BMP format'. But this is horrible for the users -- they may not have the image in the required format, and some won't have the knowledge to get it into the format we require.

      I told him to just inline imagemagick's convert function, and output the exact format he requires. The sanitization is now very simple: if imagemagick can read it and successfully convert it to the desired format, it's good. That means we don't even have to tell our users to use .BMP or .GIF or .whatever -- if they can get us an image in a format recognized by imagemagick, we can use it. We've published guidelines that say "if you make your image conform to such-and-such attributes, our output will be as good as we can possibly make it." We're not promising an image that is horribly tortured by Imagemagick will print as well as they desire, but at least our app won't crash if they try to feed us garbage, or try to blow us up with a 10MB .TIFF or .WMF.

      --
      John
    21. Re:Manual vs. Automatic by ggambett · · Score: 1

      I use ImageMagick extensively to preprocess our games' graphics before putting them into a data file. Source (32 bpp PNGs) are cropped, pasted together in mosaics, their alpha channels and color channels are separated and finally saved in different formats, depending on the usage, the needed quality and available space. All of this automatically, thanks to a Python script and ImageMagick. Think Make for processing images.

    22. Re:Manual vs. Automatic by poopdeville · · Score: 1

      How do you deal with kerning? Just a bunch of conditionals in your script?

      --
      After all, I am strangely colored.
    23. Re:Manual vs. Automatic by Anonymous Coward · · Score: 0

      I, for example, download lots of 1600x1200 wallpapers. My desktop resolution being 1280x1024 I want to scale them down. So I iterate through all JPEG images not being 1280 pixels in width:

      for file in `jpeginfo *jpg | grep -v "1280 x" | awk -F" " '{print $1}'`; do convert "$file" -resize 1280 -quality 95 "$file"; done

      Do that in Photoshop, anyone! 8)

      PD: I think the previous script may have some problems dealing with filenames containing spaces (at least two consecutive ones).

  4. OS X Automator by nycguy · · Score: 1

    OS X's Automator lets you do much of the same thing with apps like Photoshop.

    1. Re:OS X Automator by Anonymous Coward · · Score: 0

      Well, to put it short: no.

    2. Re:OS X Automator by mrchaotica · · Score: 1

      More importantly, Automator would let you integrate ImageMagick with the rest of your workflow. For example, it could get your pictures off your digital camera, transform them with ImageMagick, stick them into a web page using iWeb, and upload them to your server, all automatically.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    3. Re:OS X Automator by SeeMyNuts! · · Score: 1


      Does it spawn a new process for each iteration, or is it able to feed files into a single running application? The former: VERY VERY SLOW. The latter is faster, but, in typical shell scripts with a for loop, spawning small dedicated processes works very well, too. Photoshop is not a small dedicated process.

    4. Re:OS X Automator by niskel · · Score: 2, Funny

      I would love to see somebody jerry rig Automater and one or more instances of Photoshop to process images for some image related web server. Especially if it showed photoshop running on the screen. It would be a hoot. Then I would laugh at the sysadmin for even thinking of doing something like that.

    5. Re:OS X Automator by labratuk · · Score: 2, Insightful

      Only much slower, much less flexible, tied to a GUI, tied to a proprietary platform, needing a software license for each machine and only working with applications that support it.

      --
      Malike Bamiyi wanted my assistance.
    6. Re:OS X Automator by labratuk · · Score: 1
      Yep. That's what it's about. Most of the websites that you visit every day that need dynamic image generation just have a desperate need to increase their 'E-Penis' size. It's an inadequacy thing.

      Shut up and die.

      Hey, you know what thats a great idea - I will shut up and die. Great suggestion, dude.
      --
      Malike Bamiyi wanted my assistance.
  5. ImageMagick is good stuff. by tetrahedrassface · · Score: 4, Informative

    Imagemagick is good stuff, ive used it for a while now. Although I didn't buy a book to learn how, i just went here, for some great samples of uses:
    http://www.cit.gu.edu.au/~anthony/graphics/imagick 6/
    PIL isn't too shabby either http://www.pythonware.com/library/pil/handbook/ind ex.htm
    Powerful stuff, maybe the book is not that great i don't know, but imagemagick and PIL are!

    1. Re:ImageMagick is good stuff. by slashkitty · · Score: 1

      Antony's examples are great, you can learn a lot about image processing. I do wish it at more of the "artistic filters" that photo shop and other have. (I'm pretty sure they are possible w/ the tools, they are just heavy in the fx commands.

      --
      -- these are only opinions and they might not be mine.
  6. Better image examples online by digitaldc · · Score: 3, Informative

    In other words, there are many cases where the "before" and "after" images look almost identical. In the cases of color manipulation, most of those black-and-white images are of little value -- occasionally laughably so.

    Haha, that was funny...well if you need to see what it actually does, their examples site has some better images.

    --
    He who knows best knows how little he knows. - Thomas Jefferson
  7. i had that same question by acvh · · Score: 1

    until I read the FA.

    "The material most likely to be read, referenced, and valued in this book, is the chapters devoted to explaining how to use ImageMagick for resizing, compressing, transforming, and drawing digital images."

    OK, I don't get the drawing part - but the rest seem amenable to batch processing.

    1. Re:i had that same question by eh2o · · Score: 2, Informative

      watermarking, annotations, making buttons... etc. typical applications requiring batch drawing.

  8. GraphicConverter by andyring · · Score: 2, Informative

    GraphicConverter on the Mac has some fairly powerful built-in scripting/workflows you can specify for a whole bunch of photos at once. And, it's shareware too. Such as I've used it to all at one time for 100+ photos, perform an "auto levels", reduce the file size so they're easier to e-mail, and create a basic thumbnail Web-ready batch. You can do probably 100 or more tasks this way.

    1. Re:GraphicConverter by mrchaotica · · Score: 1

      Free Software > shareware.

      Also, ImageMagick is more useful for integration with Unix-style shell scripts (as opposed to Automator actions or Applescript, which I suspect GraphicConverter would support instead).

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    2. Re:GraphicConverter by tpgp · · Score: 1
      GraphicConverter on the Mac has some fairly powerful built-in scripting/workflows you can specify for a whole bunch of photos at once.

      Not even remotely like imagemagick - why don't you just download the os x native port?

      And, it's shareware too.

      From the GraphicConverter website:
      The shareware fee is $30.
      I don't even know what shareware means anymore - $30?

      Such as I've used it to all at one time for 100+ photos, perform an "auto levels", reduce the file size so they're easier to e-mail, and create a basic thumbnail Web-ready batch. You can do probably 100 or more tasks this way.

      Imagemagick is will scale to several orders of magnitude higher then 100 images, do everything you mention, and be infinitely more flexible. Give it a shot.
      --
      My pics.
    3. Re:GraphicConverter by Pope · · Score: 1

      $30, for a very useful and professional app is good. Did you expect it to be $5 or something?

      Hell, I've been using GC for almost a decade as my default image viewer on the Mac, well worth such a small cost.

      --
      It doesn't mean much now, it's built for the future.
    4. Re:GraphicConverter by Bing+Tsher+E · · Score: 1

      I agree that $30 is a good reasonable charge for a powerful and useful app on the closed platforms. I have a collection of tools (Textpad, Getright, an eBay sniping tool, etc.) that I registered years ago and make good use of on Windows. However, $30 is still infinitely more than free, and the binary only nature of the shareware binds you to a platform.

      But I agree in putting in a good word or two for shareware. It's one of the ways for us to get good software tools without having to involve middle managers, beancounters, and the corporations that have assimilated them. There is no 'one perfect license' and the people who make such a claim are frightening.

  9. Disagree... by anandamide · · Score: 2, Insightful

    Batch processing images via the commandline isn't really a mainstream activity. ImageMagick is (ASAIK) widely used by the people and applications that need such a tool. I use it professionally and personally when I need such a tool.
    You might as well say that weblog analysis tools are sliding towards obscurity because they aren't featured on the cover of LinuxNewbie Magazine.

    1. Re:Disagree... by DahGhostfacedFiddlah · · Score: 1

      ImageMagick is anything but obscure in the programmatic-image-processing field. Just because you're not in the field doesn't mean it's fading into obscurity.

    2. Re:Disagree... by Anonymous Coward · · Score: 0

      AC who originated the thread writing here.

      I *do* work in large scale medical image processing. I do use ImageMagick occasionally -- but there are much better tools handle imaging data. I used to do weather radar work and used it there extensively. I still hold with the original content. IM makes things look easy. IM documentation sucks (if you don't think so, then tell me you have used IM heavily and NEVER opened the source).
      IM was poised to be become a flagship tool on the Unix platform before Photoshop and Gimp. User hostility has limited IM to niche markets.

  10. ImageMagick + Rails == good by tcopeland · · Score: 4, Informative

    I did some nice charts for the indi admin pages; worked out really nicely thanks to Gruff + RMagick.

    I did have a spot of trouble getting the fonts working at first, but once that was fixed, it was easy to create some nice charts with very little code.

    1. Re:ImageMagick + Rails == good by mrchaotica · · Score: 2, Informative

      gnuplot might be good for that, too.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    2. Re:ImageMagick + Rails == good by tcopeland · · Score: 0

      Yup, right on... would just need a Ruby extension that talks to it. Or I guess you could just exec it with a commands file, although that seems a bit clunkier.

      OK, Googled, looks like someone's written one, good times.

      Little domain specific languages are handy things... I've been doing a lot with JavaCC lately; powerful stuff...

  11. video? by poptones · · Score: 1

    Export an avi to a folder full of pngs, attack it with imagemagick and a few batch scripts and you have a substantial amount of functionality. It's easy to advance single frame just by opening your favorite image viewer and clicking through the directory, and tweaking a single frame to perfection is as easy as saying "open in gimp."

  12. Is it me? by Anonymous Coward · · Score: 0

    Or does this "freelance writer" have problems with grammar? (Especially conjugation!)

  13. Wikipedia uses it by interiot · · Score: 4, Informative

    For what it's worth, Wikipedia uses ImageMagick to automatically resize png/jpeg/gif images for articles (eg. photos uploaded at 1920x1080 can be displayed at 300x169 in an article). So it's good enough to run on a high-traffic website (and is pretty flexible for ad-hoc command-line use too).

    1. Re:Wikipedia uses it by theurge14 · · Score: 3, Informative

      Just to clarify, ImageMagick is not called everytime someone views that smaller thumbnail everytime they view the Wikipedia article, ImageMagick is called upon only when the orginal article was edited, the output is saved by MediaWiki as a totally new image into an images folder. From then on, it's a straight HTML img tag.

      I just wanted to make sure people didn't think ImageMagick is being called upon the MediaWiki software every time the image got a page hit.

    2. Re:Wikipedia uses it by slagheap · · Score: 1

      Just to clarify, ImageMagick is not called everytime someone views that smaller thumbnail everytime they view the Wikipedia article ... only when the orginal article was edited

      It's good you pointed that out, because if there's one thing Wikipedia.org sucks at it's serving up images. Other than the front page, they always seem to load very slowly or not at all for large images.

      --
      First against the wall when the revolution comes
    3. Re:Wikipedia uses it by theurge14 · · Score: 1

      No problem. That's no fault of the softare (ImageMagick or MediaWiki), that's more of a hosting issue.

      If you want to make ImageMagick do some realtime work within a MediaWiki site, go to Special Pages > Gallery of new files and start clicking on progressively older images. Chances are good you are watching ImageMagick generate 120px-wide thumbnails as you wait for the page to load.

  14. Not just for command line use! by PeeAitchPee · · Score: 3, Informative

    ImageMagick's function library is also accessible through a variety of APIs for your favorite language -- scripting or otherwise. If you haven't used it, try it . . . it's GPL and it Rawks (with a capital "r"). ;-)

    1. Re:Not just for command line use! by chgros · · Score: 1

      ImageMagick's function library is also accessible through a variety of APIs for your favorite language
      My favorite language (OCaml) is not there :( (although there appears to be Ocaml APIs developped elsewhere)

    2. Re:Not just for command line use! by Anonymous Coward · · Score: 0

      Objective C is also missing.

    3. Re:Not just for command line use! by theCoder · · Score: 1

      Actually, it's not GPL -- ImageMagick can be used in commercial products as well, more like the LGPL (but it's not that either, it's its own license).

      --
      "Save the whales, feed the hungry, free the mallocs" -- author unknown
  15. Alchemy competitor? by Anonymous Coward · · Score: 0

    Has anyone used both ImageMagick and Image Alchemy? How do they compare? I'd have a hard time getting through the day without Alchemy, but it doesn't seem to be actively developed anymore.

    1. Re:Alchemy competitor? by Anonymous Coward · · Score: 0

      I'm prefer imagealchemy, easier syntax and one of the best programs I've ever stumbled upon (~15 years ago). There's no doubt Imagemagick derives from *nix and Imagealchemy from dos. Why can't any *nix program have an easy syntax??? Although it doesn't justify it's more complex command line, IM can do more stuff, like cropping, but I usually do such work in a GUI anyway (photoshop).

      IM is free and available as a dll, the free support it top-notch (fast!) Imagealchemy is something like $200 and I haven't seen any updates the past years.

  16. Buy it here! by Anonymous Coward · · Score: 0

    Save yourself some money by buying the book here: The Definitive Guide to ImageMagick. And if you use the "secret" A9.com discount, you can save an extra 1.57%!

  17. q8 vs q16 by Anonymous Coward · · Score: 0

    Per info locate on their download page:

    "The Windows version of ImageMagick is self-installing. Simply click on the appropriate version below and it will launch itself and ask you a few installation questions. Versions with Q8 in the name are 8 bits-per-pixel component, whereas, Q16 in the filename are 16 bits-per-pixel component. A Q16 version permits you to read or write 16-bit images without losing precision but requires twice as much resources as the Q8 version. Versions with dynamic in the filename include ImageMagick libraries as dynamic link libraries. If you are not sure which version is appropriate, choose ImageMagick-6.2.6-4-Q16-windows-dll.exe."

    http://www.imagemagick.org/script/binary-releases. php#windows

    The web site does give some help.
    Regards,
    Anonymous Coward

  18. Flickr Hacks by jbum · · Score: 3, Interesting

    My book, Flickr Hacks, contains a number of examples of using ImageMagick (via the Perl API) with Flickr. This is one area where it really shines. I used ImageMagick to create these mosaic posters, the Flickr Colr Pickr and other cool things.

  19. Scripting by base_chakra · · Score: 1

    ImageMagick's function library is also accessible through a variety of APIs for your favorite language -- scripting or otherwise. If you haven't used it, try it . . . it's GPL and it Rawks (with a capital "r"). ;-)

    While I use (and love) ImageMagick, it's worth noting that Photoshop has similar (but not totally analogous) capabilites:

    http://partners.adobe.com/public/developer/en/phot oshop/sdk/PhotoshopScriptingGuide.pdf

    Unfortunately, Photoshop's scripting host only supports JavaScript, VBScript, and AppleScript. This is not the same thing as a Photoshop Action; scripting isn't as limited as Actions are: one can employ conditional logic, perform some basic file system operations, and transfer scripts easily.

  20. Photoshop Not! by rspress · · Score: 1

    I have been an imageMajick user for some years now I while I find it great for simple tasks and great for batch conversions it is no Photoshop. I think there is room for both. For simple image conversion or batch processing I use an Apple Automator action to call a do shell script. For others I drop into the terminal. For retouching or other tasks, it is Photoshop only.

    1. Re:Photoshop Not! by slashkitty · · Score: 1

      It can do many things that you don't see here. It's up to someone to create an application that uses the power of imagemagick. The best I've seen so far is a web based image editor http://blibs.com/

      --
      -- these are only opinions and they might not be mine.
  21. I am a photographer... by temojen · · Score: 2, Informative

    My pictures are carefully composed and exposed. I set the whitebalance when I scan the negatives. Once the scanning is done, I run a batch job (over possibly hundreds of images) which opens each file (16 bit tiff), scales for printing at 12x18, 8x12, 8x10, 6x8, 5x7, and 4x6, saving as 100% quality jpeg, scales to 1024x768, 600x400, and 150x150, padding with borders if nescesary, rotating to portrait if nescesary (from a list), watermarks and signs them, and saves as 80% quality jpeg. This batch job can run while I sleep or do other things.

    1. Re:I am a photographer... by Echnin · · Score: 1

      That sounds like a lot of work. I'm curious; have you tried a digital body? 12 MP supposedly has as much detail as a 35mm frame. Using medium-frame perhaps?

      --
      Lalala
    2. Re:I am a photographer... by temojen · · Score: 1

      It might sound like a lot of work, but when you have 6 rolls taken in the same lighting conditions, where the first frame has a grey card, you just set the whitebalance once, then just load up each strip and let the scanner do it's job.

    3. Re:I am a photographer... by temojen · · Score: 2, Interesting

      Also, the exposure latitude of digital sensors sucks compared to Reala and Portra. And I get 14MPix from 35mm, with tonality close to digital from 100iso print film, and almost as good as digital from Portra 400. Resampling down to 6x8@300 I get tonality comperable to digital from Portra 400 and the lower contrast is more flatering for images of people.

      6x6 and 4x5 give tonality identical to digital with any film and you can enlarge much more while still seeing increasing detail. They're much more bothersome to scan though (no batch scan).

    4. Re:I am a photographer... by Kiryat+Malachi · · Score: 1

      Not to mention the only thing going digital would have saved you is the initial scanning.

      I do all the rest of it, and I shoot digital.

      --

      ---
      Mod me down, you fucking twits. Go ahead. I dare you.
      (I read with sigs off.)
  22. check out netpbm too by resfilter · · Score: 3, Informative

    those interested in command line image processing, should check out netpbm too. it's really neat

    instead of a single image processing program, netpbm is a massive collection of programs all using a small set of proprietery formats (they are all compatible with each other). you use pipes for communication between them, giving you some more flexibility.

    for example:

    pngtopnm foo.png | pnmscale -xsize=600 ysize=400 | pnmtojpeg > foo.jpg

    the other advantage is, their proprietery formats were designed to be easy to use, so coding your own netpbm programs is much easier than rewriting imagemagick for a specific task.

    1. Re:check out netpbm too by Tet · · Score: 2, Interesting
      those interested in command line image processing, should check out netpbm too.

      I couldn't agree more. For a start, a single monolithic app like ImageMagick is just not the Unix way. It means that to add functionality, you need to recompile the application. With netpbm, if you want a new feature, you just write a filter and stick it in the pipeline. Much easier, and much more flexible. In the past, my only gripe was that netpbm (and pbmplus before it) was unable to handle transparency in image. Fortunately, that's no longer the case, and recent versions are able to do so. Plus, with my (admittedly not very scientific) tests, netpbm comes out slightly faster for the tasks I perform anyway (mostly cropping and scaling). I can highly recommend netpbm.

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
    2. Re:check out netpbm too by WWWWolf · · Score: 1

      Wrong wrong wroooong, I'm afraid! ImageMagick is very much in the Unix league! It is not a monolithic application, it's a monolithic library. ImageMagick itself is spread across multiple programs (convert, identify, composite, montage, compare, display, animate, import, conjure) that do different kind of things. Heck, people should look at convert and identify alone as a good example of The Unix Way!

      And last I checked you don't need to recompile any apps to do unusual things with the graphics data, you can get the raw data in an application using ImageMagick library and play with it to your heart's content, or use the cool features in the library... The only difference with netpbm is that you don't pipe your data from app to another, you manipulate it in a normal programming language. Is writing Perl or Ruby scripts to do repetitve much less about The Unix Way? (In my experience, my most frequently used shell scripts tend to mysteriously turn into Perl scripts sooner or later anyway =)

  23. Nconvert by eMartin · · Score: 1

    ImageMagick is great, but if you work with less common formats or even those such as Maya's IFF, it doesn't help much (which is odd seeing as how Maya even installs ImageMagick's convert command renamed as imconvert).

    There is another program called Nconvert that will handle pretty much any format you throw at it (about 400 in and 40 out). It can do much of what can be done with ImageMagick too, and is available for more than a dozen operating systems.

    Unfortunately it's only free for non-commercial use, and 100 (or an agreement) otherwise.

    http://perso.wanadoo.fr/pierre.g/xnview/en_ncdownl oad.html

    1. Re:Nconvert by brusk · · Score: 1

      Yes, and it's MUCH better for handling huge images. I've had ImageMagick choke on large TIFFs because it tries to load the entire image into RAM, which can be a mess (e.g. with multipage image files). NCONVRT -- and its related API for Windows, GflSDK -- handles large files much better.

      --
      .sig withheld by request
  24. Which Precompiled Windows Version? by Goo.cc · · Score: 2, Informative

    "The ImageMagick Web site and FTP file listings appear to have no README file or installation help file to explain which flavor you should download."

    From http://www.imagemagick.com/www/binary-releases.htm l :

    "The Windows version of ImageMagick is self-installing. Simply click on the appropriate version below and it will launch itself and ask you a few installation questions. Versions with Q8 in the name are 8 bits-per-pixel component, whereas, Q16 in the filename are 16 bits-per-pixel component. A Q16 version permits you to read or write 16-bit images without losing precision but requires twice as much resources as the Q8 version. Versions with dynamic in the filename include ImageMagick libraries as dynamic link libraries. If you are not sure which version is appropriate, choose ImageMagick-6.2.6-3-Q16-windows-dll.exe."

    I know that its not a readme file but the website seems pretty explainatory. You are right about the FTP site, however.

  25. Batch processing by AaronW · · Score: 2, Informative

    For doing batch processing of photos I have been using Bibble Pro for Linux lately. I like it since it has good support for the raw format of my SLR and has a lot of batch processing features. For example, it's easy to select a group of 50 photos and adjust the white balance, or use the one click lens distortion fix on all my photos. Best of all, it runs under Linux. It gives me the best of both worlds. It gives me batch processing as well as the ability to individually make changes to each picture. I.e. I can bring out the shadows in a group of pictures, then straighten a couple of them if the camera was crooked and crop them as needed. It also does everything at 16 bits per color.

    Now, granted, it does not run on the command line, but it easily lets me select a source and target directory to batch process as well as letting me select individual pictures. I can't really compare it with ImageMagick since I haven't used it directly.

    -Aaron

    --
    This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
  26. FlashPIX Bug by Anonymous Coward · · Score: 0

    I've had an open bug on FlashPIX format (specifically the Kodak DC-265 version) in ImageMagick for FreeBSD for some time (probably in a 3rd party library). To bad nconvert won't do FlashPIX on *nix. If I have to use Windows, I might as well use Kodak's tool.

  27. NetPBM by Azul · · Score: 2, Informative

    Hmm, I tend to find the approach of NetPBM easier to work with: having lots of separate utilities each doing a single simple thing and making it easy to use them together by piping the output of one to the next. Besides, reading/writing PBM files is trivial so you can very easily use these tools from your programs (by piping your image through them) or you can very easily create new filters that integrate well with the rest. I recommend you check out NetPBM.

    If you need automatic processing of many images (the sort of thing ImageMagick is being praised for), I recommend you check it out.

    1. Re:NetPBM by glwtta · · Score: 1
      having lots of separate utilities each doing a single simple thing

      I've heard this a few time, but never really got the big difference between accessing the utils as "./foobar img.png" vs "./foo --bar img.png", seems like a cosmetic distinction.

      One thing I really like about IM is that I don't have to even care about the input format, so when the users upload their random collection of gifs, jpegs, tiffs, 30 meg bmps and picts, I can just give the whole indiscriminate mess to IM and get back a set of nice, shiny, sized and formatted pngs. Of course that still leaves the pdfs, word docs and powerpoint slides.

      --
      sic transit gloria mundi
    2. Re:NetPBM by Azul · · Score: 1
      One thing I really like about IM is that I don't have to even care about the input format, so when the users upload their random collection of gifs, jpegs, tiffs, 30 meg bmps and picts, I can just give the whole indiscriminate mess to IM and get back a set of nice, shiny, sized and formatted pngs.


      I just want to point out that's something to like about NetPBM as well. You'd use anytopnm.
  28. Does eBook have color images? by CFrankBernard · · Score: 1

    Does the eBook version have color images? http://www.apress.com/book/bookDisplay.html?bID=10 052

    1. Re:Does eBook have color images? by jonfelder · · Score: 1

      The sample chapter does not. I'm not sure if that means the eBook doesn't, but I'd be inclined to think it doesn't from the sample.

  29. Irfanview by Darthmalt · · Score: 1

    Irfanview is good for batch conversions, I used it all last summer to resize and greyscale hundreds of photographseach week. At 1.24mb for the whole program folder, and the ability to read almost any type of image file and use photoshop filters I haven't found anything better for quick edits.

  30. ImageMagick w/ Image::Size by Friar_MJK · · Score: 0, Offtopic

    Since this subject has been brought up, I was wondering if anybody could offer some insight into this: I've been trying to get the Image:Size perl script to get the dimensions of a swf file. I've got it on a loop for a directory of files, and I need to pass Image::Size a variable which gives it the name of the file. After some headaches and research, I found that you can't pass it a (like this: $var) variable to give it a location. I heard this was an ImageMagick problem rather that Image::Size, yet there's all this talk of being a command line utility. Anybody have similar problems, or know of a workaround? Any example of what I'm looking to do can be found at my link in the arcade section (which the site doesn't seem to be working now for some reason...). Right now all the swf links have a default size which makes them look funny. Any insight would be appreciated. Thanks!

  31. Duh. by temojen · · Score: 1

    Horses for Courses. When you need to touch up one image, use Photoshop. When you need to dust-bust hundreds of images, use CinePaint. When you need to rotate, scale, composite, and convert hundreds or thousands of images, use ImageMagick (via PerlMagick or your favourite scripting language).

    Similarly, excel is not a database management system, and Abiword is not a desktop publishing suite.

    1. Re:Duh. by rspress · · Score: 1

      That is pretty much what I do. I use Photoshop for stuff that needs Photoshop. Most other is handled as you say by my favorite scripting language using ImageMagick The only other program I use for bitmapped graphic is the swiss army knife program GraphicConverter. It handles just about every graphic format made for every computer ever made. If I ever need to move a Commodore64 graphic file to Pison or Sun Rastersystem it will do it.....I don't know why I would ;-)

      At the time I don't have UNIX installed on my Windows box so it just uses Photoshop. I use the Mac for 90 percent of my graphic work anyway.

  32. photoshop also has javascript interface by Skuld-Chan · · Score: 1

    Yes its true - you can script things with javascript in photoshop and it is every bit as impressive as imagemagik.

    1. Re:photoshop also has javascript interface by Bing+Tsher+E · · Score: 2, Informative

      No it's not. You have to reach into Photoshop with 'javascript' in order to get any use of it at all. With imagemagick the whole toolset is a collection of standalone executables, which you can write scripts for in any imaginable scripting language.

      It's a significant difference.

      Further, I can download and build imagemagick from source on any of the various machines I have in my posession that I run NetBSD on. The Adobe product is binary only for two fairly limiting platforms.

  33. MOD PARENT UP!! by Anonymous Coward · · Score: 0

    LMAO! Funniest of the day.

    BTW, its already March in rest of the world. But well, Michigan has never been known to be with the rest of the world.

  34. www.graphicsmagick.org by Anonymous Coward · · Score: 0

    I dunno why, but I switched from using image magick to using graphics magick. It may be faster. It seems compatible.

  35. A word before... by DrVomact · · Score: 1

    The book's 335 pages are organized into a dozen chapters, following an introduction and a few other standard sections, including a forward written by ImageMagick's principal architect, Christy, who briefly explains the...

    Please, the word is Foreword, not "Forward". I don't want to be a grammar nazi, but I've seen this particular word substitution so often that Im afraid we're getting near the point where the sheer quantity of errors is going to confuse everybody. Heck, sometimes I think I'm wrong about this...I've actually seen books that have a section in front called "Forward".

    --
    Great men are almost always bad men--Lord Acton's Corollary
    1. Re:A word before... by theurge14 · · Score: 1

      So is my reply a Rewind or an Aftword? :)

    2. Re:A word before... by Anonymous Coward · · Score: 0

      [obligatory comment by postmodern nazi saying language naturally evolves and bourgeois prescriptivists have no business self-righteously dictating how that natural process ought to progress]

  36. ImageMagick is excellent by bigdadro · · Score: 2, Informative

    My company uses image magick to resize and add watermarks to tens of thousands of website classified images. We created several wrapper methods to access it in our app.

    Poor Example:
    myImage1 = imageMagickResize(thisImage.jpg,destImage.jpg,300, 200);

    AFAIK it is more extensive than alot of the native image manipulation libs that come with certain languages (java?). Comparing imageMagick to photoshop or other apps is apples to oranges. We have this running on headless FreeBSD and CentOS boxes with no X. Can't do that with photoshop!

  37. good stuff by Anonymous Coward · · Score: 0

    We used imagemagick for a while for basic resizing/cropping/thumbnailling but switched to PHP5 w/ GD due to portability concerns. ImageMagick is often not installed on systems and unless you run your own box, it takes teeth pulling to get hosts to install any software they aren't familiar with.

  38. Multipage images? by Just+Some+Guy · · Score: 1
    We use ImageMagick to convert multi-page TIFFs that our customers send to us into our internal layout (i.e. correct size, depth, etc.). I'd like to try netpbm, but it doesn't seem to widely support multipage images:
    $ tifftopnm < foo.tif | pamscale -xyfit 640 480 > bar.tif
    tifftopnm: writing PBM file
    pamscale: promoting from PBM to PGM
    tifftopnm: writing PBM file
    $ identify foo.tif
    foo.tif[0] TIFF 995x1375 995x1375+0+0 DirectClass 2e+02kb
    foo.tif[1] TIFF 950x1375 950x1375+0+0 DirectClass 2e+02kb
    foo.tif[2] TIFF 949x1375 949x1375+0+0 DirectClass 2e+02kb
    foo.tif[3] TIFF 981x1375 981x1375+0+0 DirectClass 2e+02kb
    foo.tif[4] TIFF 981x1375 981x1375+0+0 DirectClass 2e+02kb
    foo.tif[5] TIFF 995x1375 995x1375+0+0 DirectClass 2e+02kb
    foo.tif[6] TIFF 994x1375 994x1375+0+0 DirectClass 2e+02kb
    $ identify bar.tif
    bar.tif PNM 347x480 347x480+0+0 PseudoClass 256c 2e+02kb

    If it weren't for the fact that it discards 86% of the input data, it'd be pretty useful. Seriously, though, I'd love to find out that I'm wrong. It seems much faster than ImageMagick for certain operations and I'd like to give it a real test.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Multipage images? by Azul · · Score: 1

      Note that your bar.tif file in your example is in PNM format (not TIFF, which is probably what you expect, seeing that you're using bar.tif rather than bar.pnm). PNM files can include multiple images. You probably want this:

      tifftopnm <foo.tif | pnmscale -xyfit 640 480 | pnmtotiff > bar.tif

      According to the tifftopnm and pnmtotiff man pages, support for reading/writing multi-image TIF/PNM files was added in version 10.27 from March 2005. So either identify is not recognizing that your PNM file or you could use a newer version (or, perhaps, gasp, pamscale does not support multi-image PNM files?).

      So yes, you can probably give it a try. :)

    2. Re:Multipage images? by Just+Some+Guy · · Score: 1
      PNM files can include multiple images.

      Yeah, but the p{a,n}m* tools don't seem to always process them.

      tifftopnm <foo.tif | pnmscale -xyfit 640 480 | pnmtotiff > bar.tif

      Unfortunately, neither pnmscale nor pamscal seem to do the trick (but identify would recognize the results if they did):

      $ tifftopnm < foo.tif | identify -
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      tifftopnm: writing PBM file
      -=>/tmp/magick-XXXapW4f[0] PNM 995x1375 995x1375+0+0 PseudoClass 2c 1mb 0.290u 0:02
      -=>/tmp/magick-XXXapW4f[1] PNM 950x1375 950x1375+0+0 PseudoClass 2c 1mb 0.250u 0:02
      -=>/tmp/magick-XXXapW4f[2] PNM 949x1375 949x1375+0+0 PseudoClass 2c 1mb 0.190u 0:02
      -=>/tmp/magick-XXXapW4f[3] PNM 981x1375 981x1375+0+0 PseudoClass 2c 1mb 0.150u 0:02
      -=>/tmp/magick-XXXapW4f[4] PNM 981x1375 981x1375+0+0 PseudoClass 2c 1mb 0.110u 0:02
      -=>/tmp/magick-XXXapW4f[5] PNM 995x1375 995x1375+0+0 PseudoClass 2c 1mb 0.080u 0:02
      -=>/tmp/magick-XXXapW4f[6] PNM 994x1375 994x1375+0+0 PseudoClass 2c 1mb 0.040u 0:02

      $ tifftopnm <foo.tif | pamscale -xyfit 640 480 | pnmtotiff > bar.tif
      tifftopnm: writing PBM file
      pamscale: promoting from PBM to PGM
      tifftopnm: writing PBM file
      $ identify bar.tif
      bar.tif TIFF 347x480 347x480+0+0 DirectClass 2e+02kb

      $ tifftopnm <foo.tif | pnmscale -xysize 640 480 | pnmtotiff > bar.tif
      tifftopnm: writing PBM file
      pnmscale: promoting from PBM to PGM
      tifftopnm: writing PBM file
      $ identify bar.tif
      bar.tif TIFF 347x480 347x480+0+0 DirectClass 2e+02kb

      or, perhaps, gasp, pamscale does not support multi-image PNM files?

      Unfortunately, I think that's the key. Thanks for trying to help, though!

      --
      Dewey, what part of this looks like authorities should be involved?
  39. Matlab by minorproblem · · Score: 1

    Its called matlab

    1. Re:Matlab by Slashcrap · · Score: 1

      Its called matlab

      No, it's called either "posting your comment in the wrong story" or "shut up bitch, you have no idea what you're talking about".

    2. Re:Matlab by Anonymous Coward · · Score: 0

      You can use Matlab to do image processing via an extension library, in a manner similar to ImageMagick. It's an enormous pain in the ass, but it can be done. So I guess it's the second option.

  40. jpgs to movies by blunte · · Score: 1

    What I've really wanted, but not yet found, is some way to programmatically (or from command line) take a series of JPGs (1,000 to 50,000) and create a movie out of them. I've got Quicktime Pro, but it doesn't have command line ways of doing this (and it bogs down horribly when manually loading an image series and saving out a movie).

    I do use ImageMagick (actually GraphicsMagick I think) to watermark/timestamp each of the JPGs before I make the movie, but surely there's a way to fully automate what I'm doing...

    --
    .sigs are for post^Hers.
    1. Re:jpgs to movies by Anonymous Coward · · Score: 0

      Mencoder can do this.
      Example:
      mencoder *.jpg -mf on:fps=25:type=jpeg -ovc lavc -lavcopts vcodec=mjpeg -o output.avi

    2. Re:jpgs to movies by DeadInSpace · · Score: 1

      If I'm not mistaken, mencoder, from the mplayer project, can do this. The program is quite dense in its options, and requires some getting used to, but it can do quite a lot.

    3. Re:jpgs to movies by Anonymous Coward · · Score: 0

      Not a command-line method, but VirtualDub can do that. http://www.virtualdub.org/

    4. Re:jpgs to movies by Anonymous Coward · · Score: 0

      If you can handle motion-jpeg (MJPEG) .avi files as output:
      http://sourceforge.net/projects/jpegtoavi/

      I've been using this for years to string together snapshots from security webcams into daily/weekly/monthly time-lapse movies.

  41. Use mencoder. by Anonymous Coward · · Score: 0

    From the man page:
    mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4

    Though xvid codec or x264 gives better results then lavc-mpeg4.

  42. ImageMagick doesn't scale as well as Gimp? by random_amber · · Score: 1

    I like using ImageMagick...but its scale feature doesn't look as good as when I use Gimp (or Photoshop for that matter). Why is that? There is a huge quality difference to my eyes when I put a picture scaled with Gimp next to one with ImageMagick. Am I doing something wrong? =/ Random_Amber

    1. Re:ImageMagick doesn't scale as well as Gimp? by slashkitty · · Score: 1

      it might be the quality setting for the output file. What are you outputing in? jpg? 100% quality?

      --
      -- these are only opinions and they might not be mine.
    2. Re:ImageMagick doesn't scale as well as Gimp? by BurntNickel · · Score: 1

      I like using ImageMagick...but its scale feature doesn't look as good as when I use Gimp (or Photoshop for that matter). Why is that? There is a huge quality difference to my eyes when I put a picture scaled with Gimp next to one with ImageMagick. Am I doing something wrong? =/ Random_Amber

      I have noticed the same thing. I may be missing a setting somewhere but I'm not sure. To my untrained eye, it looks like PS (and I guess the GIMP as well) does a better job of low pass filtering the images when scaling.

      --
      And the knowledge that they fear is a weapon to be used against them...
  43. Doug Henning would be impressed by Bushido+Hacks · · Score: 1

    It's ImageMaaagick!!!!

    ImageMacgick > Photoshop

    --
    The Rapture is NOT an exit strategy.
  44. ImageMagick's "user hostility" by rp · · Score: 1

    I tend to agree with these remarks but they should have been worded differently.
    When I used ImageMagick and PerlMagick regularly (some 5 years ago), like you I found
    ImageMagick lacking in user friendliness, but I feel it is the result of lacking development resources.

    In essence IM is very much like similar libraries such as netpnm and GD: it has its own internal image format,
    a slowly-but-ever increasing range of image processing functions that operate on that format,
    an a slowly-but-ever range of format converters that read and writing images in various formats,
    sometimes by means of external executables such as Ghostscript or the netpnm utilities.

    One difference with GD or netpnm is that ImageMagick doesn't separate its input filters, output filters
    and image manipulation functions out into separate executables. It implements them as options instead:
    executables such as convert and mogrify can use pretty much every input filter, output filter and image
    manipulation function that the library supports, by the appropriate selection of filename extensions
    and/or command line options. This is "not the Unix way". It is also a terrible hindrance to proper
    documentation: with 10 netpnm executables in a pipe that all execute a single manipulation, I know
    immediately what is going on by reading the man page of each of them, but when I want to combine 20
    IM convert options, the convert manpage gives me very little information on how their effects will be combioned.

    But a more significant difference is that the GD and netpnm authors stopped development at some point,
    leaving us with a finished set of utilities the exact operation of which is known.
    ImageMagick always felt to me like an eternal work in progress, propelled by small, incremental steps
    that gradually incorporate more and more image processing functionality, but with little attention to other issues.
    As I recall it, the interface kept growing options without ever becoming more organized.
    Performance was terrible and might change from version to version (but IM was always a terrible memory pig).
    As you mentioned, there was no real documentation (which the author was the first person to acknowledge).
    And the worst, as far as I'm concerned: compatibility would sometimes break; the exact syntax or semantics of options
    might change from verison to version, so I'd sometimes have to change my PerlMagick calls (in undocumented ways) and
    require specific ImageMagick versions installed in order to keep my applications going.

    These are not signs of user hostility but rather of a lack of effort in user interface design. A CLI is a user interface
    and convert(1)s is just about the worst I've ever seen. PerlMagick's library call interface isn't much better. This is because
    IM just grew functionality, feature by feature, and never saw a focused design effort to present all that functionality
    in a way that would be maximally useful and clear to end users, let alone that it would define a clear organization for
    these interfaces and guarantee their compatibility. But the development effort spent on IM is very small so I don't think
    you can blame any one of the developers for this problem.

  45. I wish that GIMP could do this by typical · · Score: 1

    I wish that GIMP could be operated from the command line. At least currently, it is heavily tied to X for stuff like font rendering.

    Which is kinda irritating, because I can think of a lot of times where I know exactly how to do something with GIMP, but just wish that I had an easy-to-use-as-a-backend system that could do the same thing.

    --
    Any program relying on (nontrivial) preemptive multithreading will be buggy.
  46. Fix: ImageMagick doesn't scale as well as Gimp? by Repugnant_Shit · · Score: 2, Informative

    It has been awhile, but I think the -scale option forces a lower quality resize due to the filter used. Try using the -resize option instead. And you can force a specific filter with the -filter option, like so..
        convert -filter cubic -resize 100x100 input.jpg output.jpg

  47. Two words: UNSTABLE API by mi · · Score: 2, Interesting
    ImageMagick's API is notoriously unstable and new releases don't even bother with backwards compatibility. Once in a while, even the command line options change between releases breaking existing scripts (such as ImageIndex, for example).

    If you wish to write your own programs using a powerful image-processing library, you will, most likely, prefer the fork of ImageMagick called GraphicsMagick.

    --
    In Soviet Washington the swamp drains you.
    1. Re:Two words: UNSTABLE API by HuguesT · · Score: 1

      Thank you !

      I didn't know that this existed and I've been bitten by IM changes of API too many times already. Actually about 10% of my configure script is dealing with IM API changes and is the part that is most regularly breaking...

    2. Re:Two words: UNSTABLE API by Slashcrap · · Score: 1

      ImageMagick's API is notoriously unstable and new releases don't even bother with backwards compatibility.

      Yeah, it sure is a shame that those old versions stop working the second they release the new ones.

  48. Re:ImageMagick is useless by Anonymous Coward · · Score: 0

    I've written apps using it, only to find out that the latest version no longer works.

    You're a developer and you don't save the source code? Maybe you should learn to keep a downloads directory like everybody else does. It's called backups my friend.

  49. GPL-covered programs can be "commercial". by jbn-o · · Score: 1

    While it's true that ImageMagick isn't licensed under the GPL, I hope nobody comes away thinking that licensing under the GPL precludes commercial distribution or incorporation into a commercial program. That's never been the case.

    Being licensed under the GNU General Public License doesn't preclude use in commercial software. In fact, many GPL-covered programs are commercially distributed and some even have remarkably lucrative consultancies developing them (such as GCC).

    Furthermore, one can build on GPL-covered programs in other programs (even proprietary programs) because it all depends on how the GPL'd program is called.