{"id":17275128,"url":"https://github.com/daun/processwire-image-placeholders","last_synced_at":"2025-04-14T09:13:09.179Z","repository":{"id":200716517,"uuid":"706122256","full_name":"daun/processwire-image-placeholders","owner":"daun","description":"A ProcessWire module to generate low-quality image placeholders (LQIP) for smoother lazyloading","archived":false,"fork":false,"pushed_at":"2024-11-01T11:27:39.000Z","size":1013,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T22:37:23.603Z","etag":null,"topics":["blurhash","image","image-placeholder","lazyload","lqip","processwire","thumbhash"],"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/daun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-17T10:50:18.000Z","updated_at":"2025-02-26T09:35:54.000Z","dependencies_parsed_at":"2023-10-20T12:56:39.621Z","dependency_job_id":null,"html_url":"https://github.com/daun/processwire-image-placeholders","commit_stats":null,"previous_names":["daun/processwire-image-placeholders"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fprocesswire-image-placeholders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fprocesswire-image-placeholders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fprocesswire-image-placeholders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fprocesswire-image-placeholders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daun","download_url":"https://codeload.github.com/daun/processwire-image-placeholders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844000,"owners_count":21170499,"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":["blurhash","image","image-placeholder","lazyload","lqip","processwire","thumbhash"],"created_at":"2024-10-15T08:55:29.304Z","updated_at":"2025-04-14T09:13:09.142Z","avatar_url":"https://github.com/daun.png","language":"PHP","readme":"# ProcessWire Image Placeholders\n\n**A ProcessWire module to generate image placeholders for smoother lazyloading.**\n\nSupports [ThumbHash](https://evanw.github.io/thumbhash/), [BlurHash](https://blurha.sh/), and\naverage color placeholders.\n\n![Example image placeholders](assets/example-placeholder.png)\n\n## Why use image placeholders?\n\nLow-Quality Image Placeholders (LQIP) are used to improve the perceived performance of sites by\ndisplaying a **small, low-quality version of an image** while the high-quality version is being loaded.\nThe LQIP technique is often used in combination with progressive lazyloading.\n\n## How it works\n\nThis module will automatically generate a small blurry image placeholder for each image that is\nuploaded to fields configured to use them. In your frontend templates, you can access the image\nplaceholder as a data URI string to display while the high-quality image is loading.\nSee below for markup examples.\n\n## Placeholder types\n\nThe module supports generating various types of image placeholders. The recommended type is\n`ThumbHash` which encodes most detail and supports transparent images.\n\n### ThumbHash\n\n[ThumbHash](https://evanw.github.io/thumbhash/) is a newer image placeholder algorithm with improved\ncolor rendering and support for transparency.\n\n### BlurHash\n\n[BlurHash](https://blurha.sh/) is the original placeholder algorithm, developed at Wolt. It\ncurrently has no support for alpha channels and will render transparency in black.\n\n### Average color\n\nCalculates the average color of the image.\n\n## Installation\n\nInstall the module using composer from the root of your ProcessWire installation.\n\n```sh\ncomposer require daun/processwire-image-placeholders\n```\n\nOpen the admin panel of your site and navigate to `Modules` → `Site` → `ImagePlaceholders` to finish installation.\n\n## Configuration\n\nYou'll need to configure your image fields to generate image placeholders.\n\n`Setup` → `Fields` → `[images]` → `Details` → `Image placeholders`\n\nThere, you can choose the type of placeholder to generate. If you're installing the module on an\nexisting site, you can also choose to batch-generate placeholders for any existing images.\n\n![Field settings dialog](assets/field-settings.png)\n\n## Usage\n\nAccessing an image's `lqip` property will return a data URI string of its placeholder.\n\n```php\n$page-\u003eimage-\u003elqip; // data:image/png;base64,R0lGODlhEAAQAMQAA\n```\n\nAccessing it as a method allows setting a custom width and/or height of the placeholder.\n\n```php\n$page-\u003eimage-\u003elqip(300, 200); // 300x200px\n```\n\n### Markup\n\nUsing a lazyload library like [lazysizes](https://github.com/aFarkas/lazysizes) or\n[vanilla-lazyload](https://github.com/verlok/vanilla-lazyload), you can show a\nplaceholder image by using its data URI as `src` of the image.\n\n```html\n\u003c!-- Using the placeholder as src while lazyloading the image --\u003e\n\u003cimg\n  src=\"\u003c?= $page-\u003eimage-\u003elqip ?\u003e\"\n  data-src=\"\u003c?= $page-\u003eimage-\u003eurl ?\u003e\"\n  data-lazyload\n/\u003e\n```\n\nAnother technique is rendering the placeholder and the original image as separate images on top of\neach other. This allows smoother animations between the blurry unloaded and the final loaded state.\n\n```html\n\u003c!-- Display placeholder and image on top of each other --\u003e\n\u003cdiv class=\"ratio-box\"\u003e\n  \u003cimg src=\"\u003c?= $page-\u003eimage-\u003elqip ?\u003e\" aria-hidden=\"true\"\u003e\n  \u003cimg data-src=\"\u003c?= $page-\u003eimage-\u003eurl ?\u003e\" data-lazyload\u003e\n\u003c/div\u003e\n```\n\n## Support\n\nPlease [open an issue](https://github.com/daun/processwire-image-placeholders/issues/new) for support.\n\n## Credits\n\nBlue Tomato's deprecated [ImageBlurhash](https://github.com/blue-tomato/ImageBlurhash) module\ninspired and set the standard for this module.\n\n## License\n\n[MIT](./LICENCE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fprocesswire-image-placeholders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaun%2Fprocesswire-image-placeholders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fprocesswire-image-placeholders/lists"}