{"id":20651749,"url":"https://github.com/gevorgmansuryan/azure-thumbnails","last_synced_at":"2025-04-17T14:21:02.036Z","repository":{"id":62510380,"uuid":"85401758","full_name":"gevorgmansuryan/azure-thumbnails","owner":"gevorgmansuryan","description":"Create image thumbnails with help of AI, and show what needed! After uploading an image, a high quality thumbnail gets generated and the algorithm analyzes the objects within the image, then crops it to fit the requirements of the “region of interest” (ROI).","archived":false,"fork":false,"pushed_at":"2017-03-24T21:53:29.000Z","size":11,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:11:24.510Z","etag":null,"topics":["artificial-intelligence","azure","crop","image-cropper","image-resizer","image-thumbnails","roi","thumbnails"],"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/gevorgmansuryan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-18T13:05:33.000Z","updated_at":"2024-04-09T11:24:29.000Z","dependencies_parsed_at":"2022-11-02T12:46:43.838Z","dependency_job_id":null,"html_url":"https://github.com/gevorgmansuryan/azure-thumbnails","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2Fazure-thumbnails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2Fazure-thumbnails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2Fazure-thumbnails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gevorgmansuryan%2Fazure-thumbnails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gevorgmansuryan","download_url":"https://codeload.github.com/gevorgmansuryan/azure-thumbnails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249347765,"owners_count":21255189,"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":["artificial-intelligence","azure","crop","image-cropper","image-resizer","image-thumbnails","roi","thumbnails"],"created_at":"2024-11-16T17:29:22.669Z","updated_at":"2025-04-17T14:21:02.000Z","avatar_url":"https://github.com/gevorgmansuryan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Thumbnails\n\n[![Latest Stable Version](https://poser.pugx.org/gevman/azure-thumbnails/v/stable?format=flat-square)](https://packagist.org/packages/gevman/azure-thumbnails)\n[![Latest Unstable Version](https://poser.pugx.org/gevman/azure-thumbnails/v/unstable?format=flat-square)](https://packagist.org/packages/gevman/azure-thumbnails)\n[![License](https://poser.pugx.org/gevman/azure-thumbnails/license?format=flat-square)](https://packagist.org/packages/gevman/azure-thumbnails)\n\nCreate image thumbnails with help of Microsoft Artificial Intelligence, and show what needed!\n\nA thumbnail is a small representation of a full-size image. Varied devices such as phones, tablets, and PCs create a need for different user experience (UX) layouts and thumbnail sizes. Using smart cropping, this Computer Vision API feature helps solve the problem.\n\nAfter uploading an image, a high quality thumbnail gets generated and the Computer Vision API algorithm analyzes the objects within the image, then crops it to fit the requirements of the “region of interest” (ROI). The output gets displayed within a special framework as seen in below illustration. The generated thumbnail can be presented in a different aspect ratio than that of the original image to accommodate a user’s needs.\n\nThe thumbnail algorithm works as follows:\n\n- Removes distracting elements from the image and recognizes the main object, the “region of interest” (ROI).\n- Crops the image based on identified “region of interest”.\n- Changes the aspect ratio to fit the target thumbnail dimensions.\n\n\n![gevman/azure-thumbnails](http://i.imgur.com/Y2hI8D8.png)\n\n## Installation (using composer)\n\n```bash\ncomposer require gevman/azure-thumbnails\n```\n\n### Methods\n\n##### thumbnail(string $image, int $width, int $height)\n###### Create thumbnail\n- `$image` - full path of image\n- `$width` - thumbnail width\n- `$height` - thumbnail height\n\n##### saveAs(string $file \\[, int $quality = 99\\])\n###### Save thumbnail to specified path\n- `$file` - full path of thumbnail\n- `$quality` - thumbnail quality\n\n\n##### show(\\[int $quality = 99\\]\\[, string $contentType = 'image/jpeg'\\])\n###### Show thumbnail\n- `$quality` - thumbnail quality\n- `$contentType` - Content-Type header\n\n\n### Example of usage\n\n###### Get your `Computer Vision API key` from [Microsoft Azure](https://portal.azure.com/#create/Microsoft.CognitiveServices/apitype/ComputerVision)\n\n```php\nrequire '../vendor/autoload.php';\n\n$generator = new \\Gevman\\Thumbnails\\Generator('{Computer Vision API key}');\n\n$thumb = $generator-\u003ethumbnail('/full/path/to/original.jpg', 1000, 500);\n\n//will save thumbnail to specified path\n$thumb-\u003esaveAs('/full/path/to/thumbnail.jpg', 100);\n\n//will show thumbnail\n$thumb-\u003eshow();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgevorgmansuryan%2Fazure-thumbnails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgevorgmansuryan%2Fazure-thumbnails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgevorgmansuryan%2Fazure-thumbnails/lists"}