{"id":31727808,"url":"https://github.com/pinaki82/two_img_lut","last_synced_at":"2026-07-19T01:37:10.950Z","repository":{"id":315218770,"uuid":"1058583968","full_name":"Pinaki82/two_img_lut","owner":"Pinaki82","description":"Generate a 3D LUT (.cube) file by comparing two images: a source image and a colour-graded target image.","archived":false,"fork":false,"pushed_at":"2025-09-17T10:26:24.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T11:36:12.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":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pinaki82.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T09:28:21.000Z","updated_at":"2025-09-17T10:26:28.000Z","dependencies_parsed_at":"2025-09-17T11:36:14.590Z","dependency_job_id":"760bb5db-6e29-4720-9634-2e48459efe94","html_url":"https://github.com/Pinaki82/two_img_lut","commit_stats":null,"previous_names":["pinaki82/two_img_lut"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Pinaki82/two_img_lut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Ftwo_img_lut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Ftwo_img_lut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Ftwo_img_lut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Ftwo_img_lut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pinaki82","download_url":"https://codeload.github.com/Pinaki82/two_img_lut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Ftwo_img_lut/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000876,"owners_count":26082951,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-09T06:57:24.889Z","updated_at":"2025-10-09T06:57:26.258Z","avatar_url":"https://github.com/Pinaki82.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# two_img_lut\n\nGenerate a 3D LUT (.cube) file by comparing two images: a source image and a colour-graded target image.\n\n---\n\n## Authorship \u0026 License\n\n**License**: MIT-0 (Public Domain equivalent)  \n**Written by**: ChatGPT on 17 September 2025  \n**Copyright**: Pinaki Gupta\n\n---\n\n## Features\n\n- Accepts two images: the original (source) and the colour-graded version (target).  \n- Produces a `.cube` 3D LUT mapping source → target.  \n- Supports a default LUT size if not specified.  \n- Prints elapsed wall-clock time after processing.  \n- Linux only (uses `clock_gettime`, etc.).\n\n---\n\n## Requirements\n\n- Linux operating system.  \n- GCC (or a C compiler) supporting C11.  \n- Math library (`libm`) available.  \n- `stb_image.h` and `stb_image_write.h` [from [GitHub - nothings/stb: stb single-file public domain libraries for C/C++](https://github.com/nothings/stb.git)] placed under `external/stb/` (or wherever included via the Makefile).\n\n---\n\n## Installation\n\nAssuming your directory structure is:\n\n```css\n.\nyour-project/\n├── external/\n│ └── stb/\n│ ├── stb_image.h\n│ └── stb_image_write.h\n├── src/\n│ └── two_img_lut.c\n│ └── lutgen.h\n├── Makefile\n└── README.md\n```\n\nTo build and install:\n\nClone the repository (if you haven’t already). You can use the --recursive flag so submodules are initialised at clone time:\n\n```bash\ngit clone --recursive https://github.com/Pinaki82/two_img_lut.git\ncd two_img_lut/\n```\n\nIf you already have the repo (without submodules), then after pulling, run:\n\n```bash\ngit submodule update --init --recursive\n```\n\nAfter that, to update the main repo and submodules later, you might want to do:\n\n```bash\ngit pull --recurse-submodules\ngit submodule update --init --recursive\n```\n\nOr, configure git so that git pull always recurses into submodules.\n\nThen,\n\n```bash\nmake\nmake install\n```\n\nThis compiles the `two_img_lut binary` and copies it to `~/.local/bin`.\nMake sure `~/.local/bin` is in your `PATH`:\n\n```bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\nPut that into your shell startup (e.g. `~/.bashrc` or `~/.zshrc`) if not already.\n\n```bash\ntwo_img_lut \u003csource.png\u003e \u003ctarget.png\u003e [lut_size[optional]] \u003coutput.cube\u003e\n```\n\n- If lut_size is omitted, a default size (e.g. 33) is used.\n\n- Examples:\n\n```bash\n$ ls\nsource.png\nsource_corrected.png\n\n# Generate LUT with default size\ntwo_img_lut source.png source_corrected.png corrected_lut.cube\n\n# Or specify LUT size\ntwo_img_lut source.png source_corrected.png 17 small_lut.cube\n```\n\nInput images must have the same dimensions.\n\n**Notes \u0026 Tips**\n\n- The generated .cube file is ASCII, assumes RGB values in the [0,1] domain for both input \u0026 output.\n\n- Cells in the LUT with no sample data are filled via nearest-neighbour fallback.\n\n- A higher lut_size gives finer colour mapping but slower processing and a larger LUT file.\n\n- Ensure both source and target images are in the same colour space/gamma curve before generating the LUT; mismatched gamma can lead to incorrect results.\n\n```css\n.\n├── external/\n│   └── stb/\n│       ├── stb_image.h\n│       └── stb_image_write.h\n├── src/\n│   └── two_img_lut.c\n│   └── lutgen.h\n├── Makefile\n└── README.md\n```\n\n**License**\n\nMIT-0 — Public Domain equivalent. See source file for full text.\n\n```css\nMIT No Attribution\n\nCopyright \u003cyear\u003e \u003ccopyright holders\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinaki82%2Ftwo_img_lut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinaki82%2Ftwo_img_lut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinaki82%2Ftwo_img_lut/lists"}