import base64 class MyImage: def __init__(self, fp: pathlib.Path) -> None: self._url = f"data:image/jpeg;base64,{base64.encodebytes(fp.read_bytes()).decode("utf-8")}" def _mime_(self) -> tuple[str, str]: return ("image/jpeg", self._url) MyImage(picker.value)
mo.image()
that supports local paths, remote urls, and bytesTraceback (most recent call last):
File "/Users/manzt/.cache/uv/archive-v0/DCgM2WuQ6B8IEZg0HzEjf/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 171, in execute_cell
return eval(cell.last_expr, glbls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Cell marimo://demo.py#cell=cell-5
, line 1, in <module>
mo.img(fp)
^^^^^^
AttributeError: module 'marimo' has no attribute 'img'
img = mo.image("https://marimo.io/logo.png", width=150, rounded=True) mo.md(f"Some image: {img}")
mo.image
returns Html, you can interpolate Html in mo.md

doesn't work`({This is } := {defined}-{by}-{that})`
some text here `({This is } := {defined}-{by}-{that})`
. ^^^^^^^^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma?public
folder, will keep in mind if it needs to be added to docs.