PHP Classes

Rendering

Recommend this page to a friend!

      PHP SVG to Image Converter  >  All threads  >  Rendering  >  (Un) Subscribe thread alerts  
Subject:Rendering
Summary:Pixalation on resultant image
Messages:2
Author:Chris Zegelin
Date:2020-02-17 18:32:42
 

  1. Rendering   Reply   Report abuse  
Picture of Chris Zegelin Chris Zegelin - 2020-02-17 18:32:42
I could not find any reference to if, or how, you blur the edges of the SVG lines to create a better visual effect. I use Inkscape as a called process to do this rendering and the benefits of a pure PHP solution is huge. But not at the expense of visible pixalation in the result.

Inkscape does a very good job of rendering to an image.

Maybe I didn't look hard enough...

Chris

  2. Re: Rendering   Reply   Report abuse  
Picture of Chouchen Chouchen - 2020-02-17 21:47:11 - In reply to message 1 from Chris Zegelin
Hi, it's actually a good question!

Unfortunatly, I'm using GD which is kind of limited.

With this native library, we need to choose between style (thickness for example) and antialiasing (see here : https://www.php.net/manual/en/function.imageantialias.php ). I chose the first one over the other since, in my test case, I needed big stroke and I was not very interested in smoothness.

I may add a flag to allow to choose between the two.

In the meantime, if you need it, it's the `//imageantialias($this->_image, true);` in the `toImage` method to uncomment.

Regards