Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001627graphvizOutput Generationpublic2009-06-25 23:412011-04-28 04:03
ReporterMatt 
Assigned Toellson 
PrioritynormalSeveritycosmeticReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSx86-Linux-CentOS release 5.3 (FiOS Version
Summary0001627: webdot generating different colours for the same colour label
Description



webdot is generating a different colour even though the same colour has been specified.



It appears it alters the colour based on the previous colour but this is just pure speculation.



Consider these two files:
[[email protected] dotcolours]# grep yellowgreen *.dot
gold.dot:yellow4 -> yellowgreen
gold.dot:yellowgreen [color=yellowgreen,style=filled]
green.dot:springgreen4 -> yellowgreen
green.dot:yellowgreen [color=yellowgreen,style=filled]
[[email protected] dotcolours]#






Both have the yellowgreen but when rendered each look very different, they seem to be closely related to the colour which was previously generated.
I captured a screenshot here:
http://i43.tinypic.com/140erdc.jpg [^]
Additional Information

\<A HREF="b1673a.dot"\>Here\</A\> is the second input file.

[ellson]
Ah! OK, you have lots of colors in your graph.

JPG is a lossy format. Most likely it is using some sort of indexed-color scheme which limits the number of discrete
colors it can represent in one image.

Try PNG.

Don't bother with GIF as it is also indexed.

[ellson]
FYI: For each background color with text on it, there are about 5 intermediate colors used to antialias the text, so indexes get used much faster than you might expect at first glance.
[ellson]
Apparently the png renderer used by webdot (from gd) also uses indexed colors! I'd forgotten this.

A workaround is to add "truecolor=1" to your graphs. This also improves the jpg output from the same renderer.

[matt] Is "truecolor=1" a permanent workaround or is something that can be fixed?

[north]
Shouldn't he be able to use the web-safe colors at least in GIF or PNG?

Is it possible for the hard-core to disable antialiasing?

[matt]
This workaround didn't solve the problem. I tried using:
<CD>
digraph gold
{
labelloc=t
truecolor=1
label = "Gold.\nThis shows all the X11 gold colours.";

and:
digraph gold
{
truecolor=1
labelloc=t
label = "Gold.\nThis shows all the X11 gold colours.";
</CD>


I made sure to delete all the files in the cache directory:
/var/cache/webdot/

As well as restart apache, and made sure I pressed Refresh in my browser but I still got a brownish colour for "yellowgreen" for my
gold.dot file. I was accessing the file using:
<CD>
/cgi-bin/webdot/dotcolours/gold.dot.dot.png.help
</CD>

<CD>
I'm using:
webdot-2.22.tar.gz
graphviz-2.22.2.tar.gz
from source, as well as:
gd-2.0.33-9.4.el5_1.1
gd-2.0.33-9.4.el5_1.1
gd-devel-2.0.33-9.4.el5_1.1
gd-devel-2.0.33-9.4.el5_1.1
gd-progs-2.0.33-9.4.el5_1.1
installed from rpm(both .i386 and .x86_64).
</CD>


Is there any other renderer that webdot uses besides gd? libpng, libmng, DevIL, ImageMagick?


I had libpng and libmng installed via rpm:
<CD>
libpng-1.2.10-7.1.el5_3.2
libpng-1.2.10-7.1.el5_3.2
libpng-devel-1.2.10-7.1.el5_3.2
libpng-devel-1.2.10-7.1.el5_3.2
libmng-1.0.9-5.1
libmng-1.0.9-5.1
libmng-devel-1.0.9-5.1
libmng-devel-1.0.9-5.1
</CD>

I have DevIL installed from source:
DevIL-1.7.8.tar.gz

I had these installed before I compiled and installed graphviz & webdot.

[north]
Matt, it would at least be a good idea to try viewing the file
locally in an image editor (gimp, imagemagik, evince,
what have you).

When you run dot -v, what renderer is actually being executed?
For example is it the cairo-based plugin?

A possible workaround for you is to use dot -Tps and render
the output through ghostscript which has various command
line options and types of drivers, e.g. png256, antialiasing can
be enabled or disabled, etc. See the man page (I don't have
the details memorized.)

Sorry about the problems.

[matt] This workaround didn't solve the problem. I tried using:
<CD>
digraph gold
{
labelloc=t
truecolor=1
label = "Gold.\nThis shows all the X11 gold colours.";

and:
digraph gold
{
truecolor=1
labelloc=t
label = "Gold.\nThis shows all the X11 gold colours.";
</CD>


I made sure to delete all the files in the cache directory:
/var/cache/webdot/

As well as restart apache, and made sure I pressed Refresh in my browser but I still got a brownish colour for "yellowgreen" for my
gold.dot file. I was accessing the file using:
/cgi-bin/webdot/dotcolours/gold.dot.dot.png.help

<CD>
I'm using:
webdot-2.22.tar.gz
graphviz-2.22.2.tar.gz
from source, as well as:
gd-2.0.33-9.4.el5_1.1
gd-2.0.33-9.4.el5_1.1
gd-devel-2.0.33-9.4.el5_1.1
gd-devel-2.0.33-9.4.el5_1.1
gd-progs-2.0.33-9.4.el5_1.1
installed from rpm(both .i386 and .x86_64).
</CD>


Is there any other renderer that webdot uses besides gd? libpng, libmng, DevIL, ImageMagick?


<CD>
I had libpng and libmng installed via rpm:
libpng-1.2.10-7.1.el5_3.2
libpng-1.2.10-7.1.el5_3.2
libpng-devel-1.2.10-7.1.el5_3.2
libpng-devel-1.2.10-7.1.el5_3.2
libmng-1.0.9-5.1
libmng-1.0.9-5.1
libmng-devel-1.0.9-5.1
libmng-devel-1.0.9-5.1
</CD>

I have DevIL installed from source:
DevIL-1.7.8.tar.gz

I had these installed before I compiled and installed graphviz & webdot.

[matt]
On the help page I right clicked on png (image/png) and "Save Target As..." and then viewed the file in a normal image viewer.
Unfortunately the yellowgreen was still brown.
<CD>
[[email protected] ~]# dot -v
dot - graphviz version 2.22.2 (20090313.1817)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.so.6
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
        /usr/local/lib/graphviz/config6
                was successfully loaded.
    render : cairo dot fig gd lasi map ps svg tk vml vrml xdot
    layout : circo dot fdp neato nop nop1 nop2 patchwork twopi
    textlayout : textlayout
    device : bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg pdf plain
plain-ext png ps ps2 svg svgz tga tif tiff tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg xbm
</CD>


How do I tell which renderer is being executed when it is called from webdot?
/cgi-bin/webdot/dotcolours/gold.dot.dot.png.help

Is there some line in either:
<CD>
webdot
webdot.tcl
webdot.tclet
</CD>

that I can edit so that when it calls dot it calls dot with the -v and redirects the output to syslog or a file somewhere?

[north] Generally I run webdot from a shell script that sets various limits
but that's not absolutely necessary. However this would be the
place to set up verbose, redirecting stuff to a file, etc.

Anyway from what you sent it appears the cairopango generator is the default.

Unless John Ellson says otherwise, it's doubtful to me that
truecolor does any good, as cairo has its own strange and
mysterious ways. (Possibly John knows how to
propagate the graphviz truecolor setting down to cairo.)

You might try the native gd/GIF driver, e.g. say dot -Tgif:?
and choose something from the list it prints out, e.g. -Tgid:gd (hopefully)

I am not sure you can succesfully pass the driver you want to webdot, e.g.

    yourserver.com/cgi-bin/webdot/yourfile.dot.neato.gif:gd

I suspect that some URL processing glop is going to strip off the final :gd

However you could change the graphviz plugin config file to prefer gif:gd
over gif:cairo

Maybe John can help us out here.

[ellson]
Webdot is old and not well maintained (sorry, I've moved on..) It only uses the gd based renderer which uses indexed colors by default.

The default render these days in the rest of graphviz is cairo based, and cairo doesn't support indexed colors, so truecolor is the default
(and the output files are about 4 times bigger).

Its conceivable we could optimize some code to give preference to the user-specified colors in the graph and let the antialising suffer with
a restricted of remaining colors... but there will still be a max of 256 colors.

I think, if many colors are important to you (say > 64 today), then use trucolor=1 (This test could also be automated... its just a SMOP)

[ellson]
Browser cache?

Can you rename the graph so that it becomes a completely fresh URL - just for testing?

Ctrl + Refresh or Shift + Refresh forces the browser to ignore its cache and request a new copy.

But to be sure I just did:
cp -p gold.dot gold2.dot

and then accessed it via:
/cgi-bin/webdot/dotcolours/gold2.dot.dot.png.help

and unfortunately the yellowgreen was still brown.

[ellson]
Can you send me gold2.dot please?

What browser? If you look at the image in another image viewer, do you see the same effect?

[matt]
You can download both gold.dot and gold2.dot from here:
http://production.healthywealthywater.net.au/dotcolours/ [^]

Or you could use the help page:
http://production.healthywealthywater.net.au/cgi-bin/webdot/dotcolours/gold.dot.dot.png.help [^]
http://production.healthywealthywater.net.au/cgi-bin/webdot/dotcolours/gold2.dot.dot.png.help [^]
and access the src link.

For the green.dot file the yellowgreen appears to be the correct colour:
http://production.healthywealthywater.net.au/cgi-bin/webdot/dotcolours/green.dot.dot.png.help [^]

For both gold.dot & green.dot is the very last colour is yellowgreen.

I'm using MSIE 6 as a web browser. I've also tried saving the png file and opening it in a image viewer and the colour is still
incorrect.

[north]
Your desktop is at least in 16 bit mode? (Or 24/32?)

MSIE is pretty old.

[matt]
Running in 32 bit colour.

[ellson] In order to support the "Graph by Webdot" signature feature, webdot was blindly creating an indexed color surface,
resulting in "truecolor" being ignored when the graph was later rendered to the surface.

I've made fixes to both graphviz and webdot which should be in tomorrow's snapshots.
TagsNo tags attached.
AUXILLARY-FILEShttp://www.graphviz.org/bugs/b1673a.dot [^]
DATE-FIXED
FIX-COMMENT
FORMER-ID1673
INPUT-FILEhttp://www.graphviz.org/bugs/b1673.dot [^]
OUTPUT-FILEhttp://www.graphviz.org/bugs/b1673.jpg [^]
STATUS-COMMENTFixed (29 Jun 2009)
VERSION     2.22
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user695


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker