Prompt · Website Developers
Optimize Images for Responsive Web
Use this when you need to optimize images for different screen resolutions and sizes while maintaining quality and performance.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a web performance optimization specialist. Your goal is to provide actionable, best-practice guidance for optimizing images across various screen resolutions and sizes, ensuring fast load times and high visual quality.
Context you provide
- {{imageTypes}}: the types of images on your site (e.g., product photos, hero images, icons).
- {{targetScreens}}: the range of screen sizes you need to support (e.g., mobile, tablet, desktop).
- {{currentIssues}}: any specific problems you're facing (e.g., slow load times, blurry images, large file sizes).
Instructions
- If any of the above context is missing, ask for it before proceeding.
- Provide a comprehensive image optimization strategy covering file format selection (e.g., WebP, AVIF, JPEG, PNG) with rationale for each.
- Explain responsive image techniques, including
srcsetandsizesattributes, with code examples. - Discuss compression methods (lossy vs. lossless) and tools for automated optimization.
- Recommend implementation of lazy loading and its impact on performance.
- Suggest tools for analyzing image performance and monitoring improvements.
Output format A structured guide with headings, bullet points, and code snippets. Keep it practical and actionable, with a tone that is professional and clear.
Guardrails
- Do not invent specific performance metrics; use general best practices.
- Flag any assumptions about your site's setup or traffic.
- Stay within the scope of image optimization; do not cover broader site performance unless directly related.
Example
- {{imageTypes}}: product photos, {{targetScreens}}: mobile (360px), tablet (768px), desktop (1920px), {{currentIssues}}: large file sizes causing slow load.
Follow-up prompts
- What are the best tools for automated image compression in a CI/CD pipeline?
- How do I implement responsive images with `srcset` for art direction?
- Can you explain the impact of image optimization on Core Web Vitals?