{"id":19473329,"url":"https://github.com/ethercreative/imager-thumbor","last_synced_at":"2025-04-25T12:31:34.449Z","repository":{"id":56979626,"uuid":"207778488","full_name":"ethercreative/imager-thumbor","owner":"ethercreative","description":"Thumbor transformer for Imager","archived":false,"fork":false,"pushed_at":"2019-09-18T10:59:17.000Z","size":47,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T22:02:00.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ethercreative.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-09-11T09:50:36.000Z","updated_at":"2023-12-23T04:59:56.000Z","dependencies_parsed_at":"2022-08-21T10:50:13.793Z","dependency_job_id":null,"html_url":"https://github.com/ethercreative/imager-thumbor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fimager-thumbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fimager-thumbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fimager-thumbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethercreative%2Fimager-thumbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethercreative","download_url":"https://codeload.github.com/ethercreative/imager-thumbor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817693,"owners_count":21492200,"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-10T19:18:11.681Z","updated_at":"2025-04-25T12:31:33.176Z","avatar_url":"https://github.com/ethercreative.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Imager Thumbor\n\nA Thumbor transformer for Imager\n\n## Configuration\n\nConfig options should be added to your `imager-thumbor.php` file in your config \nfolder. To use Thumbor, set the `transformer` option to \"thumbor\" in your \n`imager.php` config file.\n\nWhen setting up Thumbor, we recommend using the \n`thumbor.loaders.file_loader_http_fallback` loader to account for files with and \nwithout public urls (see\n[Image loader](https://thumbor.readthedocs.io/en/latest/image_loader.html).\n\n### domain [string]\n\nThe domain (including port) where Thumbor can be accessed.\n\n### securityKey [string]\n\nThe security key defined in your Thumbor config file. See \n[Security](https://thumbor.readthedocs.io/en/latest/security.html).\n\n### local [bool]\n\nWill store the file locally (or using the remote storage service defined in \nImager's config file), rather than using the Thumbor URL. You will need to \nenable Thumbor's REST endpoint for this to work (see\n[How to upload Images](https://thumbor.readthedocs.io/en/latest/how_to_upload_images.html)).\n\n## Transform Options\n\n### format [string]\n\n*Default: `null`*  \n*Allowed values: `null`, `'jpg'`, `'png'`, `'gif'`, `'webp'`*\n\nFormat of the created image. If unset (default) it will be the same format as \nthe source image.\n\n### trim [bool|string]\n\n*Default: `false`*\n\nRemoving surrounding space in images can be done using the trim option.\n\nUnless specified trim assumes the top-left pixel color and no tolerance (more \non tolerance below).\n\nIf you need to specify the orientation from where to get the pixel color, just \nset the value to `top-left` for the top-left pixel color or `bottom-right` for \nthe bottom-right pixel color.\n\nTrim also supports color tolerance. The euclidian distance between the colors of \nthe reference pixel and the surrounding pixels is used. If the distance is \nwithin the tolerance they’ll get trimmed. For a RGB image the tolerance would \nbe within the range 0-442.\n\n### mode [string]\n\n*Default: `crop`*  \n*Allowed values: `crop`, `fit`, `stretch`*\n\n**`crop`:** Crops the image to the given size, scaling the image to fill as much \nas possible of the size.  \n**`fit`:** Scales the image to fit within the given size while maintaining the \naspect ratio of the original image.  \n**`stretch`:** Scales the image to the given size, stretching it if the aspect \nratio is different from the original.\n\n### width [int|string]\n\nWidth of the image, in pixels. \n\nIf you omit this value or set it to 0, Thumbor will determine that dimension as \nto be proportional to the original image.\n\nSet to `orig` to use the size of the original image. i.e. If the original image\nhas a width of 400px, the new image will also have that width.\n\nA negative value will flip the image. Setting `'-0'` (in quotes) will flip the \nimage without resizing it.\n\n### height [int|string]\n\nHeight of the image, in pixels. \n\nIf you omit this value or set it to 0, Thumbor will determine that dimension as \nto be proportional to the original image.\n\nSet to `orig` to use the size of the original image. i.e. If the original image\nhas a height of 400px, the new image will also have that height.\n\nA negative value will flip the image. Setting `'-0'` (in quotes) will flip the \nimage without resizing it.\n\n### ratio [int|float]\n\nAn aspect ratio (width/height) that is used to calculate the missing size, if\nwidth or height is not provided.\n\n```twig\n{ ratio: 16/9 }\n```\n\n### effects [array]\n\nA keyed array of effects to perform on the image, where the key is the name of \nthe effect and the value contains the arguments for the effect. See \n[Effects](#effects) below.\n\n### position [string|array]\n\nThe position around which to crop. Can be a string containing % locations \n`20% 65%`, or named locations `middle-right`, or an array of x/y decimal \nlocations `['x' =\u003e 0.2, 'y' =\u003e 0.65]`.\n\n### smart [bool]\n\nWill use Thumbor's smart focal point detection when cropping the image.\n\n### upscale [bool]\n\n*Default: `false`*\n\nWill upscale the image to fit the given size if true.\n\n## Effects\n\n### autojpg [bool]\n\nWill convert non-transparent PNG images to JPG when `true`.\n\n### backgroundColor [string]\n\nSets the background layer to the specified color. This is specifically useful \nwhen converting transparent images (PNG) to JPEG.\n\nThe value should be the color name (like in HTML) or hexadecimal rgb expression \nwithout the “#” character (see [Web colors](https://en.wikipedia.org/wiki/Web_colors)\nfor example). If color is `auto`, a color will be smartly chosen (based on the \nimage pixels) to be the filling color.\n\n### blur [int|array]\n\nApplies a gaussian blur to the image.\n\nAccepts a single integer as the `radius` of the blur, or an array matching \n`[radius, sigma]`.\n\n- `radius` is used in the gaussian function to generate a matrix, maximum value\nis 150. The bigger the radius more blurred will be the image.\n- `sigma` is optional and defaults to the same value as the `radius`. Sigma used\nin the gaussian function.\n\n### brightness [int]\n\nIncreases or decreases the image brightness.\n\nAccepts an integer from -100 to 100. The amount (in %) to change the image \nbrightness. Positive numbers make the image brighter and negative numbers make \nthe image darker.\n\n### contrast [int]\n\nIncreases or decreases the image contrast.\n\nAccepts an integer from -100 to 100. The amount (in %) to change the image \ncontrast. Positive numbers increase contrast and negative numbers decrease \ncontrast.\n\n### convolution [array]\n\nRuns a convolution matrix (or kernel) on the image. See \n[Kernel (image processing)](https://en.wikipedia.org/wiki/Kernel_(image_processing)) \nfor details on the process. Edge pixels are always extended outside the image \narea.\n\nAccepts an array of arguments `[matrix_items, number_of_columns, should_normalize]`.\n\n- `matrix_items` Semicolon separated matrix items\n- `number_of_columns` Number of columns in the matrix\n- `should_normalize` Whether or not we should divide each matrix item by the sum\nof all items\n\nExample:\n\n```\n-1 -1 -1\n-1  8 -1\n-1 -1 -1\n```\n\n```twig\n{{ craft.imager.transformImage(img, {\n    effects: {\n        convolution: ['-1;-1;-1;-1;8;-1;-1;-1;-1', 3, false],\n    },\n}) }}\n```\n\n### equalize [bool]\n\nEqualizes the color distribution in the image.\n\n### fill [string|array]\n\nWill return an image sized exactly as requested wherever is its ratio by filling \nwith chosen color the missing parts. Only works when `mode` is set to `fit`.\n\nAccepts a string `color` or an array `[color, fill_transparent]`.\n\n- `color` Accepts:\n  - The color name (like in HTML) or hexadecimal RGB expression without \n  the “#” character (see [Web colors](https://en.wikipedia.org/wiki/Web_colors) \n  for example).\n  - If color is “transparent” and the image format, supports transparency the \n  filling color is transparent.\n  - If color is “auto”, a color is smartly chosen (based on the image pixels) as\n   the filling color.\n  - If color is “blur”, the missing parts are filled with blurred original image. \n- `fill_transparent` Specify whether transparent areas of the image should be \nfilled or not. Accepted values are either true, false, 1 or 0. This argument is \noptional and the default value is false.\n\n### grayscale [bool]\n\nChanges the image to grayscale.\n\n### maxBytes [int]\n\nAutomatically degrades the quality of the image until the image is under the \nspecified amount of bytes.\n\n### noise [int]\n\nAdds noise to the image. Accepts a value between 0 - 100 as the amount (in %) of \nnoise to add to the image.\n\n### proportion [float]\n\nApplies proportion to height and width passed for cropping. Accepts a float \nbetween 0 - 1 as the percentage of the proportion (i.e. 0.5 would scale the \nimage down to 50% after cropping).\n\n### quality [int]\n\nSet the overall quality of a JPEG image (does nothing for PNGs or GIFs). Expects\na value between 0 - 100 as the quality level (in %).\n\n### rgb [array]\n\nWill change the amount of color in each of the three channels.\n\nAccepts an array of RGB values `[r, g, b]` ranging from -100 to 100.\n\n### rotate [int]\n\nRotate the given image according to the angle value passed. Should be set to an \nangle between 0 - 359. Numbers greater or equal than 360 will be transformed to \na equivalent angle between 0 and 359.\n\n### sharpen [array]\n\nEnhances apparent sharpness of the image. It’s heavily based on Marco Rossini’s \nexcellent Wavelet sharpen GIMP plugin.\n\nAccepts an array with the following values:\n`[sharpen_amount, sharpen_radius, luminance_only]`\n\n- `sharpen_amount` - Sharpen amount. Typical values are between 0.0 and 10.0.\n- `sharpen_radius` - Sharpen radius. Typical values are between 0.0 and 2.0.\n- `luminance_only` - Sharpen only luminance channel. Values can be `true` or `false`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethercreative%2Fimager-thumbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethercreative%2Fimager-thumbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethercreative%2Fimager-thumbor/lists"}