Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by Aragorn (Curate) on Mar 30, 2003 at 21:25 UTC
|
It depends on what sort of graphics and graphics manipulation you're planning to do. You mention a couple of things you want to do, and I think that Image::Magick is more geared to that sort of work. GD and other modules built on top of that (like GD::Graph) are more aimed at producing "new" images like charts.
Of course, the best thing to do is to experiment with both modules. Read the documentation and determine if it will do what you want. Write sample programs and experiment. Maybe there are other modules (you examples hint at Web-oriented graphics manipulations) which provide your needs out of the box and you don't need the "lower-level" Image::Magick or GD libraries.
Arjen | [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD (imager.pm)
by Aristotle (Chancellor) on Mar 30, 2003 at 22:37 UTC
|
I don't personally like GD much, but that's just my irrational bias. I submit you need to have a look at Imager before you decide on any one approach. It's as lightweight as GD but does much of what you'd otherwise reach for Image::Magick for.
The problem I ran into with this set of modules is notorious lack of documentation - you'll have to dip into the source, the example programs and take trips to its site and the mailing list archive frequently.
Makeshifts last the longest.
| [reply] |
|
I've never heard of Imager (and don't really have time to play with it now) - in what ways is it better than GD?I use GD quite extensively, but exclusively for image generation (so I've never had to touch Image::Magick), it'd be great to know if there is a module out there that can improve the quality of my life.
| [reply] |
|
| [reply] |
|
|
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by Dr. Mu (Hermit) on Mar 31, 2003 at 00:44 UTC
|
You mentioned wanting to manipulate .gif files. The current version of GD, at least, doesn't do that, due to the Unisys LZW patent. That may change this summer, however, when (I believe) the U.S. patent runs out. Of course, there may still be a lag from that time until the capability deleted from GD is restored. But you can always use .png instead! | [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by aquarium (Curate) on Mar 31, 2003 at 10:29 UTC
|
Pick up the book "Programming Web Graphics with Perl & GNU Software" by Shawn P. Wallace. It's a O'Reilly book which deals with just that topic and uses both + other libraries/approaches. It does cover gif, even animated gif.
Chris | [reply] |
|
| [reply] |
|
Interesting ... I ordered this book just before I posted the original question (I'm a die-hard O'Reilly fan). Thanks for the recomendation - I have a feeling that this book may be he way for me to come up to speed on the decision.
| [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by thpfft (Chaplain) on Mar 31, 2003 at 14:55 UTC
|
virtually all of the tasks will involve manipulating .gif and .jpeg images. Chores will likely be limited to creating thumbnails, cropping, rotating, and weight reduction
That all sounds like imagemagick to me. It'll even still handle gifs, iirc. And you will probably run into the same limitation with GD as i did: useless for photographic images because it can't handle anything over 8bit colour. But that was due to change in version 2.ish, so perhaps I'm out of date.
Generally I'd agree with others here: GD for image creation and IM for processing images that already exist. I'm off to have a look at that Imager, though :)
| [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by agent_foo (Novice) on Mar 31, 2003 at 15:56 UTC
|
I enjoy Perl Data Language......PDL...it has support for 3d, 2d graphs and very efficient for large data sets, contains a nice library of builtin graph-specific functions and transforms...
| [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by CompuKid101 (Novice) on Apr 01, 2003 at 22:04 UTC
|
The choice is quite clear, because GD sucks for image resizing.
See: GD vs NetBPM
ImageMagick has even better image quality when resizing than NetBPM thanks to its optional use of the lanczos algorithm used in the image resizing. | [reply] |
Re: Manipulating Graphics with Perl .. Image Magick Vs GD
by mattr (Curate) on Apr 06, 2003 at 10:04 UTC
|
I used and liked using the GIMP with Perl about a year or so ago. GIMP has a perl server and lets you do lots of photoshop-type things from perl. I used a simple interactive command line shell (using readline, I think I based it on something called pgshell) to test things and then after editting the command history put the commands into perl subroutines.
This, plus programming navigation rules and creating templates, enabled me (after a week or two) to build a thousand page site with a thousand photos, highlighting thumbnails laid out in a circular fashion, and lots of subsection links, in approximately 10 minutes of 100% CPU. Maybe two thirds of that time was spent watching The GIMP go crazy opening and closing windows, resizing them, etc.; the remaining time was used to generate the pages themselves (since we had were not able to use perl online actually).
Some interesting bits were being able to resize an image along its long axis and composite a frame using alpha channel masking. The best thing of all of course was when I got told that a bunch of photos would change. This would have been impossible to do in the time available considering everything that would have to be changed, with my "Magic Hands" Gimp compositing system it was easy. Anyway you may be interested to see what is possible even if it turns out too heavy for your project.
I did find some difficulty actually reading photoshop files sometimes, but this was many versions ago. There is a Film-Gimp project where it is used for filmmaking, you may find that useful too. I think there may be a way to run it from the command line, but don't know if you can get the perl server to launch. | [reply] |