Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active March 27, 2023 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aspose-com-gists/2ce396b4f1417ab0463e18f51cc6e63d to your computer and use it in GitHub Desktop.
Save aspose-com-gists/2ce396b4f1417ab0463e18f51cc6e63d 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