{"id":16703583,"url":"https://github.com/kurtbuilds/imcon","last_synced_at":"2025-03-14T08:22:01.137Z","repository":{"id":122600892,"uuid":"453108413","full_name":"kurtbuilds/imcon","owner":"kurtbuilds","description":"A modern CLI tool for image manipulation","archived":false,"fork":false,"pushed_at":"2022-03-29T14:36:08.000Z","size":1960,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T02:44:47.164Z","etag":null,"topics":["image-processing","image-transformation","jpeg","pdf","png","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kurtbuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-01-28T14:59:11.000Z","updated_at":"2023-04-05T19:37:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b448d23-d725-425a-9f15-077535e4215e","html_url":"https://github.com/kurtbuilds/imcon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtbuilds%2Fimcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtbuilds%2Fimcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtbuilds%2Fimcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kurtbuilds%2Fimcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kurtbuilds","download_url":"https://codeload.github.com/kurtbuilds/imcon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243544565,"owners_count":20308177,"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":["image-processing","image-transformation","jpeg","pdf","png","rust"],"created_at":"2024-10-12T19:08:45.959Z","updated_at":"2025-03-14T08:22:01.118Z","avatar_url":"https://github.com/kurtbuilds.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/kurtbuilds/imcon/graphs/contributors\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/contributors/kurtbuilds/imcon.svg?style=flat-square\" alt=\"GitHub Contributors\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/kurtbuilds/imcon/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/kurtbuilds/imcon.svg?style=flat-square\" alt=\"Stars\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/kurtbuilds/imcon/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/kurtbuilds/imcon/test?style=flat-square\" alt=\"Build Status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/imcon\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/imcon?style=flat-square\" alt=\"Downloads\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://crates.io/crates/imcon\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/imcon?style=flat-square\" alt=\"Crates.io\" /\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\n# imcon\n\n`imcon` is a library meant as a spiritual successor to ImageMagick, but with fewer dependencies and \nmodern command line interface.\n\nRight now it's in a very early stage of development, but it's a work in progress.\n\nSupported file types:\n\n- [x] PDF\n- [x] HEIC\n- [ ] PNG\n- [ ] JPEG\n- [ ] TIFF\n- [ ] GIF\n- [ ] BMP\n- [ ] ICO\n- [ ] SVG\n\n# Usage\n\n    imcon --scale 2 ~/Downloads/multipage.pdf\n\nThis will scale the PDF to double the size, and create png files (the default for PDF) in your current directory.\n\n```\n$ ls\nmultipage0.png\nmultipage1.png\nmultipage2.png\nmultipage3.png\n```\n\nRead the help for more information.\n\n# Installation\n\nYou need a copy of `pdfium` to be able to read PDF files. These\ninstructions makes that library available.\n\n    git clone https://github.com/kurtbuilds/imcon\n    cd imcon\n    # Note this requires sudo, as it installs to /usr/local/, \n    # which (should be) owned by root. This script is tiny\n    # enough that you can read it if you're especially worried \n    # about security.\n    brew install libheif\n    just install_with_library\n\n\u003e **Note:** if you don't already have `just`, install it with `cargo install just`.\n\nInstallation from cargo is not supported yet.\n\nIf you just need `imcon` and already have `pdfium`, you can install it with:\n\n    git clone https://github.com/kurtbuilds/imcon\n    cd imcon\n    just install\n\n# Roadmap\n\n- [x] Add support for PDF\n- [x] Add support for HEIC\n- [x] Add support for PNG\n- [x] Add support for JPEG\n- [ ] Add support for TIFF\n- [ ] Add support for TGA\n- [ ] Add support for BMP\n- [ ] Add support for ICO\n- [ ] Add support for SVG\n- [ ] Add support for WEBP\n- [ ] Add support for command line flags\n  - [ ] --in-place to replace input files in place.\n  - [ ] --verbose to print out what's happening.\n  - [ ] --lighten\n  - [ ] --darken\n  - [ ] --blur\n- [ ] Add support for metadata (i.e. print metadata instead of creating the image)\n- [ ] Support for using imcon as both a CLI and a library.\n- [ ] Build a Python wrapper library.\n- [ ] Build a Node wrapper library.\n- [ ] Build a Ruby wrapper library.\n- [ ] Write docs on target_width/height vs max_width/height.\n- [ ] Create a Brew formula for installing Pdfium.\n- [ ] Make build rules for libheif more flexible to diff versions of libheif.\n- [ ] Benchmarks on various conversion \u0026 image manip operations, compared to other Rust (or other) libs.\n\n# Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n# Development Notes\n\nThese are personal notes on solving problems in the repo, not written with public audience in mind.\n\n- What are operations you want on scaling images?\n    - Resize the image to a max side length.  (-W $size -H $size)\n    - Resize the image to a specific width. (-w $size)\n    - Resize the image to a specific height. (-h $size)\n\n- You might also want to just print metadata.\n  - width\n  - height\n  - # channels\n  - exif data\n  - # of pages\n- Resize the image \n\n\n# Future examples\n\nCreate a transparent canvas. Prints to stdout. Defaults to .png.\n\n    imcon -w 1024 -h 1024 \\#000000ff \u003e canvas.png  # can also be \\#000f\n    imcon -w 1024 -h 1024 \\#000000ff -o canvas.jpg\n\n    cat icon.png | imcon --stdin-format png --stdout-format jpg\n\n\n\n    imcon canvas.png --dominant 5 \n\n\n\n```python\n\n# this is the brown ugly shit.\navg_patch = np.ones(shape=img.shape, dtype=np.uint8)*np.uint8(average)\n\nindices = np.argsort(counts)[::-1]   \nfreqs = np.cumsum(np.hstack([[0], counts[indices]/float(counts.sum())]))\nrows = np.int_(img.shape[0]*freqs)\n\ndom_patch = np.zeros(shape=img.shape, dtype=np.uint8)\nfor i in range(len(rows) - 1):\n    dom_patch[rows[i]:rows[i + 1], :, :] += np.uint8(palette[indices[i]])\n    \nfig, (ax0, ax1) = plt.subplots(1, 2, figsize=(12,6))\nax0.imshow(avg_patch)\nax0.set_title('Average color')\nax0.axis('off')\nax1.imshow(dom_patch)\nax1.set_title('Dominant colors')\nax1.axis('off')\nplt.show(fig)\n\n\n    DataSource {\n        File(Path, Format),\n        Memory(Bytes, Format),\n        Image(::image::DynamicImage),\n    }\n\n    imcon::Image::open(\"foo.pdf\").save_all_pages(\"foo.png\")\n\n    imcon::open_all(\"foo.pdf\") -\u003e Result\u003cVec\u003cImage\u003e\n    \n    either we load the data or it's deferred.\n    \n    imcon::open_all(\"foo.pdf\") -\u003e Result\u003cVec\u003cImage\u003e\u003e\n    \n    imcon::ImageComputation::open(\"foo.pdf\").resize(1024, 1024).save_to_path_template\n    \n    you can save from a pdf.... ok fine.\n    \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtbuilds%2Fimcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkurtbuilds%2Fimcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkurtbuilds%2Fimcon/lists"}