aspose-svg-net


Nameaspose-svg-net JSON
Version 24.5.0 PyPI version JSON
download
home_pagehttps://products.aspose.com/svg/python-net/
SummaryAspose.SVG for Python via .NET enables creating, editing, rendering, and converting SVGs to formats like PNG, PDF, and more, excelling in image vectorization. Perfect for developing SVG tools.
upload_time2024-05-22 06:01:27
maintainerNone
docs_urlNone
authorAspose
requires_python<3.12,>=3.6
licenseNone
keywords aspose aspose.svg aspose.total python component conholdate conholdate.total convert converter vectorization vectorizer vectorize encoding base64 css dom dom-manipulation image jpeg library linux macos microsoft mvc net-standard netcore netstandard to pdf png rotate security standard svg svg-to-gif svg-to-jpeg svg-to-pdf svg-to-png svg-to-tiff svg-to-xps png-to-svg jpg-to-svg visualstudio xpath xps svg windows vector graphics line bezier curves cubic glyphs paths text scaling rotation skewing fill dots bitmap html filters gaussian shadow lighting effects color linear radial
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Process & Manipulate SVG via Python API

<!--- banner links to [Temporary License](https://purchase.aspose.com/temporary-license) -->
[![banner](https://products.aspose.com/svg/images/aspose_svg-for-python-banner-TL.png)](https://purchase.aspose.com/temporary-license)

[Product Page](https://products.aspose.com/svg/python-net/) | [Docs](https://docs.aspose.com/svg/python-net/) | [Demos](https://products.aspose.app/svg/applications) | [API Reference](https://reference.aspose.com/svg/) | [Examples](https://github.com/aspose-svg/) | [Blog](https://blog.aspose.com/category/svg/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/svg) 

[Aspose.SVG for Python via .NET](https://products.aspose.com/svg/python-net/) is a powerful on-premise class library designed to seamlessly work with SVG files in a wide range of operations without the need for additional SVG manipulation tools. It allows you to create, edit, optimize, and convert SVG. Python API allows you to manipulate documents and elements and provides robust navigation and inspection functionalities, such as XPath queries and CSS selectors. Developers can also vectorize images and texts, apply SVG transformations, filters, gradients, and patterns, and specify colors in different color formats. Aspose.SVG for Python via .NET is perfectly suited for building applications such as SVG editors, converters, mergers, and image vectorizers catering to developers who require extensive SVG processing capabilities.

## SVG API Features

The following are some popular features of Aspose.SVG for Python via .NET:

- **Cross-Platform Compatibility:** Aspose.SVG can be used to develop applications across different operating systems including Windows, Linux, and macOS.
- **Versatile Document Manipulation:** The Python API enables comprehensive manipulation of SVG files, supporting a wide range of SVG specifications. This includes everything from creating and modifying SVG content to converting SVG into popular formats like PDF, PNG, JPEG, GIF, WEBP, and more.
- **Direct Programmatic Access:** The Python API provides developers with direct access to the SVG elements and their properties, facilitating precise control over SVG content.
- **High-Quality Rendering:** The Python API offers high fidelity rendering of SVG files, ensuring that the output closely matches the original design, akin to native SVG rendering in browsers.
- **Extensive Documentation and Examples:** Aspose.SVG for Python via .NET provides detailed documentation and guides to help developers understand and use the API effectively, along with code examples for common tasks.

## Platform Independence

Aspose.SVG for Python via .NET is currently supported on Windows for developing applications where Python 3.6 or later is installed. You can build both 32-bit and 64-bit Python applications. Support for Linux and macOS X is planned for future versions.

## Get Started

Ready to give Aspose.SVG for Python via .NET a try?

Simply run ```pip install aspose-svg-net``` from the Console to fetch the package.
If you already have Aspose.SVG for Python via .NET and want to upgrade the version, please run ```pip install --upgrade aspose-svg-net``` to get the latest version.

You can run the following snippets in your environment to see how Aspose.SVG works, or check out the [GitHub Repository](https://github.com/aspose-svg/) or [Aspose.SVG for Python via .NET Documentation](https://docs.aspose.com/svg/python-net/) for other common use cases.

## Using Python to Convert SVG to PDF

Aspose.SVG for Python via .NET also allows you to convert SVG to PDF, XPS, PNG, JPEG, TIFF, WEBP, and other file formats. The following snippet demonstrates the conversion from SVG to PDF:

```python
import aspose
from aspose.svg import *
from aspose.svg.converters import *
from aspose.svg.drawing.skiasharp import *
from aspose.svg.rendering import *
from aspose.svg.drawing import *

# Activate the Aspose.SVG.Drawing.SkiaSharp feature
Configuration.set_extension(SkiaModule())
options = PdfSaveOptions()
options.background_color = aspose.pydrawing.Color.transparent
options.page_setup.sizing = SizingType.FIT_CONTENT
options.horizontal_resolution = Resolution.from_dots_per_inch(96.0)
options.vertical_resolution = Resolution.from_dots_per_inch(96.0)
with SVGDocument("source.svg") as document:
	# Convert SVG to PDF
    Converter.convert_svg(document, options, "result.pdf")
```

## Using Python to Vectorize Images

Aspose.SVG for Python via .NET also allows you can convert a raster image to vector graphic using default or custom configuration options. You will be able to apply custom settings to get the best result of the image-to-vector conversion and save the output SVG file to your computer. The following snippet demonstrates the image vectorization:

```python
import os
from aspose.svg import *
from aspose.svg.converters import *
from aspose.svg.drawing import *
from aspose.svg.rendering.image import *
from aspose.svg.imagevectorization import *

# Setup directories
input_folder = "path/to/input_folder/"
output_folder = "path/to/output_folder/"
if not os.path.exists(output_folder):
    os.makedirs(output_folder)

# Configuration for vectorization
path_builder = BezierPathBuilder()
path_builder.trace_smoother = ImageTraceSmoother(2)  # Example severity level
path_builder.error_threshold = 30.0  # Example threshold
path_builder.max_iterations = 30  # Example max iterations

vectorizer = ImageVectorizer()
vectorizer.configuration.path_builder = path_builder
vectorizer.configuration.colors_limit = 25  # Example color limit
vectorizer.configuration.line_width = 1.0  # Example line width

# Vectorize the image
src_file = "example_image.png"  # Specify the test file
with vectorizer.vectorize(os.path.join(input_folder, src_file)) as document:
    output_file = os.path.join(output_folder, src_file + ".svg")
    document.save(output_file)
```
[Product Page](https://products.aspose.com/svg/python-net/) | [Docs](https://docs.aspose.com/svg/python-net/) | [Demos](https://products.aspose.app/svg/applications) | [API Reference](https://reference.aspose.com/svg/python-net/) | [Examples](https://github.com/aspose-svg/) | [Blog](https://blog.aspose.com/category/svg/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/svg) | [Temporary License](https://purchase.aspose.com/temporary-license)


            

Raw data

            {
    "_id": null,
    "home_page": "https://products.aspose.com/svg/python-net/",
    "name": "aspose-svg-net",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.6",
    "maintainer_email": null,
    "keywords": "Aspose, Aspose.SVG, Aspose.Total, Python, Component, Conholdate, Conholdate.Total, convert, converter, vectorization, vectorizer, vectorize, encoding, base64, css, DOM, dom-manipulation, image, JPEG, Library, Linux, macOS, Microsoft, mvc, net-standard, netcore, netstandard, to PDF, PNG, rotate, security, Standard, svg, svg-to-gif, svg-to-jpeg, svg-to-pdf, svg-to-png, svg-to-tiff, svg-to-xps, png-to-svg, jpg-to-svg, VisualStudio, XPath, XPS, SVG, Windows, Vector Graphics, line, Bezier Curves, Cubic, Glyphs, Paths, Text, Scaling, Rotation, Skewing, Fill, Dots, Bitmap, HTML, Filters, Gaussian, Shadow, Lighting Effects, Color, Linear, Radial",
    "author": "Aspose",
    "author_email": null,
    "download_url": null,
    "platform": "win32",
    "description": "# Process & Manipulate SVG via Python API\r\n\r\n<!--- banner links to [Temporary License](https://purchase.aspose.com/temporary-license) -->\r\n[![banner](https://products.aspose.com/svg/images/aspose_svg-for-python-banner-TL.png)](https://purchase.aspose.com/temporary-license)\r\n\r\n[Product Page](https://products.aspose.com/svg/python-net/) | [Docs](https://docs.aspose.com/svg/python-net/) | [Demos](https://products.aspose.app/svg/applications) | [API Reference](https://reference.aspose.com/svg/) | [Examples](https://github.com/aspose-svg/) | [Blog](https://blog.aspose.com/category/svg/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/svg) \r\n\r\n[Aspose.SVG for Python via .NET](https://products.aspose.com/svg/python-net/) is a powerful on-premise class library designed to seamlessly work with SVG files in a wide range of operations without the need for additional SVG manipulation tools. It allows you to create, edit, optimize, and convert SVG. Python API allows you to manipulate documents and elements and provides robust navigation and inspection functionalities, such as XPath queries and CSS selectors. Developers can also vectorize images and texts, apply SVG transformations, filters, gradients, and patterns, and specify colors in different color formats. Aspose.SVG for Python via .NET is perfectly suited for building applications such as SVG editors, converters, mergers, and image vectorizers catering to developers who require extensive SVG processing capabilities.\r\n\r\n## SVG API Features\r\n\r\nThe following are some popular features of Aspose.SVG for Python via .NET:\r\n\r\n- **Cross-Platform Compatibility:** Aspose.SVG can be used to develop applications across different operating systems including Windows, Linux, and macOS.\r\n- **Versatile Document Manipulation:** The Python API enables comprehensive manipulation of SVG files, supporting a wide range of SVG specifications. This includes everything from creating and modifying SVG content to converting SVG into popular formats like PDF, PNG, JPEG, GIF, WEBP, and more.\r\n- **Direct Programmatic Access:** The Python API provides developers with direct access to the SVG elements and their properties, facilitating precise control over SVG content.\r\n- **High-Quality Rendering:** The Python API offers high fidelity rendering of SVG files, ensuring that the output closely matches the original design, akin to native SVG rendering in browsers.\r\n- **Extensive Documentation and Examples:** Aspose.SVG for Python via .NET provides detailed documentation and guides to help developers understand and use the API effectively, along with code examples for common tasks.\r\n\r\n## Platform Independence\r\n\r\nAspose.SVG for Python via .NET is currently supported on Windows for developing applications where Python 3.6 or later is installed. You can build both 32-bit and 64-bit Python applications. Support for Linux and macOS X is planned for future versions.\r\n\r\n## Get Started\r\n\r\nReady to give Aspose.SVG for Python via .NET a try?\r\n\r\nSimply run ```pip install aspose-svg-net``` from the Console to fetch the package.\r\nIf you already have Aspose.SVG for Python via .NET and want to upgrade the version, please run ```pip install --upgrade aspose-svg-net``` to get the latest version.\r\n\r\nYou can run the following snippets in your environment to see how Aspose.SVG works, or check out the [GitHub Repository](https://github.com/aspose-svg/) or [Aspose.SVG for Python via .NET Documentation](https://docs.aspose.com/svg/python-net/) for other common use cases.\r\n\r\n## Using Python to Convert SVG to PDF\r\n\r\nAspose.SVG for Python via .NET also allows you to convert SVG to PDF, XPS, PNG, JPEG, TIFF, WEBP, and other file formats. The following snippet demonstrates the conversion from SVG to PDF:\r\n\r\n```python\r\nimport aspose\r\nfrom aspose.svg import *\r\nfrom aspose.svg.converters import *\r\nfrom aspose.svg.drawing.skiasharp import *\r\nfrom aspose.svg.rendering import *\r\nfrom aspose.svg.drawing import *\r\n\r\n# Activate the Aspose.SVG.Drawing.SkiaSharp feature\r\nConfiguration.set_extension(SkiaModule())\r\noptions = PdfSaveOptions()\r\noptions.background_color = aspose.pydrawing.Color.transparent\r\noptions.page_setup.sizing = SizingType.FIT_CONTENT\r\noptions.horizontal_resolution = Resolution.from_dots_per_inch(96.0)\r\noptions.vertical_resolution = Resolution.from_dots_per_inch(96.0)\r\nwith SVGDocument(\"source.svg\") as document:\r\n\t# Convert SVG to PDF\r\n    Converter.convert_svg(document, options, \"result.pdf\")\r\n```\r\n\r\n## Using Python to Vectorize Images\r\n\r\nAspose.SVG for Python via .NET also allows you can convert a raster image to vector graphic using default or custom configuration options. You will be able to apply custom settings to get the best result of the image-to-vector conversion and save the output SVG file to your computer. The following snippet demonstrates the image vectorization:\r\n\r\n```python\r\nimport os\r\nfrom aspose.svg import *\r\nfrom aspose.svg.converters import *\r\nfrom aspose.svg.drawing import *\r\nfrom aspose.svg.rendering.image import *\r\nfrom aspose.svg.imagevectorization import *\r\n\r\n# Setup directories\r\ninput_folder = \"path/to/input_folder/\"\r\noutput_folder = \"path/to/output_folder/\"\r\nif not os.path.exists(output_folder):\r\n    os.makedirs(output_folder)\r\n\r\n# Configuration for vectorization\r\npath_builder = BezierPathBuilder()\r\npath_builder.trace_smoother = ImageTraceSmoother(2)  # Example severity level\r\npath_builder.error_threshold = 30.0  # Example threshold\r\npath_builder.max_iterations = 30  # Example max iterations\r\n\r\nvectorizer = ImageVectorizer()\r\nvectorizer.configuration.path_builder = path_builder\r\nvectorizer.configuration.colors_limit = 25  # Example color limit\r\nvectorizer.configuration.line_width = 1.0  # Example line width\r\n\r\n# Vectorize the image\r\nsrc_file = \"example_image.png\"  # Specify the test file\r\nwith vectorizer.vectorize(os.path.join(input_folder, src_file)) as document:\r\n    output_file = os.path.join(output_folder, src_file + \".svg\")\r\n    document.save(output_file)\r\n```\r\n[Product Page](https://products.aspose.com/svg/python-net/) | [Docs](https://docs.aspose.com/svg/python-net/) | [Demos](https://products.aspose.app/svg/applications) | [API Reference](https://reference.aspose.com/svg/python-net/) | [Examples](https://github.com/aspose-svg/) | [Blog](https://blog.aspose.com/category/svg/) | [Search](https://search.aspose.com/) | [Free Support](https://forum.aspose.com/c/svg) | [Temporary License](https://purchase.aspose.com/temporary-license)\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Aspose.SVG for Python via .NET enables creating, editing, rendering, and converting SVGs to formats like PNG, PDF, and more, excelling in image vectorization. Perfect for developing SVG tools.",
    "version": "24.5.0",
    "project_urls": {
        "API Reference": "https://reference.aspose.com/svg/python-net/",
        "Blog": "https://blog.aspose.com/category/svg/",
        "Demos": "https://products.aspose.app/svg/family",
        "Docs": "https://docs.aspose.com/svg/python-net/",
        "Examples": "https://github.com/aspose-svg/Aspose.SVG-for-Python-via-.NET/",
        "Free Support": "https://forum.aspose.com/c/svg",
        "Homepage": "https://products.aspose.com/svg/python-net/",
        "Release Notes": "https://releases.aspose.com/svg/python/release-notes/2024/aspose-svg-for-python-via-dotnet-24-5-release-notes/",
        "Temporary License": "https://purchase.aspose.com/temporary-license"
    },
    "split_keywords": [
        "aspose",
        " aspose.svg",
        " aspose.total",
        " python",
        " component",
        " conholdate",
        " conholdate.total",
        " convert",
        " converter",
        " vectorization",
        " vectorizer",
        " vectorize",
        " encoding",
        " base64",
        " css",
        " dom",
        " dom-manipulation",
        " image",
        " jpeg",
        " library",
        " linux",
        " macos",
        " microsoft",
        " mvc",
        " net-standard",
        " netcore",
        " netstandard",
        " to pdf",
        " png",
        " rotate",
        " security",
        " standard",
        " svg",
        " svg-to-gif",
        " svg-to-jpeg",
        " svg-to-pdf",
        " svg-to-png",
        " svg-to-tiff",
        " svg-to-xps",
        " png-to-svg",
        " jpg-to-svg",
        " visualstudio",
        " xpath",
        " xps",
        " svg",
        " windows",
        " vector graphics",
        " line",
        " bezier curves",
        " cubic",
        " glyphs",
        " paths",
        " text",
        " scaling",
        " rotation",
        " skewing",
        " fill",
        " dots",
        " bitmap",
        " html",
        " filters",
        " gaussian",
        " shadow",
        " lighting effects",
        " color",
        " linear",
        " radial"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0df3a977a4361d69581bd61b5478eb8cf34df38c505e82674eed168087573614",
                "md5": "bcdeef93977eabcab80123c5ce6e5fba",
                "sha256": "ae52dedaa4058da877d06e360e9225460fd8c7f808c12c8fb0b5606219305a29"
            },
            "downloads": -1,
            "filename": "aspose_svg_net-24.5.0-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "bcdeef93977eabcab80123c5ce6e5fba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.6",
            "size": 45612621,
            "upload_time": "2024-05-22T06:01:27",
            "upload_time_iso_8601": "2024-05-22T06:01:27.669472Z",
            "url": "https://files.pythonhosted.org/packages/0d/f3/a977a4361d69581bd61b5478eb8cf34df38c505e82674eed168087573614/aspose_svg_net-24.5.0-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e2ac3d62194e78a53171c915e7b29e1f5ccb8b006ebc7d79313410455c281f6",
                "md5": "4d383dc6297baa52ae963942726110e4",
                "sha256": "8f4cdf9ff1d8d55ab53599365cfb1e8ecdc9f202d9d0c719253dc906d7f81ed1"
            },
            "downloads": -1,
            "filename": "aspose_svg_net-24.5.0-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "4d383dc6297baa52ae963942726110e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.6",
            "size": 51576490,
            "upload_time": "2024-05-22T06:01:32",
            "upload_time_iso_8601": "2024-05-22T06:01:32.479878Z",
            "url": "https://files.pythonhosted.org/packages/9e/2a/c3d62194e78a53171c915e7b29e1f5ccb8b006ebc7d79313410455c281f6/aspose_svg_net-24.5.0-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-22 06:01:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aspose-svg",
    "github_project": "Aspose.SVG-for-Python-via-.NET",
    "github_not_found": true,
    "lcname": "aspose-svg-net"
}
        
Elapsed time: 0.23900s