Poor exported PNG quality and text cutting
See original GitHub issueThank you so much for this great extension.
First issue My text gets cutted. Se the numbers in the images.
Next “issiue” I have installed the extension on my vb.net server and I am linking to a function (called latex2png - see below) in the code:
Shared Function latex2png(latex As String) As MemoryStream
Dim parser = New TexFormulaParser()
Dim formula = parser.Parse(latex)
formula.GetRenderer(TexStyle.Script, 15.0, "Arial")
Dim pngBytes = formula.RenderToPng(15.0, 0.0, 0.0, "Arial")
Dim latexpng As New MemoryStream(pngBytes)
Return latexpng
End Function
Everything is working great, but sadly the quality of the image could be much better. Is there any way to get a higher quality of the png image that is created? Hope you can help me.
Seems like making the scale bigger is better. But the image gets to large in the end.
SCALE 12
SCALE 15
SCALE 25
BTW. I am writing the code in vb.net in aspx, and I am a novice. So go easy on me, when explaining. 😃
Kind regards Troels Christensen
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Poor exported PNG quality and text cutting · Issue #168
Poor exported PNG quality and text cutting #168 ... Is there any way to get a higher quality of the png image that...
Read more >Poor export quality in adobe xD
I'm facing the issue in export for design (x1) JPG or PNG. ... at these lower factors, so your text will indeed be...
Read more >Exporting PNG - Blurry - InkscapeForum.com
Hello, When I am trying to export my work to a PNG file it is coming out rather blurry. People who have saved...
Read more >Exporting fonts in image cutting off letters
I am trying to export a png of copy and Figma is cutting off the curvature of “S” or “C” in the image....
Read more >text blured when exporting to png for website use
When I export an image to PNG the text appears blurred or pixelated in windows pic viewer as well as on my website....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, after some additional research I have the working prototype. There’re two problems:
TranslateTransform
to them if they’re out of bounds.TexRenderer.RenderToBitmap
have poor resolution by default (something like 96 DPI because that’s the default resolution for “Display Independent Pixels”). Solution: Allow the users to define their own resolution instead of the default one.@troelschristensen one of the quality solutions for now would be to use SVG instead of PNG. Take a look at our example project: it has the stuff to render the formula into SVG image, it will scale much better.
I was able to reproduce your “cutting” issue and I’m investigating it.