Full frame gif support
Contents
[
Hide
]
Aspose.Imaging supports full-framed export from gif file format to another multi-pages formats.
Example of export from Gif to full-frame Tiff fileformat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.pycore as aspycore | |
from aspose.imaging import * | |
from aspose.imaging.fileformats.apng import * | |
from aspose.imaging.fileformats.png import * | |
from aspose.imaging.fileformats.tiff.enums import * | |
from aspose.imaging.imageoptions import * | |
from aspose.imaging.sources import * | |
import os | |
if 'TEMPLATE_DIR' in os.environ: | |
templates_folder = os.environ['TEMPLATE_DIR'] | |
else: | |
templates_folder = r"C:\Users\USER\Downloads\templates" | |
delete_output = 'SAVE_OUTPUT' not in os.environ | |
data_dir = templates_folder | |
with Image.load(os.path.join(data_dir, "template.gif")) as image: | |
obj_init = TiffOptions(TiffExpectedFormat.TIFF_DEFLATE_RGB) | |
obj_init.multi_page_options = MultiPageOptions(IntRange(0, 1)) | |
obj_init.full_frame = True | |
image.save(os.path.join(data_dir, "result.tiff"), obj_init) | |
obj_init2 = TiffOptions(TiffExpectedFormat.TIFF_DEFLATE_RGB) | |
obj_init2.multi_page_options = MultiPageOptions(IntRange(0, 1)) | |
image.save(os.path.join(data_dir, "result2.tiff"), obj_init2) | |
if delete_output: | |
os.remove(os.path.join(data_dir, "result.tiff")) | |
os.remove(os.path.join(data_dir, "result2.tiff")) |
The result file after saving:
|
|
---|---|
Download result |
Example of export from Gif to full-frame Pdf fileformat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.pycore as aspycore | |
from aspose.imaging import * | |
from aspose.imaging.fileformats.apng import * | |
from aspose.imaging.fileformats.png import * | |
from aspose.imaging.fileformats.tiff.enums import * | |
from aspose.imaging.imageoptions import * | |
from aspose.imaging.sources import * | |
import os | |
if 'TEMPLATE_DIR' in os.environ: | |
templates_folder = os.environ['TEMPLATE_DIR'] | |
else: | |
templates_folder = r"C:\Users\USER\Downloads\templates" | |
delete_output = 'SAVE_OUTPUT' not in os.environ | |
data_dir = templates_folder | |
with Image.load(os.path.join(data_dir, "template.gif")) as image: | |
obj_init = PdfOptions() | |
obj_init.multi_page_options = MultiPageOptions(IntRange(0, 1)) | |
obj_init.full_frame = True | |
image.save(os.path.join(data_dir, "result.pdf"), obj_init) | |
if delete_output: | |
os.remove(os.path.join(data_dir, "result.pdf")) |
The result file after saving:
|
|
---|---|
Download result |