Skip to content

Commit

Permalink
Adjusting the expected full alpha value on some float tiles
Browse files Browse the repository at this point in the history
This adjust how compositing is done on styled images.

Also, improve documentation of multi-source schema
  • Loading branch information
manthey committed Dec 5, 2024
1 parent d20a338 commit 84cf7c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 1.30.5

### Changes

- Adjust how compositing is done on styled images by adjusting the expected full alpha value ([#1735](../../pull/1735))

## 1.30.4

### Bug Fixes
Expand Down
6 changes: 6 additions & 0 deletions large_image/tilesource/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ def fullAlphaValue(arr: Union[np.ndarray, npt.DTypeLike]) -> int:
dtype = np.dtype(dtype)
if cast(np.dtype, dtype).kind == 'u':
return np.iinfo(dtype).max
if isinstance(arr, np.ndarray) and cast(np.dtype, dtype).kind == 'f':
amax = np.amax(arr)
if amax > 1 and amax < 256:
return 255
if amax > 1 and amax < 65536:
return 65535
return 1


Expand Down
8 changes: 5 additions & 3 deletions sources/multi/large_image_source_multi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ def _lazyImport():
'sampleScale is applied',
'type': 'number',
},
'style': {'type': 'object'},
'style': {
'description': 'A style specification to pass to the base tile source',
'type': 'object',
},
'params': {
'description':
'Additional parameters to pass to the base tile source',
'description': 'Additional parameters to pass to the base tile source',
'type': 'object',
},
},
Expand Down

0 comments on commit 84cf7c8

Please sign in to comment.