|
Creating/Manipulating Images with gd (Linux Journal)Creating/Manipulating Images with gd (Linux Journal)Posted Jan 11, 2006 9:46 UTC (Wed) by evgeny (subscriber, #774)In reply to: Creating/Manipulating Images with gd (Linux Journal) by rknop Parent article: Creating/Manipulating Images with gd (Linux Journal)
> Netpbm is great for stringing together commands with a pipe to make an alias to do something you want
Unfortunately, the accompanying netpnm library is restricted to basic I/O stuff only. A lot of useful functionality (resizing/rotating/cropping/...) is stick into respective executables instead of being available as a C API. A pity - I, for example, can't find a simple portable library for the above tasks.
Regarding GD - it's simple and nice for simple tasks, but once you begin worring about the quality, it becomes inadequate. Drawing thin lines, patterned lines, control of beveling, linecaps,... If you're interested in an _accurate_ device-independent pixmap drawing, I strongly suggest libxmi (http://www.gnu.org/software/libxmi/). It's based on the X model, so everything that exist in the 2D X drawing API is there, too, with the same level of quality. And it's very fast as well.
(Log in to post comments)
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 11, 2006 16:36 UTC (Wed) by bk (guest, #25617) [Link] What about cairo? Isn't that what it's designed for?
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 11, 2006 22:25 UTC (Wed) by evgeny (subscriber, #774) [Link] Cairo depends on quite a few libraries, the most annoying being the X11 stuff. Obviously, this makes it unusable in the [web]server deployments. Same problem as of imlib, libMagic, etc.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 12, 2006 11:47 UTC (Thu) by dcoutts (subscriber, #5387) [Link] No, X11 is merely one of the many cairo backends. You can build it with just the PNG backend.
It doesn't depend on much else in fact, just fontconfig, freetype & zlib. In other words it has the same deps as gd (when gd is built with optional truetype and png support). It should be perfectly suitable for use on a web server.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 12, 2006 13:26 UTC (Thu) by evgeny (subscriber, #774) [Link] > No, X11 is merely one of the many cairo backends.
I guess you're right. But all Linux distros ship it with the X11 backend, so you have no straightforward choice. Hopefully, they'll learn to make it as an optional loadable module.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 15, 2006 16:18 UTC (Sun) by bk (guest, #25617) [Link] Gentoo is perfectly capable of building Cairo without the X backend.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 15, 2006 20:04 UTC (Sun) by evgeny (subscriber, #774) [Link] ... with the obvious result that most of the apps currently using Cairo [for drawing on X] stop working. All backends must be optional, but not at the compile time - at the run time.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 11, 2006 22:58 UTC (Wed) by sfeam (subscriber, #2841) [Link] > once you begin worring about the quality, it becomes inadequate. Drawing thin lines, patterned lines, control of beveling, linecaps...
GD is used by recent versions of gnuplot, and produces very nice plots indeed. I agree that its handling of antialiasing is inadequate (except for fonts, where it uses libfreetype). However some of the other issues you mention, like beveling, are not an intrinsic limitation of the library, just an unfortunate choice of default settings. You can get better line quality and line joins by defining your own brushes rather than using the default.
Creating/Manipulating Images with gd (Linux Journal) Posted Jan 12, 2006 14:24 UTC (Thu) by evgeny (subscriber, #774) [Link] > GD is used by recent versions of gnuplot,
I thought gnuplot uses by default plotutils which in turn uses libxmi?
|
Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.