Great news for macOS developers! We have released Aspose.Imaging for Python via .NET v24.8 (macOS ARM64/M1), and it boasts image loading from URLs, Python 3.12 support, and refined PDF conversion features.
Python 3.12 Support on macOS
Integrate advanced Python 3.12 features into your image manipulation solutions using our Python API. You can elevate your applications by adding the latest features in Python 3.12 in lightning-quick time.
Expanded Image Loading Functionality
The latest release allows Python developers to load images from URLs and avoid storing images locally. This update offers convenience and flexibility in accessing image files from anywhere and enriches your applications with advanced 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*
Convenient TIFF Image Handling
We have enhanced the multi-frame TIFF image saving functionality in version 24.8 of the Python imaging API by ensuring the previously faced NullReferenceExceptions
are prevented. Handle TIFF images smoothly in your applications running on macOS ARM64/M1 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*
PNG Image Generation
Aspose.Imaging for Python via .NET now enables your to generate great quality 16-bit depth PNG images easily and avoids exceptions from the 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*
Precise PDF Conversions on Apple Mac
Enrich your Python-powered image conversion applications with a highly accurate PDF conversion feature on macOS M1 as we have resolved the problems related to incorrect PDF page sizes when converting images to PDFs.
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*
Convert EPS Files in Python Apps
Are you looking to convert EPS images to other formats on macOS? Look no further than our Python image processing library. It allows you to convert EPS files to different image formats accurately.
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.