{"id":20790700,"url":"https://github.com/beakerandjake/bpimage","last_synced_at":"2026-04-17T08:31:14.722Z","repository":{"id":92700921,"uuid":"474171341","full_name":"beakerandjake/bpimage","owner":"beakerandjake","description":"A simple image editing library which can be used from the command line.","archived":false,"fork":false,"pushed_at":"2022-06-03T22:26:21.000Z","size":209,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T20:39:48.111Z","etag":null,"topics":["c","cli","image","image-processing","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/beakerandjake.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-03-25T21:41:28.000Z","updated_at":"2022-06-03T22:28:42.000Z","dependencies_parsed_at":"2023-04-22T11:03:43.067Z","dependency_job_id":null,"html_url":"https://github.com/beakerandjake/bpimage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beakerandjake/bpimage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerandjake%2Fbpimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerandjake%2Fbpimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerandjake%2Fbpimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerandjake%2Fbpimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beakerandjake","download_url":"https://codeload.github.com/beakerandjake/bpimage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beakerandjake%2Fbpimage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31921750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"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":["c","cli","image","image-processing","python"],"created_at":"2024-11-17T15:36:59.808Z","updated_at":"2026-04-17T08:31:14.704Z","avatar_url":"https://github.com/beakerandjake.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bpimage\nbpimage is a simple image editing library which can be used from the command line. Basic image transformations, color editing, and convolution filters are implemented.\n\nCreated mainly so I could explore numpy, image processing, cli development, and extending python with c. \n\n### Commands\n - [preview](#preview--p)\n - [dest](#dest--d)\n - [boxblur](#boxblur)\n - [brightness](#brightness)\n - [contrast](#contrast)\n - [emboss](#emboss)\n - [fliph](#fliph)\n - [flipv](#flipv)\n - [gaussian](#gaussian)\n - [invert](#invert)\n - [motionblur](#motionblur)\n - [outline](#outline)\n - [rgb2gray](#rgb2gray)\n - [rotate](#rotate)\n - [rotate90](#rotate90)\n - [saturation](#saturation)\n - [scale](#scale)\n - [sepia](#sepia)\n - [sharpen](#sharpen)\n - [shear](#shear)\n\n## Dependencies\n - python (\u003e= 3.10)\n - numpy (\u003e= 1.22)\n - Pillow (\u003e= 9.1.1)\n    - used only for io tasks such as loading, saving and previewing images\n    \n## Installation\n\n### From Source\nbpimage depends on functions written in multiple c files. These files must be compiled into a shared library so they can be invoked from python.\n\n#### Prerequisites \nYou will need: \n - A c compiler, such as gcc. \n\n**Linux**\n\n```bash\n# checkout project if you have not already.\ngit clone https://github.com/beakerandjake/bpimage.git\n# change your pwd to the root of the project.\ncd bpimage\n# compile all source c files into a shared library.\ngcc -fPIC -shared -O3 bpimage/*.c -o bpimage.so\n```\n\nThis will create a bpimage.so file. This file will be loaded in python and used by the library to perform image manipulation. \n\n## CLI Usage \nFirst ensure that you have compiled the c files and that your pwd is the root of the project.\n```bash\ncd bpimage\n```\n\nYou can print help by running the command without arguments, or with the --help option. \n```bash\npython3 bpimage/main.py --help\n```\n\nThe first argument expected is the source image file. Then you can specify zero one or more edits to apply to the image. Finally you need to specify an output. The output could either be saved to a new file or previewed. \n\nHere is an example which rotates an image 90 degrees, inverts the colors, then saves it to a new file. \n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --rotate90 --invert -d ~/Pictures/output.png\n```\n\n## Commands\n\n### preview (-p)\nCreates a temporary file and opens the image with the systems default image viewer. Useful for testing commands and immediately seeing the result. Cannot be used with dest (-d).\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --invert -p\n```\n\n### dest (-d)\nSaves the image to the specified location. Cannot be used with preview (-p).\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png -d ~/Pictures/output.png\n```\n\n\n### boxblur\nBlurs each pixel by averaging all surrounding pixels extending radius pixels in each direction.\n\n#### Arguments:\n  - radius (int): Number of pixels to take in each direction.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --boxblur 2 -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-boxblur](https://user-images.githubusercontent.com/1727349/171954263-f5b6c949-4f85-4807-841b-825555956620.jpg)\n\n### brightness\nModifies the brightness of the image.\n\n#### Arguments:\n  - strength (float): The amount to brighten or darken the image. A value of 0.0 will result in a black image, 1.0 gives the original image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --brightness 1.5 -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-brightness](https://user-images.githubusercontent.com/1727349/171954234-03c00139-bfe3-4327-a50d-bc48cd937f85.jpg)\n\n### contrast\nModifies the contrast of the image. \n\n#### Arguments:\n  - strength (float): The amount to brighten or darken the image. A value of 0.0 will result in a gray image, 1.0 gives the original image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --contrast 1.8 -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-contrast](https://user-images.githubusercontent.com/1727349/171954237-72508fee-8deb-44ea-b463-c14da4661dd6.jpg)\n\n### emboss\nApplies an emboss effect to the image.\n\n#### Arguments:\n - direction (str): One of the following supported values. \n    - 'u' Emboss from top to bottom   \n    - 'd' Emboss from bottom to top\n    - 'l' Emboss from left to right\n    - 'r' Emboss from right to left\n - strength (float): The number of surrounding pixels to take in each direction.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --emboss r 1 -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-emboss](https://user-images.githubusercontent.com/1727349/171954267-bc741bcd-ce1d-4bcd-ad82-009434b0761c.jpg)\n\n### fliph\nFlips the image across the horizontal, from bottom to top.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --fliph -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-fliph](https://user-images.githubusercontent.com/1727349/171756218-0e2cac16-8468-440f-8446-7304c5bdab58.png)\n\n### flipv\nFlips the image across the vertical, from left to right.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --flipv -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-flipv](https://user-images.githubusercontent.com/1727349/171754207-5c7d5dff-aa2d-45ac-ad6c-8f0840f2da26.png)\n\n### gaussian\nApplies a gaussian blur to the image.\n\n#### Arguments:\n - radius (int): The number of pixels to take in each direction.\n - sig (float): The sigma of the gaussian function. Higher values result in more blurring.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --gaussian 2 6.0 -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-gaussian](https://user-images.githubusercontent.com/1727349/171954275-a02b3816-71cb-459e-b8c5-2799d4f68976.jpg)\n\n### invert\nCreate a negative of the image. \n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --invert -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-invert](https://user-images.githubusercontent.com/1727349/171954245-63080d4b-965f-4d68-97d8-ca98f12fbad2.jpg)\n\n### motionblur\nApplies motion blur to the image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --motionblur -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-motionblur](https://user-images.githubusercontent.com/1727349/171954279-7c463749-27ee-478d-8da9-72819455e2a1.jpg)\n\n### outline\nHighlights edges of the image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --outline -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-outline](https://user-images.githubusercontent.com/1727349/171954287-220bf86f-ea1a-4983-9b58-11048d8fe055.jpg)\n\n### rgb2gray\nConverts an RGB image to a grayscale image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --rgb2gray -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-gray](https://user-images.githubusercontent.com/1727349/171954242-90c253bc-6847-4bd0-8e50-edfd705bf924.jpg)\n\n### rotate\nRotates the image counter-clockwise by a specified angle around the center. Optionally expands the canvas size to hold the rotated image.\n\n#### Arguments:\n  - angle (float): The amount of degrees to rotate the image. \n  - expand (boolean): Should the canvas be expanded to hold the rotated image? \n\n#### Example:\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --rotate 45 true -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-rotate](https://user-images.githubusercontent.com/1727349/171946148-4ca79f9d-4585-474c-9fe6-33ad1bb43d87.png)\n\n### rotate90\nRotates the image counter-clockwise 90 degrees around the center n times.\n\n#### Arguments:\n  - times (integer): Number of times to rotate the image.\n\n#### Example:\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --rotate90 3 -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-rotate90](https://user-images.githubusercontent.com/1727349/171756768-e9015165-aa84-4ead-8ba4-bb4080906f41.png)\n\n### saturation\nModify the color saturation of the image. \n\n#### Arguments:\n  - strength (float): The amount to modify the saturation. A value of 0.0 will result in a black and white image, 1.0 gives the original image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --saturation 1.8 -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-saturation](https://user-images.githubusercontent.com/1727349/171954249-f5c4f409-16e3-4951-ac11-822911c70057.jpg)\n\n### scale\nRe-sizes the image uniformly based on a scale factor.\n\n#### Arguments:\n  - scale (float): Non-zero positive number multiplied by the width and height of the image to determine the dimensions of the resulting image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --scale .5 -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-scale](https://user-images.githubusercontent.com/1727349/171946358-4720390a-b60b-459e-b0a7-9214833f443a.png)\n\n### sepia\nApplies a sepia tone to an RGB image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --sepia -d ~/Pictures/output.png\n```\n![baboon-sm](https://user-images.githubusercontent.com/1727349/171954229-92ebc046-4b8e-4562-9bdd-f13d859934be.jpg)\n![baboon-sepia](https://user-images.githubusercontent.com/1727349/171954258-ac993cd7-43d7-4693-859a-8cd079dda49f.jpg)\n\n### sharpen\nModify the color saturation of the image. \n\n#### Arguments:\n  - strength (float): The amount to modify the saturation. A value of 0.0 will result in a black and white image, 1.0 gives the original image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --shear .25 0 true -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sharpen](https://user-images.githubusercontent.com/1727349/171954293-47f1329f-46d9-4db1-9f37-10100cd9a6e5.jpg)\n\n### shear\nShears the image in the specified dimension(s). Optionally expands the canvas size to hold the rotated image.\n\n#### Arguments:\n - shear_x (float): The amount to shear the image in the x axis (0.0 does nothing)\n - shear_y (float): The amount to shear the image in the y axis (0.0 does nothing)\n - expand (bool): If true, expands the dimensions of resulting image so it's large enough to hold the entire skewed image.\n\n```bash\npython3 bpimage/main.py ~/Pictures/example.png --shear .25 0 true -d ~/Pictures/output.png\n```\n![boat-sm](https://user-images.githubusercontent.com/1727349/171754143-f9c9e477-653f-483d-957b-02be975e20f9.png)\n![boat-sm-shear](https://user-images.githubusercontent.com/1727349/171946655-2f3a2060-8232-4852-871d-12b066b487fa.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeakerandjake%2Fbpimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeakerandjake%2Fbpimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeakerandjake%2Fbpimage/lists"}