Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/desktop/image/image_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
============
Example showing simple plot creation and subsequent cmap change with Standard image from imageio.
"""

# test_example = true

import fastplotlib as fpl
Expand Down
1 change: 1 addition & 0 deletions examples/desktop/image/image_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
============
Example showing the simple plot creation with 512 x 512 2D RGB image.
"""

# test_example = true

import fastplotlib as fpl
Expand Down
1 change: 1 addition & 0 deletions examples/desktop/image/image_rgbvminvmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
============
Example showing the simple plot followed by changing the vmin/vmax with 512 x 512 2D RGB image.
"""

# test_example = true

import fastplotlib as fpl
Expand Down
1 change: 1 addition & 0 deletions examples/desktop/image/image_vminvmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
============
Example showing the simple plot creation followed by changing the vmin/vmax with Standard imageio image.
"""

# test_example = true

import fastplotlib as fpl
Expand Down
20 changes: 20 additions & 0 deletions examples/desktop/image/image_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Image widget
============
Example showing the image widget in action.
When run in a notebook, or with the Qt GUI backend, sliders are also shown.
"""

import numpy as np
import fastplotlib as fpl
import imageio.v3 as iio # not a fastplotlib dependency, only used for examples


a = iio.imread("imageio:camera.png")
iw = fpl.widgets.ImageWidget(data=a, cmap="viridis")
iw.show()


if __name__ == "__main__":
print(__doc__)
fpl.run()
10 changes: 2 additions & 8 deletions fastplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
from .graphics import *
from .graphics.selectors import *
from .legends import *
from .widgets import ImageWidget
from .utils import _notebook_print_banner, config

from wgpu.gui.auto import run

try:
import ipywidgets
except (ModuleNotFoundError, ImportError):
pass
else:
from .widgets import ImageWidget

from wgpu.backends.wgpu_native import enumerate_adapters


with open(Path(__file__).parent.joinpath("VERSION"), "r") as f:
__version__ = f.read().split("\n")[0]

Expand Down