{"id":13464988,"url":"https://github.com/zouhir/lqip","last_synced_at":"2025-04-12T14:56:04.050Z","repository":{"id":22212081,"uuid":"95290485","full_name":"zouhir/lqip","owner":"zouhir","description":"Low Quality Image Placeholders (LQIP) Module for Node","archived":false,"fork":false,"pushed_at":"2022-02-11T00:20:26.000Z","size":1453,"stargazers_count":436,"open_issues_count":13,"forks_count":30,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T14:11:02.744Z","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-06-24T10:17:56.000Z","updated_at":"2025-04-03T11:58:26.000Z","dependencies_parsed_at":"2022-07-27T03:02:03.458Z","dependency_job_id":null,"html_url":"https://github.com/zouhir/lqip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouhir%2Flqip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zouhir","download_url":"https://codeload.github.com/zouhir/lqip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586244,"owners_count":21128996,"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-07-31T14:00:54.213Z","updated_at":"2025-04-12T14:56:04.025Z","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: Low Quality Images Placeholder\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 lqip\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 from an image:\n\n```js\nconst lqip = require('lqip');\n\nconst file = `./dest/to/file/zouhir-riding-a-bike.jpg`;\n\nlqip.base64(file).then(res =\u003e {\n  console.log(res); // \"data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhY.....\n});\n\n```\n\nGenerating colour palette from an image:\n\n```js\nconst lqip = require('lqip');\n\nconst file = `./dest/to/file/zouhir-riding-a-bike.jpg`;\n\nlqip.palette(file).then(res =\u003e {\n  // the response will be sorted from most dominant colour to least\n  console.log(res); //  [ '#628792', '#bed4d5', '#5d4340', '#ba454d', '#c5dce4', '#551f24' ] \n});\n\n```\n\u003cbr /\u003e\n\u003cp\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/zouhir/lqip/master/_github/api.png\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n##### `lqip.base64(filePath: string)`\n\nThis method accepts an image file path, the file has to be one of those formats ['jpeg', 'jpg', 'png'] and returns a Base64 \nimage string with a valid format and ready to be used in web applications such as in \u003cimg /\u003e tags source or in CSS properties URLs. \n\n##### `lqip.palette(filePath: string)`\n\nThis method accepts an image file path, and returns an colour palette as an array of HEX colour values. The array that is returned\nis sorted from the most to the least dominant colour.  \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 Osmani [link](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-loader for webpack](https://github.com/zouhir/lqip-loader) as well as [lqip-cli](https://github.com/zouhir/lqip-cli).\n\nThanks to contributors and [Colin van Eenige](https://twitter.com/cvaneenige) for his reviews and early testing.\n\nMIT - [Zouhir Chahoud](https://zouhir.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouhir%2Flqip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzouhir%2Flqip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouhir%2Flqip/lists"}