{"id":36343644,"url":"https://github.com/bertmaurau/php-watermarker","last_synced_at":"2026-01-11T13:00:08.289Z","repository":{"id":62493429,"uuid":"164465113","full_name":"BertMaurau/php-watermarker","owner":"BertMaurau","description":"A simple and basic library to watermark an image using a source-image and a watermark-image. Function can be used as a static caller as well as an initialized function (see example).","archived":false,"fork":false,"pushed_at":"2019-01-08T10:30:50.000Z","size":282,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T14:18:11.506Z","etag":null,"topics":["bertmaurau","image","library","php","source","watermark"],"latest_commit_sha":null,"homepage":"","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/BertMaurau.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}},"created_at":"2019-01-07T17:10:34.000Z","updated_at":"2023-07-03T22:40:33.000Z","dependencies_parsed_at":"2022-11-02T11:30:48.065Z","dependency_job_id":null,"html_url":"https://github.com/BertMaurau/php-watermarker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BertMaurau/php-watermarker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BertMaurau%2Fphp-watermarker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BertMaurau%2Fphp-watermarker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BertMaurau%2Fphp-watermarker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BertMaurau%2Fphp-watermarker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BertMaurau","download_url":"https://codeload.github.com/BertMaurau/php-watermarker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BertMaurau%2Fphp-watermarker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28304263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: 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":["bertmaurau","image","library","php","source","watermark"],"created_at":"2026-01-11T13:00:07.143Z","updated_at":"2026-01-11T13:00:08.223Z","avatar_url":"https://github.com/BertMaurau.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Watermarker\n\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/bertmaurau/php-watermarker/blob/master/LICENSE)\n\nA simple and basic library to watermark an image using a source-image and a watermark-image. Function can be used as a static caller as well as an initialized function (see example).\n\n![Preview](https://github.com/BertMaurau/php-watermarker/blob/master/preview.jpg)\n\n\n\n## Usage\n\n### Installation\n\nVia [Composer](https://getcomposer.org)\n\n```bash\ncomposer require bertmaurau/php-watermarker\n```\n\n### Example\n\n``` php\n\n// example (examples/add-watermark.php)\nuse BertMaurau\\Watermarker;\n\n// the source/original image\n$sourceImage = __DIR__ . DIRECTORY_SEPARATOR . 'source.jpg';\n// the image used as the watermark\n$watermarkImage = __DIR__ . DIRECTORY_SEPARATOR . 'watermark.png';\n\n// available positions\n/*\n * Position:: TOP_LEFT | TOP_CENTER | TOP_RIGHT | CENTER_CENTER | BOTTOM_LEFT | BOTTOM_CENTER | BOTTOM_RIGHT\n */\n\n// available imageTypes\n/*\n * ImageType:: JPEG | BMP | GIF | PNG\n */\n\n// Static method\n/**\n * Function arguments\n * @param string required $sourceImage       The image to put the watermark on\n * @param string required $watermarkImage    The image that you want to use as a watermark\n * @param string optional $outputPath        The path where the generated image should be placed (check your permissions)\n * @param string optional $outputFilename    The filename you want to give the exported file\n * @param string optional $outputExtension   The extension it should have\n * @param string optional $position          The position to put the watermark at\n * @param int optional $outputQuality        The exported quality (Used for .jpg or for compression with .png [1-100])\n */\ntry {\n    Watermarker\\Watermark::AddImageAsWatermark($sourceImage, $watermarkImage, __DIR__, $filename = Watermarker\\Position::CENTER_CENTER, Watermarker\\ImageType::JPEG, Watermarker\\Position::BOTTOM_CENTER, 100);\n} catch (\\Exception $ex) {\n    echo $ex -\u003e getMessage();\n}\n\n// Initialized mathod\ntry {\n    $marker = (new Watermarker\\Watermark)\n            -\u003e setSourceImage($sourceImage)\n            -\u003e setWatermarkImage($watermarkImage)\n            -\u003e setOutputPath(__DIR__)\n            // other setters\n            -\u003e watermark();\n} catch (Exception $ex) {\n    echo $ex -\u003e getMessage();\n}\n\n\n```\n\n\u003e [View all examples](/examples/add-watermark.php).\n\n### Issues\n\n\u003e For bug reporting or code discussions.\n\n## Credits\n\n- [Bert Maurau](https://github.com/bertmaurau)\n\n## License\n\nThe module is licensed under [MIT](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertmaurau%2Fphp-watermarker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertmaurau%2Fphp-watermarker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertmaurau%2Fphp-watermarker/lists"}