diff --git a/_data/releases.yaml b/_data/releases.yaml index 681bab5..a6dfbee 100644 --- a/_data/releases.yaml +++ b/_data/releases.yaml @@ -26,6 +26,7 @@ c: - {version: 2.1.0, date: 2009-08-18, gz: 1} - {version: 2.0.0, date: 2009-07-16, gz: 1} python: + - {version: 1.4.2, date: 2025-04-28, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.4.1, date: 2024-10-30, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.4.0, date: 2024-10-29, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.3.1, date: 2023-10-08, gz: 1, xz: 1, whl: 1} diff --git a/_includes/news.md b/_includes/news.md index 3aa0fc6..baf07d9 100644 --- a/_includes/news.md +++ b/_includes/news.md @@ -1,5 +1,13 @@ {% include links.md %} +## OpenSlide Python version 1.4.2, 2025-04-28 + +[OpenSlide Python 1.4.2][python-1.4.2] drops support for Python 3.8 and adds +minor improvements. + +[python-1.4.2]: https://github.com/openslide/openslide-python/releases/tag/v1.4.2 + + ## Binary build 4.0.0.8, 2025-04-27 [Binary build 4.0.0.8][bin-4.0.0.8] updates many dependencies. diff --git a/api/python/index.html b/api/python/index.html index e9c24c7..ee85662 100644 --- a/api/python/index.html +++ b/api/python/index.html @@ -5,11 +5,11 @@ -
# The path can also be read from a config file, etc.
OPENSLIDE_PATH = r'c:\path\to\openslide-win64\bin'
-import os
+import os
if hasattr(os, 'add_dll_directory'):
# Windows
with os.add_dll_directory(OPENSLIDE_PATH):
- import openslide
+ import openslide
else:
- import openslide
+ import openslide
An open whole-slide image.
If any operation on the object fails, OpenSlideError
is raised.
OpenSlide has latching error semantics: once OpenSlideError
is
@@ -113,7 +113,7 @@
Return a string describing the format vendor of the specified file.
This string is also accessible via the PROPERTY_NAME_VENDOR
property.
Images, such as label or macro images, which are associated with this
slide. This is a Mapping
from image
-name to RGBA Image
.
Image
.
Unlike in the C interface, these images are not premultiplied.
None
if not available.
ImageCmsProfile | None
+ImageCmsProfile | None
Return an RGBA Image
containing the contents of
+read_region(location: tuple[int, int], level: int, size: tuple[int, int]) Image ¶
+
Return an RGBA Image
containing the contents of
the specified region.
Unlike in the C interface, the image data is not premultiplied.
Return an Image
containing an RGB thumbnail of the
+get_thumbnail(size: tuple[int, int]) Image ¶
+
Return an Image
containing an RGB thumbnail of the
slide.
bytes
object in
-Image.info
['icc_profile']
. If no
+Image.info
['icc_profile']
. If no
profile is available, the icc_profile
dictionary key is absent.
To include the profile in an image file when saving the image to disk:
image.save(filename, icc_profile=image.info.get('icc_profile'))
To perform color conversions using the profile, import it into
-ImageCms
. For example, to synthesize an sRGB profile
+ImageCms
. For example, to synthesize an sRGB profile
and use it to transform an image for display, with the default rendering
intent of the image’s profile:
from io import BytesIO
-from PIL import ImageCms
+from io import BytesIO
+from PIL import ImageCms
fromProfile = ImageCms.getOpenProfile(BytesIO(image.info['icc_profile']))
toProfile = ImageCms.createProfile('sRGB')
@@ -310,8 +310,8 @@ Basic usageOpenSlide.color_profile
, already parsed into an
-ImageCmsProfile
object. You can save processing time
-by building an ImageCmsTransform
for the slide and
+ImageCmsProfile
object. You can save processing time
+by building an ImageCmsTransform
for the slide and
reusing it for multiple slide regions:
toProfile = ImageCms.createProfile('sRGB')
intent = ImageCms.getDefaultIntent(slide.color_profile)
@@ -327,7 +327,7 @@ Basic usage¶
-
-class openslide.OpenSlideCache(capacity: int)¶
+class openslide.OpenSlideCache(capacity: int)¶
An in-memory tile cache.
Tile caches can be attached to one or more OpenSlide
objects
with OpenSlide.set_cache()
to cache recently-decoded tiles. By
@@ -425,7 +425,7 @@
Caching¶
Exceptions¶
-
-exception openslide.OpenSlideError¶
+exception openslide.OpenSlideError¶
An error produced by the OpenSlide library.
Once OpenSlideError
has been raised by a particular
OpenSlide
, all future operations on that OpenSlide
@@ -435,14 +435,14 @@
Exceptions
-
-exception openslide.OpenSlideUnsupportedFormatError¶
+exception openslide.OpenSlideUnsupportedFormatError¶
OpenSlide does not support the requested file. Subclass of
OpenSlideError
.
-
-exception openslide.OpenSlideVersionError¶
+exception openslide.OpenSlideVersionError¶
This version of OpenSlide does not support the requested functionality.
Subclass of OpenSlideError
.
@@ -453,18 +453,18 @@ ExceptionsWrapping a Pillow Image¶
-
-class openslide.AbstractSlide¶
+class openslide.AbstractSlide¶
The abstract base class of OpenSlide
and ImageSlide
.
-
-class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
-A wrapper around an Image
object that provides an
+class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
+
A wrapper around an Image
object that provides an
OpenSlide
-compatible API.
- Parameters:
-file – a filename or Image
object
+file – a filename or Image
object
- Raises:
OSError – if the file cannot be opened
@@ -500,7 +500,7 @@ Exceptions
-
-class openslide.deepzoom.DeepZoomGenerator(osr: AbstractSlide, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)¶
+class openslide.deepzoom.DeepZoomGenerator(osr: AbstractSlide, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)¶
A Deep Zoom generator that wraps an OpenSlide
object,
ImageSlide
object, or user-provided instance of
AbstractSlide
.
@@ -577,8 +577,8 @@ Exceptions
-
-get_tile(level: int, address: tuple[int, int]) Image ¶
-Return an RGB Image
for a tile.
+get_tile(level: int, address: tuple[int, int]) Image ¶
+Return an RGB Image
for a tile.
- Parameters:
@@ -745,13 +745,13 @@ This Page