{"id":15009830,"url":"https://github.com/zazaho/simimg","last_synced_at":"2025-04-09T17:52:56.014Z","repository":{"id":57467238,"uuid":"223118051","full_name":"zazaho/SimImg","owner":"zazaho","description":"Python/TkInter program to find and display \"similar\" images. This is the development site, to install use 'pip install simimg'.","archived":false,"fork":false,"pushed_at":"2024-11-23T06:00:36.000Z","size":43133,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T19:51:33.582Z","etag":null,"topics":["gui","imageviewer","python3","similarity-search"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/simimg/","language":"Python","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/zazaho.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","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":"2019-11-21T07:51:15.000Z","updated_at":"2024-11-23T06:00:10.000Z","dependencies_parsed_at":"2024-11-12T06:31:41.992Z","dependency_job_id":null,"html_url":"https://github.com/zazaho/SimImg","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"2f82218acac149be0d098262e2d52ad842e134f6"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazaho%2FSimImg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazaho%2FSimImg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazaho%2FSimImg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zazaho%2FSimImg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zazaho","download_url":"https://codeload.github.com/zazaho/SimImg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248083413,"owners_count":21045092,"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":["gui","imageviewer","python3","similarity-search"],"created_at":"2024-09-24T19:28:49.342Z","updated_at":"2025-04-09T17:52:55.991Z","avatar_url":"https://github.com/zazaho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Similar Image Finder (Simimg)\n![Simimg in action](doc/demo.gif)\n\n# Description\nThis is a python GUI for displaying pictures grouped according to\nsimilarity. The main aim of the program is to help identify groups of\nholiday snaps that resemble each-other and efficiently inspect those\ngroups. It allows you to easily keep only the best photos.\n\nThe program is **not** designed to identify the same but modified pictures\n(recompressed jpgs, cropped images or adapted colours, etc.). Although\nit can be used for this there are many and better solutions available.\n\nUpon starting Simimg from the command line, by default it will load\nthe pictures it finds in the startup directory and sub-directories\ninto the GUI. These are settings that can be changed within the GUI by\nclicking on settings (![](simimg/icons/settings.png)). *In particular\nin the case you want to use the program by clicking on its icon, you\nmay want to set an empty startup directory.*\n\nYou can play with different filters that take into account how similar\ntwo pictures are. These are the panels in the left section of the\nfinder window below the **Filters** title. You can activate a\nfilter by clicking on its name. The following options exist:\n\n* I have implemented measurements of how similar the colours are\nbetween two images, as well as between 5 regions (the four corners and\nthe central part). The measurement in HSV (hue-saturation-value)\nsupposedly reflects best how humans perceive image information.\n\n* Some gradient metrics adapted from ImageHash (dhash). Basically\nthese measure whether two images have similar patterns of brighter and\ndarker regions.\n\n* You can further select the maximum allowed time-span between the\nmoments the pictures were taken in order to be considered a match.\n\n* You can match on camera model. This means that two pictures are\nconsidered to be a match if they were taken with the same camera.\n  \n* Finally you can match on image shape. You can choose:\n\n\t* portrait/landscape: width smaller/larger or equal to height\n\n\t* exact: width/height are identical\n\n\t* some percentage difference allowed\n\nSome of the selection criteria have additional parameters that you can\nplay with.\n\nEach filter has a **Must Match** checkbox. If this is switched on,\nonly those pairs that satisfy this filter are considered matches.\nNote that:\n\n1) **Must Match** has no effect if only one filter is active.\n\n2) If some filter(s) have **Must Match** set, other filters without\n**Must Match** have no effect.\n\n3) When multiple filters are active and no **Must Match** is set,\ntwo images are considered a matching pair if any of the conditions is\nsatisfied.\n\nThe actual use is to be able to better drill down the list. For\nexample it allows to show only those groups that have similar colours\n**and** are taken with the same camera by switching on **Must Match** for\nboth filters.\n\n# What matching groups are shown?\nWhen the program starts, there are no active filters and thumbnails\nof all files are shown in a grid sorted by filename.\n\nOnce some filters are activated or changed the display will be\nupdated.\n\nFor each picture that has some matches in the collection, the group\nof matching thumbnails will be shown in a row. The only exception is a\ngroup that is already displayed in its entirety as a\nsubgroup on another line.\n\nSimimg does its best to maintain the sorting order of the displayed\nfiles according to filename. This is chosen for two reasons. \n\n1) It limits the visual changes when modifying parameters or filters.\nThis helps to understand the impact of the modification.\n\n2) Many times the filename of holiday pictures represents a natural\nsorting order; for example the serial photo-number or a prefix chosen\nto indicate where a picture was taken. Maintaining this order, means\nrelated pictures have more chance of being presented close together.\n\nNote that completely identical files (exact copies of some image file)\nwill not be shown twice. Instead one thumbnail will be shown with a\ngreen border around it.\n\n# Available functions\n## Thumbnail buttons\nYou can click on the **Hide**, **Move** or **Delete** button below\neach image.\n\n* **Hide** will remove the thumbnail from the display but it will not delete\nthe file from your hard-disk.\n\n* **Delete** will remove the file from the display and from your\nhard-disk.\n\n* **Move** will Move the file to the folder selected in the move list\non the bottom left. See below.\n\n## (De)selecting thumbnails\nYou can select a thumbnail by clicking on it; its background will turn\nblue to indicate that it is selected.\n\nPressing the Control (Ctrl) key while clicking will select or deselect\nthe entire line of thumbnails.\n\nPressing the Shift key while clicking will select all thumbnails between\nthe current image and the last selected image.\n\nClicking in an empty part of the thumbnail display area deselects all\nimages.\n\nThe little red check-mark button  (![](simimg/icons/uncheck.png)) in the toolbar area\n(top-left) also switches between select-all and unselect-all thumbnails.\n\nPressing Ctrl+a toggles between selecting and unselecting all thumbnails.\n\n## Actions for selected thumbnails\nThe *Play* button (![](simimg/icons/play.png))  in the toolbar will show a window that allows\nto view the selected images in larger versions (Ctrl+v).\n\nThe *Minus* button (![](simimg/icons/hide.png)) will hide all selected thumbnails (Ctrl+h)\n\nThe *Red-X* button (![](simimg/icons/delete.png)) will delete all selected thumbnails (Ctrl+d)\n\nThe *Two folder* button (![](simimg/icons/move.png)) will move the selected thumbnails (Ctrl+m)\n\n## Photo organisation functions\nBecause the Finder window is also a great way to get an overview, even\nwithout using the filtering functions, I have implemented a very basic\norganisation option into it. These are represented by the *Move*\nfolders.\n\nImagine you have 2 folders defined: \"WebAlbum\", \"EditWithGimp\". You\nperuse you photos, select and delete those that are poor, you select\nthose that are nice but either need better framing or need playing a\nbit with the brightness. Activate the \"EditWithGimp\" folder and press\n*Move* button (![](simimg/icons/move.png)). Next, you have found a\nnumber of great pictures that you want to publish. Select those,\nactivate the \"WebAlbum\" target and press *Move*.\n\n## Actions in the viewer window\nOne design goal is a clean interface with a lot of room for the\npictures themselves. Therefore there are no action buttons in the\nviewer.\n\nThe follow actions are available in the viewer window:\n\n* F1 or i: show a short help window\n\n* left mouse button, arrow-right or n: show the next picture\n\n* right mouse button, arrow left or p: show the previous picture\n\n* scrollwheel: zoom-in on part of the picture\n\n* delete or d: delete the picture from disk\n\n* m: move the file to the move-target directory selected in the finder\n  window\n\n* f: flip the image horizontally\n\n* c: toggle automatically adjusting the contrast\n\n* e: toggle equalizing the image\n\n* g: toggle converting the image to grayscale\n\n* 1: move the file to the **first** move-target directory\n\n* 2: move the file to the **second** move-target directory\n\n* 3: move the file to the **third** move-target directory\n\n* escape or q: quit the viewer\n\n## Tips\nThere are a few features that are not immediately obvious. *Camera\nModel* and *Picture Shape* can be set to \"different\". By themselves\nthese options are not useful because they will show unrelated pictures\ntogether. They can become interesting in the following scenario:\n\nSeveral people have taken pictures of the same scene, you select\npictures taken close in time or with similar colours. If you impose\ndifferent *Camera Model* you can concentrate on similar pictures but\ntaken by different people.\n\nThe Folder select dialog for **move** does not allow to create folders\non some platforms. Selecting the parent directoy and adding (by\ntyping) the target folder you would like to create before pressing OK\nwill create the directory.\n\n## Technical remarks\nI have seen quite a variety of 'success', meaning that some algorithm\ndetects matches that I myself would also call a match. It depends a\nlot on the set of images that one uses as input. I find it useful to\nplay around a bit with selecting different algorithms and playing with\nthe numerical limits. To help with this, the tooltip of the limit\nselectors will tell you at which value the first match happens and at\nwhich value more than 10 matches are found. \n\nIn my experience, for the purpose of detecting the most interesting\nsimilar holiday pictures the \"Gradient (horizontal)\" algorithm can be\nuseful but the \"HSV (5 regions)\" in the Colours Distance gives the\nbest results.\n\nThe other filters should be considered optional to further limit the\nshown matches.\n\nSome of the calculations can be time-consuming and Simimg tries to be\nclever about not recalculating. It will store the calculated values in\na database for future use. It recognises the pictures files by their\nMD5-hash which means that even if you move files or rename them, their\nimage properties will not be recalculated.\n\nIt attempts to do the most expensive calculations in parallel making\noptimal use of your computers capabilities.\n\nNote that, for reasons of speed, the maximum number of thumbnails that\nwill be shown will not exceed about 300.\n\nNote that, for reasons of speed and memory, the maximum number of\nfiles that will be loaded when adding a folder is 900.\n\n# Credit\nThis project uses the following open source packages:\n\n* [Python](https://www.python.org/): version 3\n\n* [tkinter](https://docs.python.org/3/library/tkinter.html) that\nshould normally come with your python\n\n* [pillow](https://python-pillow.org/) for image reading and processing.\n\n* The tooltip code is adapted from an example found on\n  [Daniweb](https://www.daniweb.com/programming/software-development/code/484591/a-tooltip-class-for-tkinter).\n  \nSome of the algorithms used have been inspired by code found at\n[imagedupes](https://github.com/ghemsley/imagedupes), \n[pyimagesearch](https://www.pyimagesearch.com/2014/12/01/complete-guide-building-image-search-engine-python-opencv/)\nand [imageHash](https://github.com/JohannesBuchner/imagehash).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazaho%2Fsimimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzazaho%2Fsimimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzazaho%2Fsimimg/lists"}