Controlling png size

Hi,

I am trying to use graphviz to create icons consisting of a single html-node that fills the entire image and I want to be able to control the size of the resulting png.

I can as an example create a 100x100 png like this:

 graph G {
     bgcolor=transparent
     size="1!"
     dpi=100
     margin=0.0
     pad=0.0
       a [
        shape = plain
        label = <<table padding="0" cellspacing="0" border="1" cellborder="1">
                    <tr height="50">
                       <td rowspan="2" height="50" width="50" bgcolor="black"></td>
                       <td height="50" width="50" ></td>
                    </tr>
                    <tr>
                       <td height="50" width="50" ></td>
                    </tr>
                </table>>
    ]
   }

But what I don’t like about this is that while setting dpi to 100 and size to 1 I get a 100x100 image, I then also need to explicitly set the height and width of table elements to half of the desired size and that’s not exactly elegant…

So my question: Is there a better way to do this?

It is always fun to encounter a new Graphviz use.
The “html-like” code seems to insist on making things as small as possible, no matter what the user wants, so you are probably stuck with specifying height & width. If this is programmatically-generated, maybe not a big deal?

Depending on the complete nature of the desired icons, you might consider not using “html-like” nodes; instead explicitly placing rectangular nodes butted-up to each other or on top of each other. see FAQ | Graphviz