{"id":23873061,"url":"https://github.com/earlopain/iqdb","last_synced_at":"2025-11-17T14:29:28.309Z","repository":{"id":270110150,"uuid":"899566033","full_name":"Earlopain/iqdb","owner":"Earlopain","description":"iqdb fork","archived":false,"fork":false,"pushed_at":"2025-06-09T10:10:59.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T11:23:58.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Earlopain.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null}},"created_at":"2024-12-06T14:31:23.000Z","updated_at":"2025-06-09T10:11:03.000Z","dependencies_parsed_at":"2025-06-09T11:33:36.067Z","dependency_job_id":null,"html_url":"https://github.com/Earlopain/iqdb","commit_stats":null,"previous_names":["earlopain/iqdb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Earlopain/iqdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Earlopain%2Fiqdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Earlopain%2Fiqdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Earlopain%2Fiqdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Earlopain%2Fiqdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Earlopain","download_url":"https://codeload.github.com/Earlopain/iqdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Earlopain%2Fiqdb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259809759,"owners_count":22914933,"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":[],"created_at":"2025-01-03T16:39:19.581Z","updated_at":"2025-11-17T14:29:23.290Z","avatar_url":"https://github.com/Earlopain.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IQDB: Image Query Database System\n\nIQDB is a reverse image search system. It lets you search a database of images\nto find images that are visually similar to a given image.\n\nThis version of IQDB is a fork of the original IQDB used by https://iqdb.org.\nThis version powers the reverse image search for [FoxTrove](https://github.com/earlopain/FoxTrove).\n\n# Quickstart\n\n```bash\n# Run IQDB in Docker on port 5588. This will create a database file in the current directory called `iqdb.sqlite`.\ndocker run --rm -it -p 5588:5588 -v $PWD:/mnt evazion/iqdb http 0.0.0.0 5588 /mnt/iqdb.sqlite\n\n# Test that IQDB is running\ncurl -v http://localhost:5588/status\n\n# Add `test.jpg` to IQDB with ID 1234. You will need to generate a unique ID for every image you add.\ncurl -F file=@test.jpg http://localhost:5588/images/1234\n\n# Find images visually similar to `test.jpg`.\ncurl -F file=@test.jpg http://localhost:5588/query\n```\n\n# Usage\n\nIQDB is a simple HTTP server with a JSON API. It has commands for adding\nimages, removing images, and searching for similar images. Image hashes are\nstored on disk in an SQLite database.\n\n#### Adding images\n\nTo add an image to the database, POST a file to `/images/:id` where `:id` is an\nID number for the image. It is up to you to map them to something useful in your application.\n\n```bash\ncurl -F file=@test.jpg http://localhost:5588/images/1234\n```\n\n```json\n{\n  \"hash\": \"3fe4c6d513c538413fadbc7235383ab23f97674a40909b92f27ff97af97df980fcfdfd00fd71fd77fd7efdfffe00fe7dfe7ffe80fee7fefeff00ff71ff7aff7fff80ffe7fff1fff4fffa00020008001d009d02830285028803020381038304850701078208000801f97df9fffb7afcfdfd77fe00fe7dfe80fefaff00ff7aff7ffffaffff00030007000e000f0010002000830087008e008f009000a0010c010e018202810283028502860290030203810383058306000b83f67afafdfb7ffcf7fcfefcfffd7dfef3fefafeffff7afffa00030007000e001000200080008400870088008e0090010001030107010e018001810183020d02810282029003030483048d0507050e0680\",\n  \"post_id\":1234\n}\n```\n\nThe `signature` is the raw IQDB signature of the image. Two images are similar\nif their signatures are similar. The `hash` is the signature encoded as a hex\nstring.\n\n#### Removing images\n\nTo remove an image to the database, do `DELETE /images/:id` where `:id` is the\nID number of the image.\n\n```bash\ncurl -X DELETE http://localhost:5588/images/1234\n```\n\n```json\n{ \"post_id\": 1234 }\n```\n\n#### Searching for images\n\nTo search for an image, POST a `file` to `/query?limit=N`, where `N` is the\nmaximum number of results to return (default 10).\n\n```bash\ncurl -F file=@test.jpg 'http://localhost:5588/query?limit=10'\n```\n\n```json\n[\n  {\n    \"hash\":\"3fe4c6d513c538413fadbc7235383ab23f97674a40909b92f27ff97af97df980fcfdfd00fd71fd77fd7efdfffe00fe7dfe7ffe80fee7fefeff00ff71ff7aff7fff80ffe7fff1fff4fffa00020008001d009d02830285028803020381038304850701078208000801f97df9fffb7afcfdfd77fe00fe7dfe80fefaff00ff7aff7ffffaffff00030007000e000f0010002000830087008e008f009000a0010c010e018202810283028502860290030203810383058306000b83f67afafdfb7ffcf7fcfefcfffd7dfef3fefafeffff7afffa00030007000e001000200080008400870088008e0090010001030107010e018001810183020d02810282029003030483048d0507050e0680\",\n    \"post_id\":1234,\n    \"score\":100\n  }\n]\n```\n\nThe response will contain the top N most similar images. The `score` field is\nthe similarity rating, from 0 to 100. The `post_id` is the ID of the image,\nchosen when you added the image.\n\nYou will have to determine a good cutoff score yourself. Generally, 90+ is a\nstrong match, 70+ is weak match (possibly a false positive), and \u003c50 is no\nmatch.\n\n# Compiling\n\nIQDB requires the following dependencies to build:\n\n* A C++ compiler\n* [CMake 3.19+](https://cmake.org/install/)\n* [SQLite](https://www.sqlite.org/download.html)\n* [Git](https://git-scm.com/downloads)\n\nRun `make` to compile the project. The binary will be at `./build/release/src/iqdb`.\n\nRun `make debug` to compile in debug mode. The binary will be at `./build/debug/src/iqdb`.\n\nYou can also run `cmake --preset release` then `cmake --build --preset release\n--verbose` to build the project. `make` is simply a wrapper for these commands.\n\nYou can run `make docker` to build the docker image.\n\nSee the [Dockerfile](./Dockerfile) for an example of which packages to install.\n\n# History\n\nThis version of IQDB is a fork of the [Danbooru IQDB](https://github.com/danbooru/iqdb)\nwith improvements from [evazion](https://github.com/danbooru/iqdb)\nwhich is in turn a fork of the [original IQDB](https://iqdb.org/code),\nwritten by [piespy](mailto:piespy@gmail.com). IQDB is based on code from\n[imgSeek](https://sourceforge.net/projects/imgseek/), written by Ricardo\nNiederberger Cabral. The IQDB algorithm is based on the paper\n[Fast Multiresolution Image Querying](https://grail.cs.washington.edu/projects/query/)\nby Charles E. Jacobs, Adam Finkelstein, and David H. Salesin.\n\nIQDB is distributed under the terms of the GNU General Public License. See\n[COPYING](./COPYING) for details.\n\n# Further reading\n\n* https://grail.cs.washington.edu/projects/query\n* https://grail.cs.washington.edu/projects/query/mrquery.pdf\n* https://cliutils.gitlab.io/modern-cmake/\n* https://riptutorial.com/cmake\n* https://github.com/yhirose/cpp-httplib\n* https://hub.docker.com/repository/docker/evazion/iqdb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fearlopain%2Fiqdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fearlopain%2Fiqdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fearlopain%2Fiqdb/lists"}