{"id":19381911,"url":"https://github.com/tony-xlh/image-filter","last_synced_at":"2026-02-28T08:36:04.612Z","repository":{"id":225756057,"uuid":"765534400","full_name":"tony-xlh/image-filter","owner":"tony-xlh","description":"A JavaScript library to perform image filtering.","archived":false,"fork":false,"pushed_at":"2025-03-05T03:27:03.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T08:33:14.374Z","etag":null,"topics":["adaptive-thresholding","binarization","grayscale","image-fiter","image-processing","otsu","sepia"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tony-xlh.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-03-01T05:29:16.000Z","updated_at":"2025-06-30T09:16:00.000Z","dependencies_parsed_at":"2024-03-04T06:25:19.764Z","dependency_job_id":"ab1e11d6-7413-4489-83f7-711147d4bc88","html_url":"https://github.com/tony-xlh/image-filter","commit_stats":null,"previous_names":["tony-xlh/image-filter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tony-xlh/image-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony-xlh%2Fimage-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony-xlh%2Fimage-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony-xlh%2Fimage-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony-xlh%2Fimage-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tony-xlh","download_url":"https://codeload.github.com/tony-xlh/image-filter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony-xlh%2Fimage-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29928971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["adaptive-thresholding","binarization","grayscale","image-fiter","image-processing","otsu","sepia"],"created_at":"2024-11-10T09:19:01.169Z","updated_at":"2026-02-28T08:36:04.605Z","avatar_url":"https://github.com/tony-xlh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-filter\n\n![version](https://img.shields.io/npm/v/image-filter-js.svg)\n![downloads](https://img.shields.io/npm/dm/image-filter-js.svg)\n![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/image-filter-js.svg)\n\nA JavaScript library to apply image filtering effects. It can be used to enhance scanned documents images or photos.\n\nOnline demos:\n\n1. [Basic](https://tony-xlh.github.io/image-filter)\n2. [Integration with Dynamsoft Document Viewer](https://tony-xlh.github.io/image-filter/document-viewer.html)\n\n## Install\n\nVia NPM:\n\n```bash\nnpm install image-filter-js\n```\n\nVia CDN:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { ImageFilterHandler, BlackwhiteFilter, InvertFilter, GrayscaleFilter, SepiaFilter } from 'https://cdn.jsdelivr.net/npm/image-filter-js/dist/image-filter.js';\n\u003c/script\u003e\n```\n\n## Usage\n\nProcess an image with the desired effect and save the data onto a Canvas.\n\n```js\nimport { ImageFilterHandler, BlackwhiteFilter, InvertFilter, GrayscaleFilter, SepiaFilter, GaussianBlurFilter } from 'image-filter-js';\nlet cvs = document.createElement(\"canvas\");\nlet grayscaleFilter = new GrayscaleFilter(cvs);\ngrayscaleFilter.process(img);\n```\n\nThere are five filters:\n\n1. Grayscale\n2. Black \u0026 White\n3. Sepia\n4. Invert\n5. Gaussian Blur\n\nThe `BlackwhiteFilter`'s constructor takes several extra arguments.\n\n* threshold: the global threshold\n* enableOTSU: whether to use OTSU to decide the threshold\n* enableAdaptiveThresholding: enable adaptive thresholding to determine the threshold for each pixel based on neighbouring pixels\n* blockSize: the block size for adaptive thresholding\n* C: the constant C to adjust the threshold in adaptive threhsolding\n\n```js\nlet blackwhiteFilter = new BlackwhiteFilter(cvs,threshold,enableOTSU,enableAdaptiveThresholding,blockSize,C);\n```\n\nThe `GaussianBlurFilter`'s constructor takes one extra argument: radius.\n\n## Work with Dynamsoft Document Viewer\n\nThe package can use [Dynamsoft Document Viewer](https://www.dynamsoft.com/document-viewer/docs/introduction/index.html)'s [custom image filter](https://www.dynamsoft.com/document-viewer/docs/features/advanced/imagefilter.html) feature to work as its filter handler so that we can use the package's filters in Dynamsoft Document Viewer.\n\nYou can set it up with the following code:\n\n```js\nlet filterHandler = new ImageFilterHandler();\nDynamsoft.DDV.setProcessingHandler(\"imageFilter\", filterHandler);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-xlh%2Fimage-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony-xlh%2Fimage-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-xlh%2Fimage-filter/lists"}