Skip to content

Image widget #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 12, 2024
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy