{"id":44666343,"url":"https://github.com/abordage/og-images","last_synced_at":"2026-02-15T00:35:00.900Z","repository":{"id":38358077,"uuid":"496640929","full_name":"abordage/og-images","owner":"abordage","description":"Create eye-catching Open Graph images for each (or some) site pages","archived":false,"fork":false,"pushed_at":"2024-07-08T11:30:15.000Z","size":641,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-09T23:04:16.727Z","etag":null,"topics":["og-image","open-graph","twitter-image"],"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/abordage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-05-26T13:56:50.000Z","updated_at":"2024-07-08T11:30:12.000Z","dependencies_parsed_at":"2024-04-29T13:02:19.719Z","dependency_job_id":null,"html_url":"https://github.com/abordage/og-images","commit_stats":{"total_commits":64,"total_committers":4,"mean_commits":16.0,"dds":0.5625,"last_synced_commit":"ff1c3304d0b44bcdcac61bbeaa8ef1b92a533e2b"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/abordage/og-images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abordage%2Fog-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abordage%2Fog-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abordage%2Fog-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abordage%2Fog-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abordage","download_url":"https://codeload.github.com/abordage/og-images/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abordage%2Fog-images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29461912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T22:42:09.113Z","status":"ssl_error","status_checked_at":"2026-02-14T22:42:05.053Z","response_time":53,"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":["og-image","open-graph","twitter-image"],"created_at":"2026-02-15T00:34:57.944Z","updated_at":"2026-02-15T00:35:00.893Z","avatar_url":"https://github.com/abordage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--suppress HtmlDeprecatedAttribute --\u003e\n\n# Open Graph Images Generator\n\nCreate Open Graph images (og:image, twitter:image, vk:image) for each (or some) site pages.\n\n\u003cp style=\"text-align: center;\" align=\"center\"\u003e\n\u003ca href=\"https://github.com/abordage/og-images/blob/master/docs/examples.md\" title=\"Open Graph Images Generator\"\u003e\n    \u003cimg alt=\"Open Graph Images Generator\" src=\"https://github.com/abordage/og-images/blob/master/docs/images/default-og-image-830x435.png?raw=true\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp style=\"text-align: center;\" align=\"center\"\u003e\n\n\u003ca href=\"https://packagist.org/packages/abordage/og-images\" title=\"Packagist version\"\u003e\n    \u003cimg alt=\"Packagist Version\" src=\"https://img.shields.io/packagist/v/abordage/og-images\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/abordage/og-images/actions/workflows/tests.yml\" title=\"GitHub Tests Status\"\u003e\n    \u003cimg alt=\"GitHub Tests Status\" src=\"https://img.shields.io/github/actions/workflow/status/abordage/og-images/tests.yml?label=tests\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/abordage/og-images/actions/workflows/php-cs-fixer.yml\" title=\"GitHub Code Style Status\"\u003e\n    \u003cimg alt=\"GitHub Code Style Status\" src=\"https://img.shields.io/github/actions/workflow/status/abordage/og-images/php-cs-fixer.yml?label=code%20style\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://www.php.net/\" title=\"PHP version\"\u003e\n    \u003cimg alt=\"Packagist PHP Version Support\" src=\"https://img.shields.io/packagist/php-v/abordage/og-images\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://github.com/abordage/og-images/blob/master/LICENSE.md\" title=\"License\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/abordage/og-images\"\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\nUse page title to create an eye-catching page preview when users share the link on social networks or instant\nmessengers. [Learn more](https://ogp.me) about Open Graph.\n\n## Features:\n\n- Image generation with your text and site name\n- Fully customizable (see [configuration](#configuration))\n- Small image size (15-50 Kb) with high resolution and quality ([check it](./docs/examples.md))\n- Aspect ratios [presets](#images-aspect-ratios) for popular social networks\n\n[▶ **See examples**](./docs/examples.md)\n\n## Requirements\n\n- PHP 7.4 - 8.3\n- The Imagick PHP extension\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require abordage/og-images\n```\n\n\u003e 💡 Using **Laravel**? Check out [abordage/laravel-og-images](https://github.com/abordage/laravel-og-images)\n\n## Quick start\n\n```php\nuse Abordage\\OpenGraphImages\\OpenGraphImages;\n\nrequire __DIR__ . ' /vendor/autoload.php';\n\n$config = ['app_name' =\u003e 'alice.wonderland'];\n$text = 'The adventures first, explanations take such a dreadful time!';\n$path = __DIR__ . '/your-name-for-image.png';\n\n$openGraphImage = new OpenGraphImages($config);\n$openGraphImage-\u003emake($text)-\u003esave($path);\n```\n\n\u003e **Note**  \n\u003e All images are encoded in `PNG` format as it provides the best ratio between size/quality. For the same reason, the\n\u003e package uses the `Imagick` driver - in tests, it showed an advantage in speed and final size of the generated images.\n\n## Usage\n\n```php\n$openGraphImage = new OpenGraphImages($config);\n\n// for \u003cog:image\u003e\n$openGraphImage-\u003emake($text)-\u003esave($path);\n// or\n$openGraphImage-\u003emake($text, 'opengraph')-\u003esave($path);\n\n// for \u003ctwitter:image\u003e\n$openGraphImage-\u003emake($text, 'twitter')-\u003esave($path);\n\n// for \u003cvk:image\u003e\n$openGraphImage-\u003emake($text, 'vk')-\u003esave($path);\n\n// custom size\n$openGraphImage-\u003emakeCustom($text, 600, 400)-\u003esave($path);\n```\n\nAfter generation, you need to somehow organize the relationship of images with a specific page (for example, attach to a\nmodel). If you already have a solution ready to accept an image and attach it to a specific page, you can get the image\nas a string instead of saving it:\n\n```php\n$openGraphImage = new OpenGraphImages($config);\n$imageBlob = $openGraphImage-\u003emake($text)-\u003eget();\n```\n\nIf after generation you need to get sizes of the image, you can get it as follows:\n\n```php\n$openGraphImage-\u003emake($text, 'twitter')-\u003eget();\n$imageSizes = $openGraphImage-\u003egetImageSizes();\n// return [\n//    'width' =\u003e 1200,\n//    'height' =\u003e 600\n// ];\n```\n\n## Configuration\n\n```php\n$config = [\n    /*\n    |--------------------------------------------------------------------------\n    | Background Color\n    |--------------------------------------------------------------------------\n    |\n    | Supported: HEX, RGB or RGBA format\n    |\n    */\n    'background_color' =\u003e '#474761',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Text Color\n    |--------------------------------------------------------------------------\n    |\n    | Supported: HEX, RGB or RGBA format\n    |\n    */\n    'text_color' =\u003e '#eee',\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name\n    |--------------------------------------------------------------------------\n    |\n    | Set null to disable\n    |\n    | Supported: string or null\n    |\n    */\n    'app_name' =\u003e null,\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Text Color\n    |--------------------------------------------------------------------------\n    |\n    | Supported: HEX, RGB or RGBA format\n    |\n    */\n    'app_name_color' =\u003e '#eee',\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Decoration Color\n    |--------------------------------------------------------------------------\n    |\n    | Supported: HEX, RGB or RGBA format\n    |\n    */\n    'app_name_decoration_color' =\u003e '#fb3361',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Text Alignment\n    |--------------------------------------------------------------------------\n    |\n    | Multiline text alignment\n    |\n    | Supported: \"left\", \"center\", \"right\"\n    |\n    */\n    'text_alignment' =\u003e 'left',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Text Sticky\n    |--------------------------------------------------------------------------\n    |\n    | Supported: \"left\", \"center\", \"right\"\n    |\n    */\n    'text_sticky' =\u003e 'center',\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Position\n    |--------------------------------------------------------------------------\n    |\n    | Supported: \"top-left\", \"top-center\", \"top-right\",\n    |            \"bottom-left\", \"bottom-center\", \"bottom-right\"\n    |\n    */\n    'app_name_position' =\u003e 'bottom-center',\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Decoration Style\n    |--------------------------------------------------------------------------\n    |\n    | Set null to disable\n    |\n    | Supported: \"line\", \"label\", \"rectangle\", null\n    |\n    */\n    'app_name_decoration_style' =\u003e 'line',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Font Size\n    |--------------------------------------------------------------------------\n    |\n    */\n    'font_size' =\u003e 55,\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Font Size\n    |--------------------------------------------------------------------------\n    |\n    */\n    'app_name_font_size' =\u003e 30,\n\n    /*\n    |--------------------------------------------------------------------------\n    | Text Font\n    |--------------------------------------------------------------------------\n    |\n    | If set null, will be used Preset Font (Roboto Regular)\n    |\n    | Supported: \"absolute/path/to/your/font.ttf\", null\n    |\n    */\n    'font_path' =\u003e null,\n\n    /*\n    |--------------------------------------------------------------------------\n    | App Name Font\n    |--------------------------------------------------------------------------\n    |\n    | If set null, will be used Preset Font (Roboto Medium)\n    |\n    | Supported: \"absolute/path/to/your/font.ttf\", null\n    |\n    */\n    'app_name_font_path' =\u003e null,\n];\n```\n\n## API Reference\n\n| Method                                              | Returns | Added in | Changed in |\n|-----------------------------------------------------|:-------:|:--------:|:----------:|\n| `make(string $text, string $preset = 'opengraph')`  |  self   |  0.1.0   |   0.2.0    |\n| `makeCustom(string $text, int $width, int $height)` |  self   |  0.2.0   |     -      |\n| `get()`                                             | string  |  0.1.0   |     -      |\n| `save(string $path)`                                | boolean |  0.1.0   |     -      |\n| `getImageSizes()`                                   |  array  |  0.3.0   |     -      |\n\n### Images aspect ratios\n\n| Preset                            | Aspect ratios       |     Docs      |\n|-----------------------------------|:--------------------|:-------------:|\n| `make(string $text)`              | 1200 x 630 (1.91:1) |               |\n| `make(string $text, 'opengraph')` | 1200 x 630 (1.91:1) |               |\n| `make(string $text, 'facebook')`  | 1200 x 630 (1.91:1) |   [fb][fb]    |\n| `make(string $text, 'twitter')`   | 1200 x 600 (2:1)    | [twitter][tw] |\n| `make(string $text, 'vk')`        | 1200 x 536 (2.2:1)  |   [vk][vk]    |\n\n[fb]: https://developers.facebook.com/docs/sharing/webmasters/images/\n\n[tw]: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image\n\n[vk]: https://dev.vk.com/api/posts\n\n## Roadmap\n\nAdd ability to use gradients and images for the background.\n\n## Testing\n\nRun all tests\n\n```bash\ncomposer test:all\n```\n\nor\n\n```bash\ncomposer test:phpunit\ncomposer test:phpstan\ncomposer test:phpcs\n```\n\nor see https://github.com/abordage/og-images/actions/workflows/tests.yml\n\n## Feedback\n\nFind a bug or have a feature request? Open an issue, or better yet, submit a pull request - contribution welcome!\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/abordage/.github/blob/master/CONTRIBUTING.md) for details.\n\n## Credits\n\n- Pavel Bychko ([abordage](https://github.com/abordage))\n- [All Contributors](https://github.com/abordage/og-images/graphs/contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabordage%2Fog-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabordage%2Fog-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabordage%2Fog-images/lists"}