Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rescale image node?

Tags:

graphviz

Without using HTML, what is a straightforward way to resize external images used in a GraphViz document? For example, with the following:

somenode [size=1 image="littleperson.png", label=""];

How can the image be made smaller? [Preferably without HTML, using HTML if it's most straightforward/unavoidable.]

I'm not having much luck with HTML:

somenode [label=<<IMG SRC="littleperson.png" />>];

Throws back an error.

like image 597
d-cubed Avatar asked Dec 29 '14 19:12

d-cubed


People also ask

How do I resize an image in coding?

One of the simplest ways to resize an image in the HTML is using the height and width attributes on the img tag. These values specify the height and width of the image element. The values are set in px i.e. CSS pixels.

How do I resize an image in Linux?

Quickly resize images with right click in Linux Now if you right click on an image, you'll see two new options of resizing and rotating in the context menu. You can choose the resize option to resize the image right from the right-click menu quickly. It will present you with a few options for resizing the image.

How do I resize an image in Java?

You can resize an image in Java using the getScaledInstance() function, available in the Java Image class. We'll use the BufferedImage class that extends the basic Image class. It stores images as an array of pixels.


1 Answers

You can make the external images smaller several ways.

  • Without HTML, Using imagescale attribute and / or fixedsize attribute, along with the width and height attributes of the node.

    somenode [width=50 height=50 fixedsize=true image="littleperson.png", label=""];

  • With HTML (img HTML tag takes the scale attribute which has same parameters as imagescale), attributes for fixedsize and height and width are of the td which contains the image tag.

    somenode [label=< <table><tr><td fixedsize="true" width="50" height="50"><img src="littleperson.png" /></td></tr></table> >];

  • Resize the image in a external program and load it

    somenode [image="littleperson_resized.png", label=""];

Further documentation / References

  • How to display an image in a Node
  • How to set width and height of image displayed in a Node
  • Graphviz Shapes Documentation
  • Graphviz Attribute Documentation
like image 139
Appleman1234 Avatar answered Sep 20 '22 06:09

Appleman1234