Convert SVG to SVGZ using C#
SVG is one of the most widely used formats for building websites and print design due to its scalability. In modern applications, optimizing SVG files is crucial for improving performance. One effective method is to convert SVG files to their compressed version, SVGZ. With the Aspose.SVG for .NET API, you can programmatically save SVG files as SVGZ images using just a few lines of code. This powerful C# API enables you to convert SVG to SVGZ quickly and with high quality.
Why Use SVGZ?
SVGZ files are standard SVG documents compressed with GZIP. They maintain full fidelity and scalability of the original SVG while significantly reducing file size – often by 60–80%. All major browsers support SVGZ, which is ideal for efficiently storing or serving graphics over the web.
Save SVG as SVGZ
using Aspose.Svg.Saving;
...
// Load an SVG document
SVGDocument document = new SVGDocument("document.svg");
// Save the document as SVGZ
document.Save("document.svgz", SVGSaveFormat.SVGZ);
Steps to Save SVG as SVGZ
- Load an SVG document using one of the SVGDocument() constructors.
- Use the
Save(
path, saveFormat
) method to save the SVG document as an SVGZ file.
Please visit our Documentation to learn more about Aspose.SVG for .NET API functions. In the documentation article Convert SVG to SVGZ in C# – Understanding SVGZ Format , you will learn what the SVGZ format is and how to save an SVG as SVGZ using Aspose.SVG for .NET.
Free Online SVG to SVGZ Converter
Aspose.SVG offers a free online SVG to SVGZ Converter that allows you to compress and convert SVG files directly in your browser, without the need for any installation or registration. This fast and user-friendly tool is designed for developers, designers, and anyone needing lightweight, optimized vector graphics for web or print use. Simply upload your SVG file, and download the compressed SVGZ in seconds.
Get Started with Aspose.SVG for .NET API
If you are interested in developing scalable vector graphics and their application, install our flexible, high-speed Aspose.SVG for .NET API with a powerful set of interfaces for C# and other .NET programming languages.Install from command line as
nuget install Aspose.SVG
or via Package Manager Console of Visual Studio with Install-Package Aspose.SVG
.
Alternatively, get the offline MSI installer or DLLs in a ZIP file from
downloads.
Aspose.SVG for .NET API is a standalone library and does not depend on any software for SVG document processing.For more details about C# library installation and system requirements, please refer to Aspose.SVG Documentation.
Other Supported Features
Create, convert, merge, edit SVG documents, convert color codes, vectorize images and more!