Suggestion for PlantUML customization

0 votes
asked Sep 27, 2014 in To be sorted by anonymous

Hi,

I have customized PlantUML and my code generate a BufferedImage, it does not use the graphic system of PlantUML.

So at export time I need, in my exportDiagram() method, to insert my image into an ImageBuilder. I don't want to export directly a PNG because I need the eps output.

My solution was (look at the image variable):

        builder.addUDrawable(new UDrawable() {
            public void drawU(UGraphic ug) {
                ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
                ug.draw(new UImage(image));
            }
        });

 

Is this the best solution? Because the resulting eps file does not have the same quality as the PNG image.

Thx

Mar

1 Answer

0 votes
answered Sep 28, 2014 by plantuml (298,440 points)
Yes, your solution is the best if you are using a BufferedImage.

However, since a BufferedImage is a raster format (in opposition to a vector format), you cannot expect the same quality for EPS (which is vector). However, the raster image inside the EPS should be the same as the PNG (your sentence is ambiguous about this).

Using UGraphic (the graphic system of PlantUML) would give better results.

Maybe you should publish both files (EPS and PNG) so that we get your point ?

Thanks,
commented Sep 29, 2014 by anonymous
Thanks, I stayed with the solution your confirmed to me to be the best one.
If you are interested in I posted a message here http://www.mar9000.org/bliki/sketching-ui-with-text-tools.g4.html

Thx,
Mar
...