I need to generate a PNG file of an image composed in LibreOffice Draw. When I export to PNG directly, the quality is almost perfect, but it's just slightly blurry. However, when I export directly to a PDF with lossless compression, the quality is perfect — just not in PNG format.
The dimensions of the image are 495×304. Whenever I try to convert the "perfect" PDF file to a high-quality PNG file, the PNG file at 100% magnification (as viewed in evince) is about 2-3 times larger than the image in the PDF file. Or, when I get the PDF converted to PNG at approximately the correct dimensions, the PNG file is too sharp.
I have tried commands like this
gs -sDEVICE=pngalpha -sOutputFile=new.png -r144 image.pdf
and
convert -quality 100 -density 300 image.pdf new.png
But neither command renders a PNG with quality as good as the PNG that can be directly exported to in LibreOffice Draw.
So, my question is how to do either of the following: (1) export to better quality PNG directly from LibreOffice Draw; or (2) convert the perfect quality PDF to PNG with comparable quality and same dimensions.
And here are the export settings I'm using when exporting directly to PNG:
Best Answer
There is something off about the Export tool of LibreOffice in general. It has been years, and it is sill broken. An alternative is just taking screen shot, but obviously you cannot control de resolution.
So a better work around is exporting to SVG, and then convert the SVG to PNG with Inkscape. Once download it, you can convert the file with the following command:
If you are in Windows (x64), you ll need to put the full path
If you install the 32 bit version, this should work:
Hope it helps somebody