{"id":21762815,"url":"https://github.com/visavi/captcha","last_synced_at":"2026-05-20T03:02:52.733Z","repository":{"id":57078315,"uuid":"406936850","full_name":"visavi/captcha","owner":"visavi","description":"Animated captcha","archived":false,"fork":false,"pushed_at":"2022-03-29T20:39:11.000Z","size":426,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T19:48:10.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/visavi.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}},"created_at":"2021-09-15T22:04:58.000Z","updated_at":"2022-03-29T20:37:09.000Z","dependencies_parsed_at":"2022-08-24T14:56:14.556Z","dependency_job_id":null,"html_url":"https://github.com/visavi/captcha","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visavi%2Fcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visavi%2Fcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visavi%2Fcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visavi%2Fcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visavi","download_url":"https://codeload.github.com/visavi/captcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244739940,"owners_count":20501990,"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":"2024-11-26T12:13:14.536Z","updated_at":"2026-05-20T03:02:47.712Z","avatar_url":"https://github.com/visavi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Captcha\n\n[![Latest Stable Version](https://poser.pugx.org/visavi/captcha/v/stable)](https://packagist.org/packages/visavi/captcha)\n[![Total Downloads](https://poser.pugx.org/visavi/captcha/downloads)](https://packagist.org/packages/visavi/captcha)\n[![Latest Unstable Version](https://poser.pugx.org/visavi/captcha/v/unstable)](https://packagist.org/packages/visavi/captcha)\n[![License](https://poser.pugx.org/visavi/captcha/license)](https://packagist.org/packages/visavi/captcha)\n\n## Examples\n\n### Default\n![example1](examples/captcha1.gif)\n![example2](examples/captcha2.gif)\n![example3](examples/captcha3.gif)\n\n### Advanced\n![example4](examples/captcha4.gif)\n![example5](examples/captcha5.gif)\n![example6](examples/captcha6.gif)\n\n### Mini\n![example7](examples/captcha7.gif)\n![example8](examples/captcha8.gif)\n![example9](examples/captcha9.gif)\n\n## Methods\n\n* **getPhrase** - Get phrase\n* **setWidth** - Image width, px (Optional, default 150px)\n* **setHeight** - Image height, px  (Optional, default 40px)\n* **setTextColor** - Text color  (Optional)\n* **setBackgroundColor** - Background color  (Optional)\n* **setFont** - Font path  (Optional)\n* **setWindowWidth** - Window width, px  (Optional, default 75px)\n* **setPixelPerFrame** - Window shift per frame, px  (Optional, default 15px)\n* **setDelayBetweenFrames** - Time between frames, ms)  (Optional, default 20ms)\n\n### Code default\n\n```php\nheader('Content-Type: image/gif');\n\n$captcha = new CaptchaBuilder();\n$_SESSION['captcha'] = $captcha-\u003egetPhrase();\n\nreturn $captcha-\u003erender();\n```\n\n### Code advanced\n\n```php\nheader('Content-Type: image/gif');\n\n$phrase = new PhraseBuilder();\n$phrase = $phrase-\u003egetPhrase(5, '1234567890');\n\n$captcha = new CaptchaBuilder($phrase);\n$captcha\n    -\u003esetWidth(150)\n    -\u003esetHeight(50)\n    -\u003esetTextColor(0, 0, 0)\n    -\u003esetBackgroundColor(255, 255, 255)\n    -\u003esetFont('/path-to-font')\n    -\u003esetWindowWidth(60)\n    -\u003esetPixelPerFrame(15)\n    -\u003esetDelayBetweenFrames(20);\n\n$_SESSION['captcha'] = $captcha-\u003egetPhrase();\n\nreturn $captcha-\u003erender();\n```\n\n## Installation\n\n```\ncomposer require visavi/captcha\n```\n\n## License\n\nThe class is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisavi%2Fcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisavi%2Fcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisavi%2Fcaptcha/lists"}