Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active September 15, 2022 09:56
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.ImageOptions;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads";
var inputFile = Path.Combine(templatesFolder, $"template.gif");
var outputFile = Path.Combine(templatesFolder, $"output.png");
using (var image = (RasterImage)Aspose.Imaging.Image.Load(inputFile))
{
image.Save(
outputFile,
new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
File.Delete(outputFile);
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.ImageOptions;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads";
var inputFile = Path.Combine(templatesFolder, $"template.png");
var outputFile = Path.Combine(templatesFolder, $"output.png");
using (var image = (RasterImage)Aspose.Imaging.Image.Load(inputFile))
{
image.Save(
outputFile,
new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
File.Delete(outputFile);
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.ImageOptions;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads";
var inputFile = Path.Combine(templatesFolder, $"template.tiff");
var outputFile = Path.Combine(templatesFolder, $"output.png");
using (var image = (RasterImage)Aspose.Imaging.Image.Load(inputFile))
{
image.Save(
outputFile,
new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
File.Delete(outputFile);
using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.ImageOptions;
using System.IO;
string templatesFolder = @"c:\Users\USER\Downloads";
var inputFile = Path.Combine(templatesFolder, $"template.webp");
var outputFile = Path.Combine(templatesFolder, $"output.png");
using (var image = (RasterImage)Aspose.Imaging.Image.Load(inputFile))
{
image.Save(
outputFile,
new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
File.Delete(outputFile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment