{"id":25560019,"url":"https://github.com/styropyr0/bitmap-array-generator-from-image","last_synced_at":"2026-03-03T00:30:18.713Z","repository":{"id":267660039,"uuid":"901963581","full_name":"styropyr0/Bitmap-Array-Generator-From-Image","owner":"styropyr0","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-11T16:51:29.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-11T17:36:22.145Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styropyr0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-11T16:35:45.000Z","updated_at":"2024-12-11T16:51:33.000Z","dependencies_parsed_at":"2024-12-11T17:36:24.324Z","dependency_job_id":"fd75a25a-85e6-455c-bfe1-179e5bb6c8ef","html_url":"https://github.com/styropyr0/Bitmap-Array-Generator-From-Image","commit_stats":null,"previous_names":["styropyr0/bitmap-array-generator-from-image"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FBitmap-Array-Generator-From-Image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FBitmap-Array-Generator-From-Image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FBitmap-Array-Generator-From-Image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FBitmap-Array-Generator-From-Image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styropyr0","download_url":"https://codeload.github.com/styropyr0/Bitmap-Array-Generator-From-Image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239881744,"owners_count":19712633,"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-02-20T17:28:53.122Z","updated_at":"2026-03-03T00:30:18.571Z","avatar_url":"https://github.com/styropyr0.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSD1306 Bitmap Generator\n\nA Python script to convert images into bitmaps suitable for SSD1306 OLED displays. The generated bitmap is in C array format and can be used directly in your Arduino or embedded projects.\n\n## Features\n- Converts images to monochrome bitmaps.\n- Outputs the bitmap in a C array format.\n- Configurable threshold for black-and-white conversion.\n\n## Prerequisites\nMake sure you have Python installed along with the following dependencies:\n\n- [Pillow](https://python-pillow.org/) (Python Imaging Library fork)\n\nInstall Pillow using pip:\n```bash\npip install pillow\n```\n\n## Usage\n\n### Command-line Execution\n```bash\npython bitmap_generator.py \u003cimage_path\u003e \u003coutput_file\u003e\n```\n- `\u003cimage_path\u003e`: Path to the input image file.\n- `\u003coutput_file\u003e`: Name of the output file where the bitmap will be saved.\n\n### Interactive Mode\nRun the script without arguments to provide inputs interactively:\n```bash\npython bitmap_generator.py\n```\nYou will be prompted to:\n- Enter the path to the image file.\n- Enter the name of the output file.\n\n## Output Format\nThe output is a C array in the following format:\n```c\nconst uint8_t PROGMEM splash[] = {\n    0b11000000, 0b11110000, // Example bitmap row\n    0b01111000, 0b00011100, // Example bitmap row\n    ...\n};\n```\n- Each `0b` represents a byte in binary form.\n- Rows are padded to ensure byte alignment.\n\n## Example\n### Input Image:\nAn image `example.png`.\n\n### Command:\n```bash\npython bitmap_generator.py example.png output_bitmap.c\n```\n\n### Output (`output_bitmap.c`):\n```c\nconst uint8_t PROGMEM splash[] = {\n    0b11111111, 0b00000000,\n    0b00000001, 0b11111110,\n    0b00001111, 0b11111111,\n    ...\n};\n```\n\n## Additional Options\n- **Threshold Adjustment**: Modify the `threshold` value in the `image_to_bitmap` function to control the black-and-white conversion. Default is `80`.\n\n## Developer Information\n- **Author**: Saurav Sajeev\n- **Purpose**: Developed to simplify the process of generating bitmaps for SSD1306 OLED displays.\n\nFeel free to contribute or report issues to improve this tool!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyropyr0%2Fbitmap-array-generator-from-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyropyr0%2Fbitmap-array-generator-from-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyropyr0%2Fbitmap-array-generator-from-image/lists"}