Giter Club home page Giter Club logo

pmotion2svg's Introduction

pmotion2svg

license MIT 00b5da  release 1.1  pmotion2svg  PureBasic 5  Pro%20Motion%20NG 7.2

Blinky

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.



About

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.

Features

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.

SVG Optimization

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:

  • SVGO — command-line SVG Optimizer (Node.js).

  • SVGOMG — SVGO web interface (no installation required).

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.

Installing

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 →

%PROGRAMFILES(X86)%\cosmigo\Pro Motion NG\plugins\

Windows 32-bit →

%PROGRAMFILES%\cosmigo\Pro Motion NG\plugins\

Future editions of Pro Motion NG might change the location of the plugins/ folder to the User’s AppData/ directory tree — a feature which has been planned for quite a while. In that case, just copy the plug-in DLL to the new plugins/ folder path, as indicated in the Using Plugins section of Pro Motion NG’s Documentation.

System Requirements

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.

License

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.

pmotion2svg's People

Contributors

tajmone avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pmotion2svg's Issues

Enable Travis CI on Cosmigo

@jan-cosmigo, can you please enable Travis CI for this repository?

https://travis-ci.com/

After the repo ownership transferal all Travis continuous integration operations are working via redirection, but I'll be updating all URLs and references from the old repository to the new one, which might break Travis CI validation and badge images if the cosmigo organization doesn't have a Travis CI account, or if it isn't set to allows Travis integration on all its repositories.

Enabling Travis on all the repos would allow any future ownership transferal to seamlessly carry over its Travis jobs without requiring manual intervention.

NOTE — Travis CI free accounts should now be created on travis-ci.com, and not travis-ci.org (in case you have an old Travis account).

In the past the latter was used for free accounts, and the former for paid customers; but this was changed in the course of time and old users from the ".org" domain were asked to migrate their accounts and repositories to the ".com" domain. The ".org" domain will shut down soon anyway.

Update URLs Pointing to @tajmone

Ownership of this repository was transfered to the newly created @cosmigo organization:

Replace all references to the old repository URL, form the @tajmone user account to the @cosmigo organization in:

  • Repo settings comments.
  • README.adoc.

In the plug-in source files:

  • src\pmotion2svg.pb — the #Repository$ constant, used for creating the text strings for the About dialog and the URLs for the links menus.

TRAVIS CI NOTE — Travis CI validation (and its status badge) will not work until @cosmigo enables Travis on the repository (See #1). Since the badge is already broken on main branch, there's no need to wait for Travis enabling before merging these fixes.

PB CODE NOTE — The constant in the PureBasic code will have to updated separately, when a new release is created. In the meantime, old links will still work as before because they will automatically redirected to the new repository location; so there's no rush to release a plug-in update.


References

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.