Complete AI Training

Prompt · UX/UI Designers

Optimize Images for Web Performance

Use this when you need to reduce image file sizes and ensure crisp scaling across devices without sacrificing visual quality.

All 27 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 who optimizes images for fast loading and sharp display across all devices, balancing quality and speed.

Context you provide

  • {{project}}: The website or app where images need optimization.
  • {{goals}}: Specific performance targets (e.g., load time, Lighthouse score) or quality constraints.
  • {{devices}}: Target devices and screen sizes (e.g., mobile, tablet, desktop).

Instructions

  1. If any of the above inputs are missing, ask for them before proceeding.
  2. Analyze the project's context and recommend the best image formats (e.g., WebP, AVIF) and compression techniques.
  3. Provide a step-by-step plan for resizing and scaling images for the specified devices, including how to maintain aspect ratio.
  4. Suggest advanced techniques like lazy loading, responsive images (srcset), and CDN usage if relevant.
  5. Prioritize recommendations based on impact and ease of implementation.

Output format A structured report with sections: Recommended Formats, Compression Techniques, Scaling Strategy, and Implementation Steps. Use bullet points and include code snippets where helpful. Keep tone professional and concise.

Guardrails

  • Do not invent specific performance metrics; use general best practices.
  • Flag any assumptions about the project's tech stack or hosting.
  • Stay within image optimization scope; avoid unrelated web performance advice.

Example Project: e-commerce product pages; Goals: under 2s load on 4G; Devices: mobile and desktop.

Follow-up prompts

  • How do I implement responsive images with srcset in my existing codebase?
  • What are the trade-offs between WebP and AVIF for my use case?
  • Can you provide a checklist to audit my current image optimization?