How to reduce image size?
Answered
American black bear posted this in #help-forum
American black bearOP
The lighthouse indicates that my main image has a lot of content. How can I avoid this becoming a problem?
Code:
Code:
<Image src="/logo.webp" alt="LottoBillions" width={267} height={69} />
Answered by Pearls
Thats odd, well theres always other ways of optimizing images.
Heres the documentation for it:
https://nextjs.org/docs/app/building-your-application/optimizing/images
You can also image minifiers, or compressors, there are plently of them on the internet.
Heres the documentation for it:
https://nextjs.org/docs/app/building-your-application/optimizing/images
You can also image minifiers, or compressors, there are plently of them on the internet.
17 Replies
American black bearOP
if I add lazy load it says "Largest Contentful Paint image was lazily loaded"
so i have no idea... 😦
Theres an option especially for that, its called 'priority'
when this option is set to 'true' it will be considered a 'high' priority image.
heres a more detailed explaination:
https://nextjs.org/docs/app/api-reference/components/image#priority
Example:
when this option is set to 'true' it will be considered a 'high' priority image.
heres a more detailed explaination:
https://nextjs.org/docs/app/api-reference/components/image#priority
Example:
<Image src="/logo.webp" alt="LottoBillions" width={267} height={69} priority={true} />
@Pearls Theres an option especially for that, its called 'priority'
when this option is set to 'true' it will be considered a 'high' priority image.
heres a more detailed explaination:
https://nextjs.org/docs/app/api-reference/components/image#priority
Example:
tsx
<Image src="/logo.webp" alt="LottoBillions" width={267} height={69} priority={true} />
American black bearOP
but for LCP this priority should be true?
because I am going to to build a carousel containing some images, so maybe priority should be the images from carousel?
because I am going to to build a carousel containing some images, so maybe priority should be the images from carousel?
NextJS's documentation can help you with most of your problems. its worth taking a look at
American black bearOP
hummm I see
thanks
🙂
no problem!
@Pearls no problem!
American black bearOP
actually it didn't change
still the same thing lol
I tried priority={true}, then priority true with loading lazy
then priortiy true with placeholder="empty"
same result
Thats odd, well theres always other ways of optimizing images.
Heres the documentation for it:
https://nextjs.org/docs/app/building-your-application/optimizing/images
You can also image minifiers, or compressors, there are plently of them on the internet.
Heres the documentation for it:
https://nextjs.org/docs/app/building-your-application/optimizing/images
You can also image minifiers, or compressors, there are plently of them on the internet.
Answer
@American black bear If you dont need any more help, please mark a solution.