[GRASSLIST:2278] Re: Poor quality PNG file driver output

Glynn Clements glynn.clements at virgin.net
Mon Jan 19 02:12:16 EST 2004


Jason Horn wrote:

> As for re-compiling grass, I'm not sure if I could do it.  I am using 
> 5.0.2 off of the OpenOSX CD because I'm not an expert with UNIX.  It 
> was a two-day ordeal for me to get the gd library compiled and running 
> on my system.  However, I would try to compile it (and all the other 
> libraries that go with it) if I thought it would help.  So, for Hamish, 
> or anyone else who can help...
> 
> 1) Why do you think re-compiling would help?  I wouldn't want to waste 
> days on that endeavor if it wouldn't work.

If the PNG driver was built using GD 1.x, it will use GD 1.x at
run-time (or fail to run if GD 1.x can't be found). There isn't any
way to make it use GD 2.x without re-compiling it.

The quote from Markus' book:

	"If the Gd2.x library is installed the driver supports true
	color output"

isn't entirely accurate. The determining factor is whether the driver
was built with GD 2.x, not whether GD 2.x happens to be present on the
system.

The official recommendation was to use GD 1.x, because more systems
have it installed, and GD 2.x was considered "beta" until recently.

> 2) If I do, which version should I compile?

Hard to say. 5.0.3 has some fixes; however, OpenOSX made some
Mac-specific changes to improve integration (e.g. allowing tcltkgrass
to use the Aqua version of Tcl/Tk) which aren't in the stock source
releases.

If you build 5.0.2 from the OpenOSX source code, you could just
replace the PNG driver ($GISBASE/driver/PNG) and continue using the
other OpenOSX binaries. That way, it wouldn't matter if you had
problems building any of the other components, so long as you could
build the PNG driver successfully.

FWIW, the current CVS version (5.3) no longer uses the GD library, and
will always support 24-bpp images.

> 3) Why do you think I'm getting the kind of poor quality from the PNG 
> driver?  Am I correct in assuming that it's because I don't have the 
> TRUECOLOR support from the gd library (even though it's now installed)?

Yes. GD 1.x only supports 256-colour images, and you can't make the
PNG driver use GD 2.x without re-compiling it.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list