[med-svn] [Git][med-team/openslide-python][upstream] New upstream version 1.3.1
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Mon Nov 6 20:45:25 GMT 2023
Étienne Mollier pushed to branch upstream at Debian Med / openslide-python
Commits:
0a015e85 by Étienne Mollier at 2023-11-06T21:32:19+01:00
New upstream version 1.3.1
- - - - -
10 changed files:
- CHANGELOG.md
- PKG-INFO
- doc/index.rst
- examples/deepzoom/deepzoom_multiserver.py
- examples/deepzoom/deepzoom_server.py
- examples/deepzoom/deepzoom_tile.py
- openslide/_version.py
- openslide_python.egg-info/PKG-INFO
- pytest.ini
- setup.py
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -1,5 +1,11 @@
# Notable Changes in OpenSlide Python
+## Version 1.3.1, 2023-10-08
+
+* docs: Document using ICC profile's default intent, not absolute colorimetric
+* examples: Default to ICC profile's default intent, not absolute colorimetric
+* tests: Correctly require pytest ≥ 7.0
+
## Version 1.3.0, 2023-07-22
* Support new soname in OpenSlide ≥ 4.0.0
=====================================
PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: openslide-python
-Version: 1.3.0
+Version: 1.3.1
Summary: Python interface to OpenSlide
Home-page: https://openslide.org/
Maintainer: OpenSlide project
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
=====================================
doc/index.rst
=====================================
@@ -213,22 +213,21 @@ 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
-:mod:`ImageCms <PIL.ImageCms>`. For example, to convert an image in-place
-to a synthesized sRGB profile, using absolute colorimetric rendering::
+:mod:`ImageCms <PIL.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
fromProfile = ImageCms.getOpenProfile(BytesIO(image.info['icc_profile']))
toProfile = ImageCms.createProfile('sRGB')
+ intent = ImageCms.getDefaultIntent(fromProfile)
ImageCms.profileToProfile(
- image, fromProfile, toProfile,
- ImageCms.Intent.ABSOLUTE_COLORIMETRIC, 'RGBA', True, 0
+ image, fromProfile, toProfile, intent, 'RGBA', True, 0
)
-Absolute colorimetric rendering `maximizes the comparability`_ of images
-produced by different scanners. When converting Deep Zoom tiles, use
-``'RGB'`` instead of ``'RGBA'``.
+When converting Deep Zoom tiles, use ``'RGB'`` instead of ``'RGBA'``.
All pyramid regions in a slide have the same profile, but each associated
image can have its own profile. As a convenience, the former is also
@@ -238,15 +237,13 @@ by building an :class:`~PIL.ImageCms.ImageCmsTransform` for the slide and
reusing it for multiple slide regions::
toProfile = ImageCms.createProfile('sRGB')
+ intent = ImageCms.getDefaultIntent(slide.color_profile)
transform = ImageCms.buildTransform(
- slide.color_profile, toProfile, 'RGBA', 'RGBA',
- ImageCms.Intent.ABSOLUTE_COLORIMETRIC, 0
+ slide.color_profile, toProfile, 'RGBA', 'RGBA', intent, 0
)
# for each region image:
ImageCms.applyTransform(image, transform, True)
-.. _maximizes the comparability: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4478790/
-
Caching
-------
=====================================
examples/deepzoom/deepzoom_multiserver.py
=====================================
@@ -73,7 +73,7 @@ def create_app(config=None, config_file=None):
DEEPZOOM_OVERLAP=1,
DEEPZOOM_LIMIT_BOUNDS=True,
DEEPZOOM_TILE_QUALITY=75,
- DEEPZOOM_COLOR_MODE='absolute-colorimetric',
+ DEEPZOOM_COLOR_MODE='default',
)
app.config.from_envvar('DEEPZOOM_MULTISERVER_SETTINGS', silent=True)
if config_file is not None:
@@ -212,6 +212,8 @@ class _SlideCache:
elif mode == 'embed':
# embed ICC profile in tiles
return lambda img: None
+ elif mode == 'default':
+ intent = ImageCms.getDefaultIntent(image.color_profile)
elif mode == 'absolute-colorimetric':
intent = ImageCms.Intent.ABSOLUTE_COLORIMETRIC
elif mode == 'relative-colorimetric':
@@ -276,6 +278,7 @@ if __name__ == '__main__':
'--color-mode',
dest='DEEPZOOM_COLOR_MODE',
choices=[
+ 'default',
'absolute-colorimetric',
'perceptual',
'relative-colorimetric',
@@ -283,11 +286,11 @@ if __name__ == '__main__':
'embed',
'ignore',
],
- default='absolute-colorimetric',
+ default='default',
help=(
- 'convert tiles to sRGB using specified rendering intent, or '
- 'embed original ICC profile, or ignore ICC profile (compat) '
- '[absolute-colorimetric]'
+ 'convert tiles to sRGB using default rendering intent of ICC '
+ 'profile, or specified rendering intent; or embed original '
+ 'ICC profile; or ignore ICC profile (compat) [default]'
),
)
parser.add_argument(
=====================================
examples/deepzoom/deepzoom_server.py
=====================================
@@ -73,7 +73,7 @@ def create_app(config=None, config_file=None):
DEEPZOOM_OVERLAP=1,
DEEPZOOM_LIMIT_BOUNDS=True,
DEEPZOOM_TILE_QUALITY=75,
- DEEPZOOM_COLOR_MODE='absolute-colorimetric',
+ DEEPZOOM_COLOR_MODE='default',
)
app.config.from_envvar('DEEPZOOM_TILER_SETTINGS', silent=True)
if config_file is not None:
@@ -182,6 +182,8 @@ def get_transform(image, mode):
elif mode == 'embed':
# embed ICC profile in tiles
return lambda img: None
+ elif mode == 'default':
+ intent = ImageCms.getDefaultIntent(image.color_profile)
elif mode == 'absolute-colorimetric':
intent = ImageCms.Intent.ABSOLUTE_COLORIMETRIC
elif mode == 'relative-colorimetric':
@@ -224,6 +226,7 @@ if __name__ == '__main__':
'--color-mode',
dest='DEEPZOOM_COLOR_MODE',
choices=[
+ 'default',
'absolute-colorimetric',
'perceptual',
'relative-colorimetric',
@@ -231,11 +234,11 @@ if __name__ == '__main__':
'embed',
'ignore',
],
- default='absolute-colorimetric',
+ default='default',
help=(
- 'convert tiles to sRGB using specified rendering intent, or '
- 'embed original ICC profile, or ignore ICC profile (compat) '
- '[absolute-colorimetric]'
+ 'convert tiles to sRGB using default rendering intent of ICC '
+ 'profile, or specified rendering intent; or embed original '
+ 'ICC profile; or ignore ICC profile (compat) [default]'
),
)
parser.add_argument(
=====================================
examples/deepzoom/deepzoom_tile.py
=====================================
@@ -125,6 +125,8 @@ class TileWorker(Process):
elif mode == 'embed':
# embed ICC profile in tiles
return lambda img: None
+ elif mode == 'default':
+ intent = ImageCms.getDefaultIntent(image.color_profile)
elif mode == 'absolute-colorimetric':
intent = ImageCms.Intent.ABSOLUTE_COLORIMETRIC
elif mode == 'relative-colorimetric':
@@ -356,6 +358,7 @@ if __name__ == '__main__':
'--color-mode',
dest='color_mode',
choices=[
+ 'default',
'absolute-colorimetric',
'perceptual',
'relative-colorimetric',
@@ -363,11 +366,11 @@ if __name__ == '__main__':
'embed',
'ignore',
],
- default='absolute-colorimetric',
+ default='default',
help=(
- 'convert tiles to sRGB using specified rendering intent, or '
- 'embed original ICC profile, or ignore ICC profile (compat) '
- '[absolute-colorimetric]'
+ 'convert tiles to sRGB using default rendering intent of ICC '
+ 'profile, or specified rendering intent; or embed original '
+ 'ICC profile; or ignore ICC profile (compat) [default]'
),
)
parser.add_argument(
=====================================
openslide/_version.py
=====================================
@@ -22,4 +22,4 @@
This module is an implementation detail. The package version should be
obtained from openslide.__version__."""
-__version__ = '1.3.0'
+__version__ = '1.3.1'
=====================================
openslide_python.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: openslide-python
-Version: 1.3.0
+Version: 1.3.1
Summary: Python interface to OpenSlide
Home-page: https://openslide.org/
Maintainer: OpenSlide project
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
=====================================
pytest.ini
=====================================
@@ -1,5 +1,5 @@
[pytest]
-minversion = 6.0
+minversion = 7.0
# don't try to import openslide from the source directory, since it doesn't
# have the compiled extension module
addopts = --import-mode importlib
=====================================
setup.py
=====================================
@@ -43,6 +43,7 @@ setup(
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering :: Bio-Informatics',
],
python_requires='>=3.8',
View it on GitLab: https://salsa.debian.org/med-team/openslide-python/-/commit/0a015e854e4cca7198bb725efc5678988e7329f1
--
View it on GitLab: https://salsa.debian.org/med-team/openslide-python/-/commit/0a015e854e4cca7198bb725efc5678988e7329f1
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231106/b5082b5a/attachment-0001.htm>
More information about the debian-med-commit
mailing list