You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have issues using svg-to-png and the underlying pupperteer modules due to a proxy issue. I also did not like the size and overhead that these modules bring with them.
As a result of this, I started to investigate processing the generated SVG with regular image processing tools like imagemagick, or the npm package sharp, but found these had subtle issues with processing the SVG.
I was able to resolve these issues with the following custom command, which allowed me to use sharp in the following manner:
Most of these changes are transparent to the output, and will work fine in a browser, as well as with generic image processing tools. The only exception to this for which I have been unable to find a workaround for is the receiptlineinvert filter. Whilst what I have provided above seems to work well in an image processor or sharp, in chrome there is just a bit too much "padding" around the element.
Is there some way to incorporate these changes so that generic image processing tools can be used to process the svg?
The text was updated successfully, but these errors were encountered:
I have tried your custom command.
The processing speed was very fast and the text positioning was improved.
But in some cases, multibyte characters were out of place.
As you know, SVG implementations have compatibility issues.
So may not be positioned as expected.
In order for image processing tools to do the expected conversion, the must be used.
Currently, the most compatible SVG implementations are web browsers.
So we use puppeteer, although it is larger in size and overhead.
I think your custom command is a good solution under limited conditions.
I have issues using
svg-to-png
and the underlyingpupperteer
modules due to a proxy issue. I also did not like the size and overhead that these modules bring with them.As a result of this, I started to investigate processing the generated SVG with regular image processing tools like imagemagick, or the npm package sharp, but found these had subtle issues with processing the SVG.
I was able to resolve these issues with the following custom command, which allowed me to use sharp in the following manner:
Not only is this significantly quicker than puppeteer, it is also comes with a much smaller dependency size.
My custom command is as below:
Most of these changes are transparent to the output, and will work fine in a browser, as well as with generic image processing tools. The only exception to this for which I have been unable to find a workaround for is the
receiptlineinvert
filter. Whilst what I have provided above seems to work well in an image processor or sharp, in chrome there is just a bit too much "padding" around the element.Is there some way to incorporate these changes so that generic image processing tools can be used to process the svg?
The text was updated successfully, but these errors were encountered: