{"id":16294241,"url":"https://github.com/testica/bitmap-ts","last_synced_at":"2026-05-16T13:06:31.421Z","repository":{"id":79788502,"uuid":"68653805","full_name":"testica/bitmap-ts","owner":"testica","description":"Bitmap loader + transformations + filters in Typescript (RequireJS)","archived":false,"fork":false,"pushed_at":"2018-09-28T14:04:29.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-25T21:28:14.839Z","etag":null,"topics":["bitmap","canvas","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/testica.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":"2016-09-19T23:02:30.000Z","updated_at":"2024-08-03T11:03:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2a50789-a96e-40f6-a69c-882281791501","html_url":"https://github.com/testica/bitmap-ts","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/testica/bitmap-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testica%2Fbitmap-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testica%2Fbitmap-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testica%2Fbitmap-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testica%2Fbitmap-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testica","download_url":"https://codeload.github.com/testica/bitmap-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testica%2Fbitmap-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33103977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bitmap","canvas","typescript"],"created_at":"2024-10-10T20:14:39.480Z","updated_at":"2026-05-16T13:06:31.404Z","avatar_url":"https://github.com/testica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitmap-ts\nLibrary built in [Typescript](https://www.typescriptlang.org/) to load/handle a bitmap file.\nSupport 1, 2, 4, 8, 16(no tested) and 24 bpp.\nThe following functions are available:\n- read(File)\n- negative()\n- rotate90CW()\n- rotate90CCW()\n- rotate180()\n- rotate270CW()\n- rotate270CCW()\n- horizontalFlip()\n- verticalFlip()\n- drawOnCanvas(canvas)\n- drawHistogram(canvas_r, canvas_g, canvas_b, canvas_avg)\n- brightness(value)\n- contrast(value)\n- equalization()\n- umbralization(min, max)\n- saveFile(callback)\n- scale(width, height, 'interpolation|neighbor')\n- drawOnCanvasWithZoom (canvas, zoomValue, 'interpolation|neighbor')\n- rotate(angle)\n- kernel(width, height, customKernel?)\n- blur('box|gauss')\n- edge('prewitt|sobel')\n- outline(boolean)\n- customFilter()\n- undo() : boolean\n- redo() : boolean\n\n### How to use\nI prepared a code to interact with library, you only need to clone the repository, and open `index.html` in **src/views/**, using a modern browser.\nThe same view is located on github repository page, [mentioned in the end of this markdown](#demo).\n\nTo use the library in your own context, only need:\n\nImport in your typescript file the library:\n\n```javascript\nimport {Bitmap} from \"./bitmap\";\n```\n\nCall the constructor and read:\n```javascript\nlet bmp: Bitmap = new Bitmap(file);\n// file is a File Type\nbmp.read(file, (b: Bitmap) =\u003e {\n  // bmp and b is the same instance\n  // The file was read. Now, you can use the functions\n});\n```\nAnd that's all.\n\n##### Drawing on Canvas:\nEvery time that you want to see the changes on your canvas, you have to call `drawOnCanvas(canvas)`\n```javascript\nlet canvas = document.getElementById(\"canvas_id\");\nlet bmp: Bitmap = new Bitmap(file);\nbmp.read(file, (b: Bitmap) =\u003e {\n  b.drawOnCanvas(canvas);\n});\n```\nAlso, is important to specify a size of you canvas:\n```html\n\u003ccanvas id=\"canvas_id\" width=\"500\" height=\"500\"\u003e\n```\n**NOTE: Canvas can be very slow for big files, it is not the best solution to display a bmp file in HTML. Open a issue if found a faster solution.**\n\n##### Drawing Histogram:\nNow is possible draw image's histogram, for the moments you have to pass 4 canvas, the first three are for RED, GREEN and BLUE. The last is the average between 3 channels (R, G, B). If the image is grayscale type, only average histogram will be shown. If is the image has color, R,G,B histograms will be shown.\n### Dependencies\nRequireJS in needed to allow exports and import Bitmap module.\n```html\n\u003cscript data-main=\"../../build/main.js\" src=\"../../lib/require.js\"\u003e\u003c/script\u003e\n```\n\nFileSaver is required, it allows to write a DataView in Blob.\n```html\n\u003cscript src=\"../../lib/FileSaver.min.js\"\u003e\u003c/script\u003e\n```\n### Demo\nVisit [the github repository page](https://testica.github.io/bitmap3-ts/) to see a demo.\n\n----\n**Leonardo Testa \u0026 Carlos Abreu**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestica%2Fbitmap-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestica%2Fbitmap-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestica%2Fbitmap-ts/lists"}