A Pro Motion NG plug-in to neatly convert images to SVG, without loosing the Pixel Art look and feel.
Created in PureBasic by Tristano Ajmone, released under MIT License.
This plug-in will extend Pro Motion NG’s functionality to support exporting images to the SVG format in a manner that preserves their Pixel Art look and feel.
At export time, the user is presented with and options dialog where he/she can choose:
-
Scale Factor — how many SVG pixels will be used to represent each original pixel when drawing it as a filled square.
-
Padding — the amount of SVG pixels used as padding around the generated image.
-
Draw Pixels Grid — if checked, the generated image will display a 1px grid (black) between the original pixels and around the image.
-
Preserve Transparency — if an indexed image has a transparency color defined, you can choose whether to preserve its transparency or paint its original color as an SVG rectangle representing the image background.
When converting Pixel Art to SVG, pmotion2svg will draw consecutive pixels of the same color as a single rectangle, thus reducing the size of the generated SVG. Furthermore, it will generate the SVG by scanning the raster image both horizontally and vertically, and will then use the version which takes less memory. This optimization technique was borrowed from Eric Meyer’s px2svg tool.
Nonetheless, you’re strongly advised to further optimize the generated SVG images with a dedicated optimizer like SVGO:
Processing the SVG images generated with this plugin with an SVGO-based optimizer can reduce considerably their size (usually, a size gain between 40% and 80%).
💡
|
The pmotion2svg options dialog contains a menu with links to these SVG optimizers, so you can easily access the SVGOMG online tool to optimize your generated SVGs directly in your browser. |
Download the latest precompiled binary package from the
releases page,
unpack its contents and copy the pmotion2svg.dll
file to the plugins/
folder of Pro Motion’s installation folder.
Depending on your Windows OS bitness, the plugins directory path will be located either at:
Windows 64-bit → |
|
Windows 32-bit → |
|
❗
|
Future editions of Pro Motion NG might change the location of the |
This plug-in was tested under Windows 10 x64 using Pro Motion NG version 7.2.7, but should work also with older versions of Pro Motion that support plug-ins via the File I/O interface.
If you need support for using this plug-in with older version of Pro Motion, please ask for help on the Cosmigo Forum.
If you need to report a pmotion2svg bug or propose a new feature, just open an Issue.
This plug-in was heavily inspired by the px2svg tool (formerly flaming-shame) by Eric Meyer, Amelia Bellamy-Royds, Robin Cafolla, Neal Brooks and ignace nyamagana butera:
MIT License Copyright (c) 2021 Tristano Ajmone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.