{"repo":"humaans/next-img","free":true,"listed":false,"github":"https://github.com/humaans/next-img","clone":"git clone https://github.com/humaans/next-img.git","description":"A Next.js plugin for embedding optimized images.","language":"JavaScript","stars":276,"topics":["nextjs","nextjs-plugin","javascript","web","lighthouse-score","jpeg","png","webp"],"license":null,"category":"saas-starters-boilerplates","readme_excerpt":"Build-time image optimization for Next.js. next-img resizes and compresses imported images with Sharp during the build. It emits static files, so it works with static export and does not need an image CDN or runtime optimizer. - Webpack and Turbopack support - responsive JPEG, PNG, WebP, and AVIF output - persistent local cache that can be committed to Git - automatic dimensions and EXIF orientation - responsive preloads and art direction through - TypeScript declarations Install Add the plugin to next.config.js : Import an image and render it: The image is displayed at 375px on small screens and 800px on larger screens. Next-img generates each size at 1x and 2x pixel density, in AVIF, WebP, and JPEG. The browser downloads the best candidate. Image imports Use query parameters to control each image: - sizes=375,800 describes the image's CSS width at each breakpoint. - densities=1x,2x controls which pixel densities to generate for every size. These are the defaults. - formats=avif,webp sets preferred formats. The original format remains the default fallback. - fallbackFormat=jpeg selects a different fallback. - jpeg , png , webp , and avif accept Sharp output options, for example ?jpeg[quality]=70 . Unknown options warn; malformed options fail the build. Set nextImg.strict: true to turn warnings into errors. A bare import keeps its intrinsic dimensions: By default, next-img warns when a bare import is wider or taller than 2048px. Change maxBareImportSize , or set it to false t","default_branch":null,"files":null,"tree":[],"storefront":"/r/humaans","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/humaans/next-img/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}