{"id":24787961,"url":"https://github.com/octoframes/jupyter_compare_view","last_synced_at":"2025-04-04T07:07:32.819Z","repository":{"id":37080864,"uuid":"245424286","full_name":"Octoframes/jupyter_compare_view","owner":"Octoframes","description":"Blend Between Multiple Images in JupyterLab.","archived":false,"fork":false,"pushed_at":"2024-12-05T08:07:10.000Z","size":10824,"stargazers_count":113,"open_issues_count":9,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T06:07:32.595Z","etag":null,"topics":["jupyter"],"latest_commit_sha":null,"homepage":"https://octoframes.github.io/jupyter_compare_view/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Octoframes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-06T13:16:34.000Z","updated_at":"2025-02-07T15:06:03.000Z","dependencies_parsed_at":"2024-07-10T13:36:39.817Z","dependency_job_id":"0fbb1532-6174-4bca-aa63-5850bc2301de","html_url":"https://github.com/Octoframes/jupyter_compare_view","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_compare_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_compare_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_compare_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoframes%2Fjupyter_compare_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Octoframes","download_url":"https://codeload.github.com/Octoframes/jupyter_compare_view/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter"],"created_at":"2025-01-29T16:14:27.070Z","updated_at":"2025-04-04T07:07:32.802Z","avatar_url":"https://github.com/Octoframes.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jupyter compare_view\n\n![bannerFINAL](https://user-images.githubusercontent.com/44469195/179508322-ea10e22a-6dfb-47f4-8fbb-d5ce724f0127.png)\n\n[![JupyterLight](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://octoframes.github.io/jupyter_compare_view)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Octoframes/jupyter_compare_view/HEAD?labpath=example_notebook.ipynb)\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Octoframes/jupyter_compare_view/blob/main/example_notebook.ipynb)\n[![PyPI version](https://badge.fury.io/py/jupyter_compare_view.svg)](https://badge.fury.io/py/jupyter_compare_view)\n[![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Octoframes/jupyter_compare_view/blob/main/LICENSE)\n\n\nBlend between multiple images using a cell magic in JupyterLab using [compare_view](https://octoframes.github.io/compare_view).   \n*This project was called jupyter-splitview before.*  \n\n\n## Installation\n```py\npip install jupyter_compare_view\n```\n## Example\n```py\nimport jupyter_compare_view\n```\n\n```py\n%%compare  \nfrom skimage import data\nfrom skimage.color import rgb2gray\nimport matplotlib.pyplot as plt\n\nimg = data.chelsea()\ngrayscale_img = rgb2gray(img)\n\nplt.imshow(img)\nplt.axis(\"off\")\nplt.show()\n\nplt.imshow(grayscale_img, cmap=\"gray\")\nplt.axis(\"off\")\nplt.show()\n```\n\n\u003cimg src=\"https://user-images.githubusercontent.com/44469195/179499138-65160434-11e1-4358-8e25-5b26ba9ebf4a.png\" style=\"width: 400px;\"/\u003e\n\nAnother example:\n```py\nfrom jupyter_compare_view import compare\n\ncompare(img, grayscale_img, cmap=\"gray\", start_mode=\"horizontal\", start_slider_pos=0.73)\n```\n\u003cimg src=\"https://user-images.githubusercontent.com/44469195/179499350-94244408-cabf-4945-affc-fd0444d53555.png\" style=\"width: 400px;\"/\u003e\n\n\nThe split view widget is still responsive after closing and reopening the notebook without running the cell again.\n\n## Notebook arguments\n(Might still change in future)\n* `--config '{\"start_mode\": \"horizontal\"}'` will init the compare-view in horizontal slider mode.\n* `--config '{\"circle_size\": 30}'`  the circle size is now 30 pixel in circle mode.\n* `--config '{\"show_slider\": false}'` will hide the slider bar.\n* `--config '{\"start_slider_pos\": 0.73}'` will set the slider start position to 73%. \n\n    * *Removed in 0.1.1: `--position 73%` will no longer the slider start position to 73%.*\n* `--config '{\"start_mode\": \"horizontal\",\"start_slider_pos\": 0.73}'` will both set the start mode to horizontal and set the slider position\n* `--height 220` will set the height to 220 pixel. \n* When `--height`is not provided, the default height of the widget is 300 pixel.\n* `--height auto` will set the height by the value of the first image's resolution in vertical direction.\n* The widget's width will always be adjusted automatically. \n\n## Notebook formatting\nFormatting with black can be done this way: \n1. `pip install 'black[jupyter]'`\n2. `black --python-cell-magics compare compare_view_magic.ipynb`\n\n## Interactive Export\njupyter_compare_view fully supports offline interactive HTML exports.\nThe web library [compare_view](https://octoframes.github.io/compare_view) is inlined into the exported HTML document.\nTherefore, the export is viewable without an internet connection.\n\n![Simply export your notebook as HTML to allow interacting with your data without jupyter.](html_export_screenshot.png)\n\n\n## Developer Installation\n\n1. `git clone --recurse https://github.com/Octoframes/jupyter_compare_view`\n(Note: In case that the repo was already cloned e.g. with the GitHub Desktop client, the  GitHub submodule has to be loaded via `git submodule update --init --recursive`)\n2. `poetry install`\n\n*Note*: The IPython extension `autoreload` reloads modules before every cell execution. Very useful when debugging the `%%capture` cell magic!\nJust add these lines into the first jupyter cell.\n```py\n%load_ext autoreload\n%autoreload 2\nimport jupyter_compare_view\n```\n\n## Changelog\n\n# 0.2.4\n\nCHange to importlib [#48](https://github.com/Octoframes/jupyter_compare_view/pull/48)\n\n## 0.2.3\n\nRemove setuptools dependency\n## 0.2.2\n\n* Remove python3.7 support [#46](https://github.com/Octoframes/jupyter_compare_view/pull/46)\n* fix jupyterlite example\n## 0.2.1\n\n* Support python 3.11\n\n## 0.2.0\n\n* Implemented `capture` to display the compare view frame without calling the cell magic. This is not an ipywidget as mentioned [here](https://github.com/Octoframes/jupyter_compare_view/pull/41#pullrequestreview-1205327074). \n* Update version requirements [#42](https://github.com/Octoframes/jupyter_compare_view/pull/42/files)\n## 0.1.5\n\n* BugFix: Remove black import that was added by accident. \n\n## 0.1.4\n\n* `%%compare`  is now `%%splity`. `%%splity` is deprecated.\n* Update examples\n\n## 0.1.3\n\n* octoframes github actions setup\n\n## 0.1.2\n\n* Move the repo from kolibril13/jupyter-spitview to octoframes/jupyter_compare_view \n* Rename all references\n## 0.1.1\n\n* Drop the [github.com/NUKnightLab/juxtapose](https://github.com/NUKnightLab/juxtapose) backend and replace it with [github.com/Octoframes/compare_view](https://github.com/Octoframes/compare_view).  \n* Implement horizontal slider\n* Implement Round Mask\n## 0.1.0\n\n* Update dependencies\n* Update JupyterLite version\n* Fix: in JupyterLite, a figure has to be explicitly called by plt.show()\n* Better installation workflow\n\n## 0.0.8\n\n* Fixing problem with cell id and notebook reloading\n* Experimentally lowering the dependencies to\n`ipython = \"\u003e=6.0.0\"` and `ipykernel = \"\u003e=5.0.0\"` so that  jupyterlite will work hopefully.\n\n## 0.0.7\n\n* Rewrite of the import of JavaScript and CSS to make it more robust when closing and opening the notebook\n* First attempt to add a JupyterLite example.\n## 0.0.6 \n\nFix poetry workflow\n\n## 0.0.5 \n\n* Ship the javascript directly with the package, so no internet connection is required\n* use jinja2 to save HTML in separate file\n* load stylesheet and javascript only once in the beginning, and not in every cell that contains the splitview widget.\n\n## 0.0.4 \n\n* New `--height` parameter\n\n## 0.0.3\n\n* default slider position\n* updated minimal example\n* internal code restructuring and formatting\n* Handle import in non jupyter context\n\n## 0.0.2 \n* save images in base64 strings and don't load images to disk (increases package security).\n## 0.0.1\n\n* First release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoframes%2Fjupyter_compare_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoframes%2Fjupyter_compare_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoframes%2Fjupyter_compare_view/lists"}