{"id":18620693,"url":"https://github.com/codybloemhard/editimg","last_synced_at":"2025-11-03T12:30:24.842Z","repository":{"id":240553793,"uuid":"536727080","full_name":"codybloemhard/editimg","owner":"codybloemhard","description":"Edit images.","archived":false,"fork":false,"pushed_at":"2024-10-26T20:11:46.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T04:26:11.836Z","etag":null,"topics":["image-processing","keyboard-workflow","tilling-window-mangers"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codybloemhard.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":"2022-09-14T19:17:41.000Z","updated_at":"2024-10-26T20:11:49.000Z","dependencies_parsed_at":"2024-12-27T07:03:21.235Z","dependency_job_id":null,"html_url":"https://github.com/codybloemhard/editimg","commit_stats":null,"previous_names":["codybloemhard/editimg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybloemhard%2Feditimg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybloemhard%2Feditimg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybloemhard%2Feditimg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codybloemhard%2Feditimg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codybloemhard","download_url":"https://codeload.github.com/codybloemhard/editimg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239414057,"owners_count":19634361,"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","keyboard-workflow","tilling-window-mangers"],"created_at":"2024-11-07T04:07:29.805Z","updated_at":"2025-11-03T12:30:24.775Z","avatar_url":"https://github.com/codybloemhard.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# editimg\n\n## What\n\nEdit images.\n\n- for TWM users\n- scriptable\n- focus on (keyboard heavy) UX\n- do simple/repetitive things quickly\n- not for advanced stuff\n\n## Why\n\nI got tired of using Gimp. It's a fine program that can do lot's of things.\nIt's a GUI program with a workflow similar to many windows and mac software.\nYou'll have to click around in menu's and widgets.\nThis breaks the keyboard based workflow of tilling window managers, vim, etc.\nI also tend to do the same tasks often such as cropping an image.\nThis can be done fine in Gimp but one could image a more efficient\nworkflow and user experience for specific tasks.\n\n## How\n\nCombine CLI, TUI and GUI to get a better workflow.\nStart up in CLI choosing input files and options such as a specific workflow.\nEditimg turns into a TUI in the terminal you launched it and it creates a GUI window.\nThis window expects to be resized by your TWM.\nSimple minimal inputs can be given in the GUI and more complex ones in the TUI.\nThe GUI shows the (intermediate) results.\nThe TUI should be a REPL and take in Rhai.\nAll functionality should be callable from Rhai.\nScripts can be build to automate editing images.\nScripts can be written to design workflows that can be launched.\n\n## Goals\n\n- inputs\n  - [x] CLI interface\n  - GUI\n    - [x] TWM friendly window\n    - [x] Resize image in window\n    - [x] show current buffer\n    - [x] mouse input\n    - [x] keyboard input\n    - [x] draw rectangles\n    - [ ] move around\n    - [ ] zoom\n- scripting\n  - [x] rhai embedding\n  - [x] Wizards to take input (in script)\n  - [ ] headless mode\n\n## Features\n\nGeneral functions:\n- kill: kills session\n- get_input_event: returns Input\n- get_wh: returns WH\n- clear_rects: clears all rectangles on the screen\n- draw_rect_uv(px: f64, py: f64, qx: f64, qy: f64): draw rectangle with UV coordinates\n- draw_rect_xy(px: f64, py: f64, qx: f64, qy: f64): draw rectangle with pixel coordinates\n- show(img: i64): show image buffer on screen\n- show_next: show next image buffer on screen\n- show_prev: show previous image buffer on screen\n- shown: return index of image buffer currently on screen\n- repeat: repeat last image function\n\nImage functions:\n- crop(src: i64, dst: i64, px: i64, py: i64, qx: i64, qy: i64):\n take section defined by p and q from src to dst\n- save(img: i64, filename: String): save image buffer as file\n- fliph(src: i64, dst: i64): flip image horizontally\n- flipv(src: i64, dst: i64): flip image vertically\n- rotate90(src: i64, dst: i64): rotate image 90 degrees clockwise\n- rotate180(src: i64, dst: i64): rotate image 180 degrees clockwise\n- rotate270(src: i64, dst: i64): rotate image 270 degrees clockwise\n- invert(src: i64, dst: i64): invert colours\n- grayscale(src: i64, dst: i64): turn coloured image into grayscale image\n- blur(src: i64, dst: i64, sigma: f64): gaussian blur\n- unsharpen(src: i64, dst: i64, sigma: f64, threshold: i64): unsharpen filter\n- filter3x3(src: i64, dst: i64, filter: [f64; 9]): apply general linear filter\n- adjust_contrast(src: i64, dst: i64, dt: f64): change contrast\n- brighten(src: i64, dst: i64, dt: i64): change brightness\n- huerotate(src: i64, dst: i64, dt: i64): rotate hue (in degrees)\n- resize(src: i64, dst: i64, w: i64, h: i64, method: String): resize image to maxium dimensions\n- resize_exact(src: i64, dst: i64, w: i64, h: i64, method: String): resize image to exact dimensions\n- resize_fill(src: i64, dst: i64, w: i64, h: i64, method: String): resize image to fill dimensions\n- thumbnail(src: i64, dst: i64, w: i64, h: i64): like resize, but with quick algorithm\n- thumbnail_exact(src: i64, dst: i64, w: i64, h: i64): like resize_exact, but with quick algorithm\n- create(w: i64, h: i64): create new image buffer with given dimensions\n- copy(src: i64, dst: i64, x: i64, y: i64): copy image to destination with coordinates\n\nDatatypes:\n- Input\n  - is_click: bool, whether this is a mouse click\n  - key: String, what key or button was pressed\n  - u: f64, u component of UV coordinate of the mouse position ([0..1])\n  - v: f64, v component of UV coordinate of the mouse position ([0..1])\n  - x: i64, x component of the XY coordinate of the mouse position (in pixels)\n  - y: i64, y component of the XY coordinate of the mouse position (in pxiels)\n  - shift: bool, whether shift was held while pressing this key\n  - control: bool, whether control was held while pressing this key\n  - alt: bool, whether alt was held while pressing this key\n  - nummod: bool, whether numlock was active while pressing this key\n  - capsmod: bool, whether capslock was active while pressing this key\n- WH\n  - w: i64, the width of the current image buffer in pixels\n  - h: i64, the height of the current image buffer in pixels\n\n## Issues\n\n- Keyboard input completely breaks when using latest sdl2 0.37.0?\n- Cropping a selection of size 0 crashes the application\n\n## License\n\n```\nCopyright (C) 2024 Cody Bloemhard\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodybloemhard%2Feditimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodybloemhard%2Feditimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodybloemhard%2Feditimg/lists"}