Inkscape.org
Beyond the Basics Batch convert svg, add fill and stroke , ouput png
  1. #1
    strucl113 strucl113 @strucl113
    *

    Hello!

    I'm new to Inkscape. I need to convert 2000 black SVG icons to 2 colour PNG icons. I need to add colour fill and black border. I did it in GUI first to see if it can be done, and I did it now I need to automate it. Is there a way to do it with batch?

    I added settings for fill and stroke menu.

    Thank you

    Pic1
  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    *

    To change all the colors, I'd use a text editor's find and replace tool across documents.  e.g.

    Change this:

    style="fill-rule:evenodd;stroke-width:2;stroke-linejoin:round"

    to this:

    style="fill:#ffaaaa;fill-rule:evenodd;stroke:#008000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round"

    See image below. (click) Note that I only have one document open, you would have many.

     

    I'd follow that multi-document change with a command-line batch export for svg to png. https://inkscape.org/doc/inkscape-man.html

     

    Textpad Changeall
Inkscape Inkscape.org Inkscape Forum Beyond the Basics Batch convert svg, add fill and stroke , ouput png