Interested ?
You may go further at : https://docs.aspose.com/java/developer-guide/how-to/save-transparent-image
Interested ?
You may go further at : https://docs.aspose.com/java/developer-guide/how-to/save-transparent-image
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); | |
}}); | |
} |