Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002502graphvizOutput Generationpublic2014-11-24 05:332014-11-24 17:17
Reportergrandinj 
Assigned Toellson 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0002502: generate output in indexed PNG format
DescriptionHi

Over at LibreOffice, we manage to generate quite a large volume of diagrams.
We would like to shrink the size of our output files by using indexed-PNG format.
See comment here:
http://stackoverflow.com/questions/27036474/how-do-make-doxygen-generate-index-color-png-files [^]

Thanks
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION
Attached Files

- Relationships

-  Notes
User avatar (0000853)
ellson (administrator)
2014-11-24 11:46

The easiest change for me was to force gd to always generate indexed color pngs since there are plenty of other ways to produce truecolor pngs.

Now:
      -Tpng:gd:gd (or -Tpng:gd) - indexed color, no antialiasing
      -Tpng:cairo:gd - indexed color, with antialising
      -Tpng:cairo:cairo (or -Tpng) - truecolor, with antialising

work:~$ echo "digraph {hello->world}" | dot -Tpng:gd:gd | wc -c
850
work:~$ echo "digraph {hello->world}" | dot -Tpng:cairo:gd | wc -c
2199
work:~$ echo "digraph {hello->world}" | dot -Tpng:cairo:cairo | wc -c
6080


You will need to install graphviz-plugin-gd

The change was:

diff --git a/plugin/gd/gvdevice_gd.c b/plugin/gd/gvdevice_gd.c
index 3267ba1..2c50d69 100644
--- a/plugin/gd/gvdevice_gd.c
+++ b/plugin/gd/gvdevice_gd.c
@@ -136,7 +136,7 @@ static void gd_format(GVJ_t * job)
 
 #ifdef HAVE_GD_PNG
     case FORMAT_PNG:
- gdImageSaveAlpha(im, TRUE);
+ gdImageTrueColorToPalette(im, 0, 256);
        gdImagePngCtx(im, &ctx);
         break;
 #endif
User avatar (0000854)
ellson (administrator)
2014-11-24 11:48

The change will be in tomorrow's build.

- Issue History
Date Modified Username Field Change
2014-11-24 05:33 grandinj New Issue
2014-11-24 11:46 ellson Note Added: 0000853
2014-11-24 11:48 ellson Note Added: 0000854
2014-11-24 17:17 erg Assigned To => ellson
2014-11-24 17:17 erg Status new => resolved
2014-11-24 17:17 erg Resolution open => fixed


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