Graphics Tricks from the Command Line
An anonymous reader writes "There's nothing quite like command-line tools for handling large batches of tasks, and image manipulations are no exception. Web developers and administrators will appreciate the ability to handle large numbers of files easily, either at the command line or in scripts. This article presents the ImageMagick suite, a Linux toolkit for sizing, rotating, converting, and otherwise manipulating images, in a huge number of formats, whether one or a hundred at a time."
This seems like it could be useful for easy and fast (not always smart) integration into Web Applications. Its far easier to make a call to a command line image manipulation software than to call a library and do all the work yourself. Though I suppose with calling an application for the web, there may be security problems.
ImageMagick is used quite a bit with online photo galleries. Here is one of the most popular.
Best Windows Freeware
and this differs from XV how - apart from maybe an API..
I used to use it a lot back when I was doing astronomy, I used to make movies and I wrote a load of scripts for IM which basically worked on directories full of jpegs to do crossfades, motion blur, and all sorts of other effects. Some of these movies of asteroids and comets still make it onto the occasional TV slot. The originals were rendered in POV ray, but IM was more important since it was essential for editing and compositing.
It still runs today producing the map of asteroids (http://szyzyg.arm.ac.uk/~spm/), even though I've moved on a long time ago.
For a while I even used ImageMagick as the core for a webcam motion detection program - rescale, blur, edge-detect, subtract differences and then count the total intensity of the output image - it worked pretty well, although it was a little slow.
I think I've created more art with ImageMagick than I've done with the Gimp.
But the downfall of Image Magick is the installation. It is the most god awful spaghetti mess of all time when it comes to its dependancies. You see, what they don't tell you right off the bat is ImageMagick doesn't actually work with the file formats internally. AFAIK, it relies on all of the format specific libraries out there. If your application is hosted by a virtual hosting provider, good luck getting all that installed.
Once it *is* installed, however, IM rocks.
1;
At work we often work with multipage tiff images (~650MB) that we need to pull individual images out of. We currently have a poorly implemented hack to do it, but I am looking to find a better library to do this. I was wondering if anyone has a decent java library that they know about.
Ideally something that works with msjava (java 1.1). I know in java 1.4 there is jai, but atleast immediately that does not seem to be a very understandable api.
Anyways, we'll see if this gets any hits.
Norris/Palin 2012
Fact: We deserve leaders who can kick your ass and field dress your carcass.
I also expect some commercial image procssing software (e.g., Adobe photoshop) may export some command-line programs.
Can anyone compare IM to the pbm tools?
Joe Batt Solid Design
I used to this to change the hue of a load of pictures.
:)
I broke a picture of a map down into all the edges (roads) and then changed the images into various different hues.
Now in a web page, you can see the roads change colour
Most distros of linux come with IM as part of their main / stable distros. I've used it with Gentoo and debian via apt and emerge respectively, no problems. Redhat and Mandrake have it too! The windows version comes precompiled / statically linked, so that's no big deal. What were you using?
Photos.
I have a three head desktop and I needed some cool backgrounds. Unfortunately, the desktop is a single large canvas and not three smaller ones. I have a small script that grabs 3 random images from my backgrounds directory (mostly images from Digital Blasphemy) and stitches them together to form a single large background image.
-sirket
I have been trying to automate some tasks here where the end results are graphs.
The problem is that for Joe Nerd, the output of a scripted graph is "good enough" - I use GD for a lot of things and it looks fine and is fast enough to be generated on the fly.
But my current need is to get graphs that look really good so that they can be used on a brochure type site, but can be updated frequently with the most recent market data (not updated in real time, every time the page is loaded - but updated by a script every month).
My current process is to use Excel sice its graphs are customizable enough and look pretty good in the end. But the process unfortunately doesn't really lend itself to automation. (create graph in Excel, take screen capture, dump to Photoshop, tweak, dump to png)
ImageMagick is very useful for many things though, and you can do some suprisingly good looking stuff with it.
I have mainly ever used it for adding text to a whole lot of images, and also for converting images en masse.
There are some odd things afoot now, in the Villa Straylight.
Imagemagick made me look like a miracle worker.
10,000 1.5MB bitmaps had to be delivered to the Food and Drug Administration in their original format and resolution (they needed to see things exactly as they were reviewed in a drug safety study), but wanted a visual 'menu' of the images, by patient over time.
Using the index of the images, I was able to create a labeled page-per-patient visual menu in PDF (FDA's preferred format -- but it would be a 3-character change to make it anything else). Using other tools, the same index was munged into a CSV file that was applied as hyperlinks atop the PDF menu (non-Open-Source tool, but I might have been able to find an open-source one).
In one day, the entire set of 15GB of data could be processed. In fact, putting it on a tape took longer than the image assembly.
Design for Use, not Construction!
For those of you who use python, you might want to check out the Python Imaging Library, or PIL for short.
After using many, many different tools for this type of thing (including IM, netPBM, GD, and my own tools), PIL has by far become my favorite for image processing.
Check out this simple tutorial for some examples of what you can do.
It's free software, and therefore, it comes with my system (Debian) while XV doesn't. I can use it for my commercial website, or sell someone a system using it (a commercial transaction) without worrying about license fees. And it's been updated more recently than 1988! :)
Oh, and it has that API and a library that third-party apps use directly, so having XV on my system would involve a lot of redundancy, while having ImageMagick just means a small app that uses the already-installed library.
If you have access to a Macintosh, or can squeeze out the budget for one, consider Keynote, Apple's fancy presentation program.
The files are in XML, so they would be a snap to generate them through scripts, and the display engine produces stunningly beautiful graphs.
The graphs are so much prettier than Excel's it isn't even funny.
If you play with it at an Apple Store, I think you'd get sold on it pretty quick.
Hope that helps.
D
"This article presents the ImageMagick suite, a Linux toolkit for sizing..."
WTF has this got to do with Linux? AFAIK IM pre-dates any kind of wide-spread use of Linux. IM compiles on most unixes and is available for mac, win32, vms and more. It has nothing to do with Linux.
Sigh.
-----
1) What's this got to do with ImageMagick?
2) How do you cat something to "stdio"?
convert -adjoin photos*.jpg one_big.pdf
Say I give you two images where a portion of one on the edge is identical to a portion of the other on the opposite edge. I want to stitch these together to get one big image which seemlessly overlaps the two?
How would you go about this?
"Smoking helps you lose weight - one lung at a time" -- A. E. Neumann
Secondly, the OP clearly made this rediculous post to plug Cygwin, causing Linux to invade Windows. Maybe he's been using Linux too much and wants the safe comfort of a Linux-emulated Windows environment. In any case, the same effect can be achieved by typing "type myBinaryfile.jpg" at the command prompt.
The file doesn't even have to be a JPEG; this is one of the great virtues of the cat/type duo. They are one of the few programs which surpass the image format support of ImageMagick.
"The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
netpbm is much better than image magick
I'm a big fan of ImageMagick, use it mostyly on Windows and haven't encountered any install problem some earlier post related, if you know how to press a "next" button that's well enough...
Now one thing I've been looking for is something to let me read RAW (headerless) CCIT G.4 (fax-type encoding),ImageMagick doesn't support it and the few free tools I found didn't work quite well. Anybody got recommendations ?
I'm glad someone else pointed that out so I didn't have to...
/usr/ports/graphics/ImageMagick ; sudo make install
:)
I dunno about you, but...
cd
isn't all that hard to do, now is it ?
EOM
Could this utility be used to convert gif imageds to png? I understand this is very difficult (since Slashdot still uses gif images), but hopefully, someday there will be a way to convert gifs to png format.
Do you even lift?
These aren't the 'roids you're looking for.
I've used it quite a bit, seems to be a bug in colour conversion though (at least in version 5.5.4).
I found that it has problems converting an image to 256 color. It seems to mess up conversion of pixels with alpha transparency. The fix I found was to convert to gif format, then back to png (which automatically converts to 256 colour).
This may be fixed in later versions though.
Marge, get me your address book, 4 beers, and my conversation hat.
They're both FREE (as in herpes).
What in the world is that 150MB JPG a picture *of?*
.
== WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
+4 Informative
.
== WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
ImageMagick is great but I always feel that the same functionality must already be present in the GIMP, and it seems rather wasteful to have to learn two different tools to do the same job.
The GIMP is scriptable with Scheme or with Perl or other languages... perhaps all it needs is a good set of command-line interfaces as well?
-- Ed Avis ed@membled.com
From the ImageMagick site:
ImageMagick is quite portable, and compiles under almost every general purpose operating system that runs on 32-bit or 64-bit CPUs. ImageMagick is available for virtually any Unix or Unix-like system, including Linux. It also runs under Windows '95 and later ('95, '98, ME, NT 4.0, 2000, and XP), Macintosh (MacOS 9 and 10), VMS, and OS/2.
Once again, remember that freely available software, and software that comes with the source code, is NOT a Linux-specific phenomenon. In fact, just about any decent piece of software that runs on top of the Linux kernel can--and already has, in most case--be easily ported to any other popular operating system. Windows developers commonly make use of Perl, Python, Tk, and so on.
I know this sounds somewhat pedantic, but I want to make clear that "Linux" is a *kernel*. Advocates usually forget this. Well-written software is not tied to a particular OS kernel.
r u a l33t h4x0r? oh yeah baby, you sure look like it showing those SKILLAH skillz yo boi-yee.
show the plebians how you fucking get down with MICROSOFT OFFICE. Did Miguel Icaza congratulate you on this fucking useless code sample
you must be a project lead baby. show the WORLD you mean BUSINESS MOTHA FUKAAA yeah! hahahaha