Is the PNG output size limited to 4096 pixels only?

0 votes
asked Feb 2, 2016 by anonymous
Hello!

I have a large activity diagram, which grew more than 4096 pixels tall. I noticed first that the bottom of the diagram was missing. This can be fixed by using the scale command, which allows the whole diagram to fit nicely to the size given. Unfortunately the fonts and diagram elements start to get unclear (pixelated) when the diagram gets very large.

I tried to use a number which is bigger than 4096 in the scale command limits, but the output was clipped to 4096 picels high.

My version is: PlantUML version 8034 (Sat Jan 09 12:07:59 EET 2016)

Regards, Ville

1 Answer

0 votes
answered Feb 2, 2016 by plantuml (131,770 points)
Hello,

Yes, there is a limit at 4096 pixels, to avoid memory issues.

We can provide a setting that would allow to increase this limit.

Can you tell us how you are using PlantUML ? Command line ? Ant task ? Plugin in ?

Thanks
commented Feb 2, 2016 by anonymous
I'm using PlantUML from the command line and from the Eclipse plugin. I guess the best option would be to allow setting the image area larger than the current maximum via the "scale" and "scale max" commands which specify the sizes as pixels.

Another useful extension would be to allow setting just one of the dimensions to a maximum value, e.g. "scale max 5000 height ", which would allow just the height size to exceed the default limit. Currently it is not possible to set the max size for just one dimension.

Perhaps, another viable option would be to implement a pragma for increasing the size limit.
Regards, Ville
commented Feb 2, 2016 by plantuml (131,770 points)
Ok, in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
You can have :

@startuml
scale max 50 height
class Foo1
class Foo2
@enduml

There is an additional setting: you can define a environment variable PLANTUML_LIMIT_SIZE (which default value is 4096).
You have to define this env variable before launching PlantUML.
Something like:
set PLANTUML_LIMIT_SIZE=100
or
setenv PLANTUML_LIMIT_SIZE 100

Another way is an option in the command line:
java -DPLANTUML_LIMIT_SIZE=70 -jar c:/ant/lib/plantuml.jar -v foo1.txt

This has not been highly tested, so feedback is welcome.
commented Feb 3, 2016 by anonymous
This seemed to work nicely at least using the environment variable method. Also the new scal syntax seems to work based on the very limited tests I have done.

Thanks a lot for the very quick response.

Regards, Ville
commented Aug 15, 2016 by cgoguyer (540 points)
Hello

Is this feature implemented in the last plantuml.war ?
commented Aug 20, 2016 by plantuml (131,770 points)
Yes it should.
Note that you have to set up the variable *before* launching your web server.
...