本文へスキップ
Skillpedia
画像とアイコン75k · #2884

image-file-size

できること

このスキルは、プロジェクトの画像ファイルを監査し、ウェブには大きすぎるものを報告します。速く軽いページを作りたい開発者やサイト運営者向けです。

使う場面

  • ✓サイトの写真が数メガバイトあるとき。
  • ✓ヒーロー画像のせいで、ページのファーストビューが遅いとき。
  • ✓新しい画像を公開する前に、そのサイズを確認したいとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-file-size/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-file-size/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“画像のファイルサイズを確認して、大きすぎるものを教えてもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、各画像のサイズを一覧にし、写真には200KB などの推奨の上限を超えるものを指摘します。WebP や AVIF への変換、または端末ごとの小さいサイズの配信を提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Keep image file sizes within recommended limits

Images account for over 50% of average page weight according to HTTP Archive data. Oversized images waste user bandwidth (costly on mobile data plans), delay Largest Contentful Paint (LCP), and increase bounce rates. A 1-second delay in mobile page load can reduce conversions by up to 20% according to Google research.

Quick Reference

  • Photos: target under 200KB (WebP 80% quality); under 400KB for full-bleed hero images
  • Graphics/icons: target under 50KB; use SVG for vector graphics
  • WebP is typically 25-35% smaller than equivalent-quality JPEG (per web.dev)
  • AVIF is typically 40-50% smaller than equivalent-quality JPEG (per web.dev)

Check

Audit all image assets in this project. For each image: 1) Check the file size in bytes. 2) Flag any photo (JPEG/WebP/AVIF) over 200KB. 3) Flag any graphic/icon (PNG/SVG) over 100KB. 4) Flag any hero or full-width image over 400KB. 5) Flag any thumbnail (under 200px wide) over 30KB. Also check if Lighthouse reports 'Properly size images' or 'Efficiently encode images' as opportunities. Report each oversized image with its path, current size, and an estimated target size.

Fix

For each oversized image: 1) Convert JPEG/PNG to WebP at 80% quality using Squoosh, Sharp, or ImageOptim—this typically yields 25-35% size reduction over optimised JPEG. 2) Try AVIF at 60% quality for further reduction (often 40-50% smaller than JPEG). 3) Strip metadata (EXIF/IPTC) from images served on the web. 4) For PNGs, run through oxipng or pngquant for lossless or near-lossless compression. 5) For SVGs, run through SVGO. 6) Implement multiple srcset sizes so mobile users download smaller files.

Explain

Explain how oversized images impact web performance. Images are typically the largest assets on a page—HTTP Archive data consistently shows images account for 40-60% of total page weight. Each KB saved reduces transfer time, especially on mobile networks (4G averages 20Mbps, with significant latency). Large images also delay Largest Contentful Paint (LCP), the primary Core Web Vitals metric. Google's Lighthouse flags images that could be reduced by more than 4KB as an opportunity.

Code Review

Inspect image assets, build transforms, CMS output, and rendered markup. Flag photos above the documented file-size thresholds, hero images that exceed budget without justification, and image pipelines that ship original uploads instead of compressed responsive variants.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/images/image-file-size

よくある質問

写真の推奨サイズの上限はいくつですか?

写真は200KB 未満、全幅のヒーロー画像は400KB 未満を提案しています。

なぜ WebP と AVIF が提案されているのですか?

同程度の品質の JPEG より、一般的にずっと小さくなるからです。

寸法も確認しますか?

ファイルサイズの問題と寸法の問題を分けて、本当の原因を見つけることを提案しています。

詳細

作者による元の説明

Use when auditing the image pipeline, static assets in `public/`, CMS-managed media, or image CDN transforms. Separate file-size problems from dimension mismatches so you can tell whether the issue is compression, format choice, or responsive delivery.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2884
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル