A program that automatically converts your SVG 🖼️ to another viewBox size, taking in count points, paths, positions and more! 🎉
To run the program you need to have Python3 installed on your machine (preinstalled on the majority of linux systems) and BeautifulSoup4
- You can install the latest version of Python here.
- To install BeautifulSoup4 just open your terminal, type
pip install beautifulsoup4and press Enter.
Python3 (the programming language)
BeautifulSoup4 (to work with
xml)
-
After you have installed all the dependencies and downloaded the source code you can run the program by typing in the terminal (that's opened in the directory you downloaded the source code)
python3 ChangeViewBox.pyand pressing Enter. -
if there is any bug with lxml, please try running
pip install lxml.
* Make sure you downloaded both: ChangeViewBox.py and the Packages directory.
- There are several options to choose from (you will see when you'll run it :D). E.g. It can read the code from an already created svg file and convert into the desired viewbox in the desired file. And it (should) work with any viewbox, for example "16 32" (observed bugs with h/H and v/V in path, so If you want it to work properly with max_x != max_y, please replace them with l/L).
- Currently the program is limited to changing
width,x,cx,rx,height,y,cy,ry,points,d,r,stroke-width, therefore you could still need to change some parameters by yourself, takingtransformfor instance. But here comes the following option:- You can choose an option that will convert your desired number to another viewbox, yet this option, unlike the precedent one, only works with svgs with the same viewbox's height and width, for example "0 0 16 16", where 16 == 16.