Package: jupyter-compare-view
Jupyter compare_viewBlend between multiple images using a cell magic in JupyterLab usingcompare_view.This project was called jupyter-splitview before.Installationpipinstalljupyter_compare_viewExampleimportjupyter_compare_view%%comparefromskimageimportdatafromskimage.colorimportrgb2grayimportmatplotlib.pyplotaspltimg=data.chelsea()grayscale_img=rgb2gray(img)plt.imshow(img)plt.axis("off")plt.show()plt.imshow(grayscale_img,cmap="gray")plt.axis("off")plt.show()Another example:fromjupyter_compare_viewimportcomparecompare(img,grayscale_img,cmap="gray",start_mode="horizontal",start_slider_pos=0.73)The split view widget is still responsive after closing and reopening the notebook without running the cell again.Notebook arguments(Might still change in future)--config '{"start_mode": "horizontal"}'will init the compare-view in horizontal slider mode.--config '{"circle_size": 30}'the circle size is now 30 pixel in circle mode.--config '{"show_slider": false}'will hide the slider bar.--config '{"start_slider_pos": 0.73}'will set the slider start position to 73%.Removed in 0.1.1:--position 73%will no longer the slider start position to 73%.--config '{"start_mode": "horizontal","start_slider_pos": 0.73}'will both set the start mode to horizontal and set the slider position--height 220will set the height to 220 pixel.When--heightis not provided, the default height of the widget is 300 pixel.--height autowill set the height by the value of the first image's resolution in vertical direction.The widget's width will always be adjusted automatically.Notebook formattingFormatting with black can be done this way:pip install 'black[jupyter]'black --python-cell-magics compare compare_view_magic.ipynbDeveloper Installationgit clone --recurse https://github.com/Octoframes/jupyter_compare_view(Note: In case that the repo was already cloned e.g. with the GitHub Desktop client, the  GitHub submodule has to be loaded viagit submodule update --init --recursive)poetry installNote: The IPython extensionautoreloadreloads modules before every cell execution. Very useful when debugging the%%capturecell magic!
Just add these lines into the first jupyter cell.%load_extautoreload%autoreload2importjupyter_compare_viewChangelog0.2.4CHange to importlib#480.2.3Remove setuptools dependency0.2.2Remove python3.7 support#46fix jupyterlite example0.2.1Support python 3.110.2.0Implementedcaptureto display the compare view frame without calling the cell magic. This is not an ipywidget as mentionedhere.Update version requirements#420.1.5BugFix: Remove black import that was added by accident.0.1.4%%compareis now%%splity.%%splityis deprecated.Update examples0.1.3octoframes github actions setup0.1.2Move the repo from kolibril13/jupyter-spitview to octoframes/jupyter_compare_viewRename all references0.1.1Drop thegithub.com/NUKnightLab/juxtaposebackend and replace it withgithub.com/Octoframes/compare_view.Implement horizontal sliderImplement Round Mask0.1.0Update dependenciesUpdate JupyterLite versionFix: in JupyterLite, a figure has to be explicitly called by plt.show()Better installation workflow0.0.8Fixing problem with cell id and notebook reloadingExperimentally lowering the dependencies toipython = ">=6.0.0"andipykernel = ">=5.0.0"so that  jupyterlite will work hopefully.0.0.7Rewrite of the import of JavaScript and CSS to make it more robust when closing and opening the notebookFirst attempt to add a JupyterLite example.0.0.6Fix poetry workflow0.0.5Ship the javascript directly with the package, so no internet connection is requireduse jinja2 to save HTML in separate fileload stylesheet and javascript only once in the beginning, and not in every cell that contains the splitview widget.0.0.4New--heightparameter0.0.3default slider positionupdated minimal exampleinternal code restructuring and formattingHandle import in non jupyter context0.0.2save images in base64 strings and don't load images to disk (increases package security).0.0.1First release