{"id":13547873,"url":"https://github.com/zouhir/lqip-loader","last_synced_at":"2025-04-14T08:55:12.744Z","repository":{"id":49774566,"uuid":"92290306","full_name":"zouhir/lqip-loader","owner":"zouhir","description":"Low Quality Image Placeholders (LQIP) for Webpack","archived":false,"fork":false,"pushed_at":"2022-12-29T03:51:42.000Z","size":357,"stargazers_count":1212,"open_issues_count":8,"forks_count":43,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-07T01:09:24.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zouhir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-24T12:32:35.000Z","updated_at":"2025-04-01T18:28:23.000Z","dependencies_parsed_at":"2023-01-31T08:00:48.236Z","dependency_job_id":null,"html_url":"https://github.com/zouhir/lqip-loader","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/zouhir%2Flqip-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zouhir","download_url":"https://codeload.github.com/zouhir/lqip-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852109,"owners_count":21171839,"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-08-01T12:01:02.458Z","updated_at":"2025-04-14T08:55:12.710Z","avatar_url":"https://github.com/zouhir.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/logo.png\" width=\"508\"\u003e\n\u003c/p\u003e\n\n\u003ch4 align=\"center\"\u003elqip-loader: low quality images placeholders for webpack\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca align=\"center\" href=\"https://lqip-loader.firebaseapp.com/\"\u003edemo\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/installation.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n```\nnpm install --save-dev lqip-loader\n```\n\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/example.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\nGenerating Base64 \u0026 dominant colours palette for a jpeg image imported in your JS bundle:\n\nPS: The large image file will be emitted \u0026 only 400byte of Base64 (if set to true in the loader options) will be bundled.\n\nwebpack.config.js:\n```js\n{\n  /**\n   * OPTION A:\n   * default file-loader fallback\n   **/\n  test: /\\.jpe?g$/,\n  loaders: [\n    {\n      loader: 'lqip-loader',\n      options: {\n        path: '/media', // your image going to be in media folder in the output dir\n        name: '[name].[ext]', // you can use [hash].[ext] too if you wish,\n        base64: true, // default: true, gives the base64 encoded image\n        palette: true // default: false, gives the dominant colours palette\n      }\n    }\n  ]\n\n  /**\n   * OPTION B:\n   * Chained with your own url-loader or file-loader\n   **/\n  test: /\\.(png|jpe?g)$/,\n  loaders: [\n    {\n      loader: 'lqip-loader',\n      options: {\n        base64: true,\n        palette: false\n      }\n    },\n    {\n      loader: 'url-loader',\n      options: {\n        limit: 8000\n      }\n    }\n  ]\n}\n```\n\nyour-app-module.js:\n```js\nimport banner from './images/banner.jpg';\n\nconsole.log(banner.preSrc);\n// outputs: \"data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhY.... \n\n// the object will have palette property, array will be sorted from most dominant colour to the least\nconsole.log(banner.palette) // [ '#628792', '#bed4d5', '#5d4340', '#ba454d', '#c5dce4', '#551f24' ]\n \nconsole.log(banner.src) // that's the original image URL to load later!\n\n```\n\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://github.com/zouhir/lqip/blob/master/_github/important.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\nTo save memory and improve GPU performance, browsers (including Chrome started from 61.0.3163.38) will now render a \nslightly more crisp or pixelated Base64 encoded images.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/5052316/31105257-7986782c-a82e-11e7-972b-cabcf97f13c0.png\" width=\"500px\" /\u003e\n  \u003cbr /\u003e\n  Older Chrome to the left, Chrome v61 to the right.\n\u003c/p\u003e\n\nIf you want the blur to be smooth really bad, here's a fix! \n```css\nimg {\n  filter: blur(25px);\n}\n```\n\nMore history about the issue can be [found here](https://bugs.chromium.org/p/chromium/issues/detail?id=771110#c3) and [here](https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/6L_3ZZeuA0M).\n\nalternatively, you can fill the container with a really cheap colour or gradient from the amazing palette we provide.\n\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/inspo.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n- [Medium web app](https://medium.com/cucumbertown-magazine/the-beginners-guide-to-composition-in-food-photography-how-to-transform-your-food-photos-from-good-39613ab78bf2)\n- [Instagram native mobile app](https://www.instagram.com/)\n- [Polymer shop project](https://shop.polymer-project.org/)\n\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://github.com/zouhir/lqip/blob/master/_github/mentions.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n- Essential Image Optimization, An [eBook by Addy Osmany](https://images.guide/)\n\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/creds.png\" width=\"100%\" /\u003e\n\u003c/p\u003e \n\nRelated projects to this would be [lqip module for Node](https://github.com/zouhir/lqip) as well as [lqip-cli](https://github.com/zouhir/lqip-cli).\n\nThanks to [Colin van Eenige](https://twitter.com/cvaneenige) for his reviewing and early testing.\n\nMIT - [Zouhir Chahoud](https://zouhir.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouhir%2Flqip-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzouhir%2Flqip-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouhir%2Flqip-loader/lists"}