Equip your Python image processing applications with an expanded set of features, such as loading images from URLs, Python 3.12 support, upgraded PDF conversion, and more with Aspose.Imaging for Python via .NET 24.8 on the macOS x64 platform.
Introducing Python 3.12 Support
Work with the advanced Python 3.12 features using our Python API and take your Python image manipulation applications to the next level. You can now add the latest features in Python 3.12 to your imaging solutions in no time.
Load Remotely Placed Images
We bring you the capability to load images from URLs and eliminate the need for local storage with the latest release. This feature brings you the convenience of working with image files from anywhere and empowers your applications with modern features.
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*
TIFF Image Handling Made Easy
Save multi-frame TIFF images and prevent the previously encountered NullReferenceExceptions
using version 24.8 of the Python imaging API. Manage TIFF image reliably in your applications running on macOS x64 systems.
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*
Generate PNG Images on Apple Mac
Aspose.Imaging for Python via .NET now lets you create high-quality 16-bit depth PNG images conveniently and prevents exceptions that you might have come across in earlier library versions.
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*
Experience Accurate PDF Conversions
Enhance your Python-powered image conversion solutions with accurate PDF conversion functionality on macOS x64 as we have addressed the problems related to incorrect PDF page sizes during image to PDF conversion.
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*
EPS Conversion Updates
Another important feature improvement in this version is the ability to convert EPS files to different image formats precisely.
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.