{"id":26796402,"url":"https://github.com/peterujah/nano-stamp","last_synced_at":"2025-03-29T18:18:37.240Z","repository":{"id":191016110,"uuid":"683771867","full_name":"peterujah/nano-stamp","owner":"peterujah","description":"Nano Stamp is Php Class to create a custom stamp using the GD Graphics Library. It simplifies the process of generating stamps, such as circular and square designs, accompanied by dynamic text and styling.","archived":false,"fork":false,"pushed_at":"2023-08-28T06:59:19.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T07:43:56.989Z","etag":null,"topics":["php","phpclass","png","stamp"],"latest_commit_sha":null,"homepage":"https://github.com/peterujah/nano-stamp/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterujah.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}},"created_at":"2023-08-27T16:45:33.000Z","updated_at":"2023-08-27T17:36:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f200daad-6a8e-4e4d-91d6-4eba719cfd32","html_url":"https://github.com/peterujah/nano-stamp","commit_stats":null,"previous_names":["peterujah/nanostamp"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Fnano-stamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Fnano-stamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Fnano-stamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterujah%2Fnano-stamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterujah","download_url":"https://codeload.github.com/peterujah/nano-stamp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246223304,"owners_count":20743168,"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":["php","phpclass","png","stamp"],"created_at":"2025-03-29T18:18:36.802Z","updated_at":"2025-03-29T18:18:37.235Z","avatar_url":"https://github.com/peterujah.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nano Stamp\nNano Stamp is Php Class to create a custom stamp using the GD Graphics Library. It simplifies the process of generating stamps, such as circular and square designs, accompanied by dynamic text and styling.\n\n\n## Installation\n\nInstallation is available via Composer:\n```md\ncomposer require peterujah/nano-stamp\n```\n\n## Example Stamp\n\n\u003cimg src=\"https://raw.githubusercontent.com/peterujah/nano-stamp/main/test/stamp_circle.png\" alt=\"image 1\" width=\"250\" /\u003e\u003cimg src=\"https://raw.githubusercontent.com/peterujah/nano-stamp/main/test/stamp_circle_vertical.png\" alt=\"image 2\" width=\"250\" /\u003e\u003cimg src=\"https://raw.githubusercontent.com/peterujah/nano-stamp/main/test/stamp_square.png\" alt=\"image 3\" width=\"250\" /\u003e\n\n\n## Initialize class\n\n```php\nuse Peterujah\\NanoBlockTech\\Stamp\\Circle;\nuse Peterujah\\NanoBlockTech\\Stamp\\Square;\nuse Peterujah\\NanoBlockTech\\Stamp\\Colors;\nuse Peterujah\\NanoBlockTech\\Stamp\\Stamp;\n```\n\nTo draw a square stamp initialize with a square instance \n```php\n$shape = new Stamp(new Square(400, 200));\n```\nTo draw a round stamp initialize with a circle instance \n```php \n$shape = new Stamp(new Circle(400, 400));\n```\nUse your stamp shape container instance \n```php\n$stamp = $shape-\u003egetContainerInstance();\n```\nSet your text font path \n```php\n$stamp-\u003esetFont(__DIR__ . '/font/industry-bold.ttf');\n```\nSet your background color or use the default transparent background \n```php \n$stamp-\u003esetBackgroundColor(Colors::ALPHA_WHITE);\n```\n\nDrow your border with RGB color array\n```php\n$stamp-\u003edrawBorder(Colors::VIOLET);\n```\n\n### For Square Shape Stamp\nAdjust the `right` and `top` to fit your text \n\n```php\n$stamp-\u003edrawCenterText(\"My Company Name Here\",[\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"right\" =\u003e 125,\n    \"top\" =\u003e -30,\n]); \n$stamp-\u003edrawCenterText(\"27 Aug 2023\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"right\" =\u003e 80,\n    \"top\" =\u003e 30,\n]);\n$stamp-\u003edrawCenterText(\"Verified Stamp\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"right\" =\u003e 80,\n    \"top\" =\u003e 90,\n]);\n\n$stamp-\u003edrawRightText(\"Vertical\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 110,\n    \"right\" =\u003e 55,\n]);\n\n$stamp-\u003edrawLeftText(\"27 Aug 2023\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 170,\n    \"left\" =\u003e 230,\n]);\n```\n\n\n\n\n### For Circle Shape Stamp\nAdjust the `left` and `top` to fit your text \n\nDrow round text \n```php\n$stamp-\u003edrawRoundText(\"Round Text Here\", 20, Colors::VIOLET, true);\n```\nDrow a center text\n```php\n$stamp-\u003edrawCenterText(\"Horizontal Text Here\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 200,\n    \"left\" =\u003e 60,\n]);\n$stamp-\u003edrawCenterText(\"27 Aug 2023\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 250,\n    \"left\" =\u003e 60,\n]);\n```\n\nTo draw a vertical center text only available for circle shape stamp\n```php\n$stamp-\u003edrawVerticalText(\"Vertical Text Here\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 220,\n    \"left\" =\u003e 10,\n]);\n$stamp-\u003edrawVerticalText(\"27 Aug 2023\", [\n    \"fontSize\" =\u003e 20,\n    \"color\" =\u003e Colors::VIOLET,\n    \"top\" =\u003e 170,\n    \"left\" =\u003e 15,\n]);\n```\n\nNow save, download or preview generated stamp \nFlag `D = Download, S = Save, I = Display `\n```php\n$stamp-\u003ecreate('stamp_image.png', \"S\");\n```\n\n### More Methods \n\nTo add an image overlay \n\n```php\n$stamp-\u003edrawCenterImage(__DIR__ . \"/company-logo.png\", [\n    \"top\" =\u003e 0,\n    \"left\" =\u003e 0,\n    \"width\" =\u003e 50,\n    \"height\" =\u003e 50\n]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterujah%2Fnano-stamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterujah%2Fnano-stamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterujah%2Fnano-stamp/lists"}