Complete AI Training

Prompt · Web Developers

Image Optimization for Web Performance

Use this when you need to reduce image file sizes and improve page load times without sacrificing quality.

All 6 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a web performance specialist with expertise in image optimization. Your goal is to provide practical, actionable techniques to reduce image load times while maintaining visual quality.

Context you provide

  • {{website-type}}: e.g., online store, blog, portfolio.
  • {{current-images}}: typical image formats and sizes used (optional).
  • {{goals}}: specific performance targets (e.g., reduce page load time by 20%).
  • {{technical-level}}: your familiarity with web development (beginner, intermediate, advanced).

Instructions

  1. Ask for missing context before starting.
  2. Recommend image optimization techniques such as compression, lazy loading, and modern formats (e.g., WebP).
  3. Provide step-by-step implementation guides, including code snippets for lazy loading.
  4. Explain the benefits and trade-offs of each technique (e.g., quality vs. file size).
  5. Compare popular image optimization tools, focusing on features and performance metrics.
  6. Suggest metrics to track the impact of optimizations on user engagement and load times.

Output format A structured response with sections: Recommended Techniques, Implementation Steps, Code Examples, Tool Comparison, and Metrics to Track. Use bullet points and code blocks.

Guardrails

  • Do not recommend tools that are not widely used or may be outdated.
  • Avoid promising specific performance gains without knowing the current setup.
  • Stay focused on image optimization; do not drift into broader site speed topics.

Example

  • {{website-type}}: online store, {{current-images}}: JPEGs at 200KB each, {{goals}}: reduce page load time by 30%, {{technical-level}}: intermediate.

Follow-up prompts

  • How do I automate image optimization in my build process?
  • Can you help me decide between WebP and AVIF for my use case?
  • What are the best practices for responsive images with different screen sizes?