Skip to content

Instantly share code, notes, and snippets.

@ESidenko
Forked from aspose-com-gists/readme.md
Last active February 10, 2022 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ESidenko/0abc4583f4466b655fd5c35925c41dbe to your computer and use it in GitHub Desktop.
Save ESidenko/0abc4583f4466b655fd5c35925c41dbe to your computer and use it in GitHub Desktop.
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.png.PngColorType;
import com.aspose.imaging.imageoptions.PngOptions;
String templatesFolder = "c:\\Users\\USER\\Downloads\\";
String inputFile = templatesFolder + "template.gif";
String outputFile = templatesFolder + "output.png";
try (Image image = Image.load(inputFile))
{
image.save(outputFile, new PngOptions()
{{
setColorType(PngColorType.TruecolorWithAlpha);
}});
}
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.png.PngColorType;
import com.aspose.imaging.imageoptions.PngOptions;
String templatesFolder = "c:\\Users\\USER\\Downloads\\";
String inputFile = templatesFolder + "template.png";
String outputFile = templatesFolder + "output.png";
try (Image image = Image.load(inputFile))
{
image.save(outputFile, new PngOptions()
{{
setColorType(PngColorType.TruecolorWithAlpha);
}});
}
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.png.PngColorType;
import com.aspose.imaging.imageoptions.PngOptions;
String templatesFolder = "c:\\Users\\USER\\Downloads\\";
String inputFile = templatesFolder + "template.tiff";
String outputFile = templatesFolder + "output.png";
try (Image image = Image.load(inputFile))
{
image.save(outputFile, new PngOptions()
{{
setColorType(PngColorType.TruecolorWithAlpha);
}});
}
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.png.PngColorType;
import com.aspose.imaging.imageoptions.PngOptions;
String templatesFolder = "c:\\Users\\USER\\Downloads\\";
String inputFile = templatesFolder + "template.webp";
String outputFile = templatesFolder + "output.png";
try (Image image = Image.load(inputFile))
{
image.save(outputFile, new PngOptions()
{{
setColorType(PngColorType.TruecolorWithAlpha);
}});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment