Empower your Python applications with broader image processing capabilities using Aspose.Imaging for Python via .NET 24.8 on Windows x32. This release provides image loading from URLs, introduces Python 3.12 support, and more features.
Support for Python 3.12
You can now integrate the modern capabilities of Python 3.12 into your apps while using the image processing functionalities included in Aspose.Image for Python via .NET API.
Load Images from URLs
The ability to load images directly from URLs offers flexibility and convenience to work with remote image resources. This feature eliminates the need for local storage and simplifies image processing workflows.
Code Example:
from aspose.imaging import Image, FileFormat
with Image.load("https://docs.aspose.com/imaging/net/home_1.png") as image:
assert image.file_format == FileFormat.PNG
Source*
Enhanced TIFF Image Handling
This release of the Python imaging API brings optimized multi-frame TIFF image saving by preventing NullReferenceExceptions
that could occur in the previous versions. The improved TIFF handling ascertains reliable image preservation on Windows 32-bit machines.
Code Example:
from aspose.pycore import as_of
from aspose.imaging.fileformats.tiff import TiffImage, TiffFrame
from aspose.imaging.fileformats.tiff.enums import TiffExpectedFormat
from aspose.imaging.sources import StreamSource
from aspose.imaging import Image
from aspose.imaging.imageoptions import TiffOptions
tiffOptions = TiffOptions(TiffExpectedFormat.TIFF_LZW_RGBA)
tiffOptions.source = StreamSource()
pixels = [0] * 2500
with as_of(Image.create(tiffOptions, 50, 50), TiffImage) as image:
image.save_argb_32_pixels(image.bounds, pixels)
image.save()
for i in range(7):
newImageOptions = tiffOptions.clone()
newImageOptions.source = StreamSource()
with as_of(Image.create(newImageOptions, 50, 50), TiffImage) as newTiffImage:
newTiffImage.save_argb_32_pixels(image.bounds, pixels)
for frame in newTiffImage.frames:
frameCopy = TiffFrame.copy_frame(frame)
image.add_frame(frameCopy)
image.save()
Source*
Improved PNG Creation
Generating 16-bit depth PNG images is now easier than ever using Aspose.Imaging for Python via .NET 24.8. Prevent exceptions that could arise in earlier versions with this enhancement and ensure accurate color representation and image quality.
Code Example:
from aspose.imaging import Graphics, Point, Color
from aspose.imaging.brushes import LinearGradientBrush
from aspose.imaging.fileformats.png import PngImage, PngColorType, PngFilterType
from aspose.imaging.imageoptions import PngOptions
outputPath = "output64Bit.png"
createOptions = PngOptions()
createOptions.bit_depth = 16
createOptions.color_type = PngColorType.TRUECOLOR_WITH_ALPHA
createOptions.compression_level = 9
createOptions.filter_type = PngFilterType.SUB
createOptions.progressive = True
with PngImage(createOptions, 100, 100) as pngImage:
graphics = Graphics(pngImage)
gradientBrush = LinearGradientBrush(
Point(0, 0),
Point(pngImage.width, pngImage.height),
Color.blue,
Color.transparent)
graphics.fill_rectangle(gradientBrush, pngImage.bounds)
pngImage.save(outputPath)
Source*
Accurate PDF Conversion
The latest Python library version supports precise PDF conversion and resolves the issues with incorrect PDF page sizes when converting images to PDF format within your image conversion applications on Windows x32.
Code Example:
from aspose.imaging import Image, LoadOptions
from aspose.imaging.imageoptions import PdfOptions
from aspose.imaging.fileformats.pdf import PdfDocumentInfo
inputFile = "AV Seite 2.jpeg"
outputFile = "AV Seite 2.jpeg.pdf"
with Image.load(inputFile, LoadOptions()) as image:
with PdfOptions() as exportOptions:
exportOptions.pdf_document_info = PdfDocumentInfo()
image.save(outputFile, exportOptions)
Source*
Reliable EPS Conversion
EPS files can be successfully converted to other image formats. This upgrade expands compatibility and allows for richer image processing capabilities.
Code Example:
from aspose.imaging import Image
input = "input.eps"
with Image.load(input) as image:
image.save(input + ".svg")
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Imaging for Python via .NET 24.8 Release Notes.