Compress to KB topic guide
Compress images for GitHub: hit the 10 MB image and GIF cap
Direct answer
GitHub attachment limits depend on file type. GitHub Docs “Attaching files” states a maximum file size of 10 MB for images and gifs, 25 MB for all other files, and separate video limits (10 MB on free plan repositories, 100 MB on paid plan repositories). When a PNG screenshot or JPEG photo for an issue, pull request, or comment approaches that image ceiling, compress to a deliberate KB budget under 10 MB before you drag it into the composer.
What this workflow handles
Treat the 10 MB image/GIF row in GitHub Docs as the hard budget for screenshots and still images — not the 25 MB “all other files” bucket and not the video rows unless you are attaching mp4/mov/webm. Supported image and media types listed on the same page include PNG, GIF, JPEG, SVG, and video; issue, pull request, and discussion comments can also accept additional types such as PDF and archives when you browse or drag files in (GitHub CLI supports attaching files too). For UI screenshots with text and chrome, PNG often stays sharper than JPEG; for photographs, JPEG usually shrinks faster. Large animated GIF captures can hit 10 MB before a still PNG would — if motion matters, GitHub’s video attachment path may fit better than forcing a huge GIF, subject to the free vs paid video caps in the docs. Enter a Compress to KB target safely under 10240 KB (commonly 8000–9500 KB), quality-sweep at the original dimensions first, and downscale only if the quality floor still misses the budget. GitHub also notes that for public repositories, uploaded files can be accessed without authentication — compress for size, but do not attach secrets you would not want public. Beita’s Compress to KB uses a temporary analysis upload with no long-term storage; see the Privacy Policy for retention details.
Use Compress to KB with a target under 10240 KB (for example 8000–9500 KB) before you attach a screenshot to an issue or pull request. For WhatsApp’s 5 MB image-message cap instead, see Compress image for WhatsApp.
How to use it
- Open GitHub Docs “Attaching files” and confirm your file is an image or GIF (10 MB cap) rather than a generic file (25 MB) or video (free vs paid video rows).
- Pick PNG for UI screenshots with text, JPEG for photos, and avoid oversized GIFs when a short video attachment fits GitHub’s video limits better.
- Enter a Compress to KB target under 10240 KB (commonly 8000–9500 KB), quality-sweep at the original dimensions first, and allow stepped downscale only if the quality floor still exceeds the budget.
- Confirm the output is at or under 10 MB and still readable at issue/PR width, then attach via drag-and-drop, browse, or GitHub CLI.
- On public repositories, re-check that the image contains nothing you would not want accessible without authentication, per GitHub Docs.
Frequently asked questions
What is GitHub’s image attachment size limit?
GitHub Docs “Attaching files” lists a maximum file size of 10 MB for images and gifs. That cap applies when you attach PNG, JPEG, GIF, SVG, or other image types through issues, pull requests, or comments. Treat 10240 KB as the ceiling and aim slightly lower so encoding and upload headroom remain.
Is the 10 MB limit the same as GitHub’s 25 MB attachment limit?
No. The same Attaching files page sets 25 MB for all other files — a different bucket from images and gifs. Videos have their own rows: 10 MB on free plan repositories and 100 MB on paid plan repositories. Size your screenshot or photo against the 10 MB image/GIF rule, not the 25 MB general file rule.
What KB target should I use in Compress to KB?
Start from 10240 KB (10 MB) and leave headroom: 8000–9500 KB is a practical target for a single issue or PR image. Quality-sweep first at the original pixel dimensions; allow stepped downscale only if the quality floor still exceeds the budget. web.dev’s compress-images guide recommends experimenting with quality rather than assuming one universal setting.
PNG, JPEG, or GIF for GitHub screenshots?
GitHub Docs lists PNG, GIF, JPEG, and SVG among supported image types. Prefer PNG for UI screenshots with sharp text; use JPEG for photos. GIF is capped at the same 10 MB as other images — a long animated capture may be easier to deliver as a short video (mp4/mov/webm) under GitHub’s video limits if motion matters more than a GIF preview.
Where can I attach images on GitHub?
GitHub Docs describes attaching files to issues, pull requests, and comments — drag and drop or browse in the browser, or use GitHub CLI to attach files. The same Attaching files page documents supported types and size limits per category.
Are attachments on public repos visible without signing in?
GitHub Docs notes that for public repositories, anyone can access uploaded files without authentication. Compress to reduce bytes, but treat attachments like public content — no credentials, private URLs, or sensitive data you would not publish.
How is this different from the email, WhatsApp, and general KB guides?
compress-image-for-email covers Gmail and Outlook.com 25 MB message attachment totals. compress-image-for-whatsapp covers Meta Cloud API 5 MB JPEG/PNG image messages. compress-image-for-discord covers Discord Support 20 MB free per-file uploads. compress-image-for-telegram covers Telegram Bot API sendPhoto 10 MB inline photos (not GitHub issue attachments). compress-image-for-linkedin covers LinkedIn Help 5 MB share-box photo uploads. compress-image-for-instagram covers Instagram Graph API 8 MB JPEG feed, Story, and Reels cover uploads. compress-image-for-twitter covers X API 5 MB tweet_image/dm_image still images (animated GIF 15 MB separately). compress-image-for-notion covers Notion Help 5 MB inline PNG/JPG display. compress-image-for-wordpress covers WordPress Media Library upload limits and the 2560 px big-image threshold. compress-image-for-facebook covers Meta Help Center Facebook photo upload size, format, and PNG guidance. compress-image-for-pinterest covers Pinterest Help web Image Pin uploads (20 MB; BMP, JPEG, PNG, TIFF, WEBP). compress-image-for-youtube covers YouTube Help custom thumbnails (50 MB desktop; 50 MB mobile video, 10 MB mobile podcasts; JPG or PNG). compress-image-for-threads covers Threads API 8 MB JPEG/PNG image posts (width 320–1440, aspect up to 10:1). compress-image-for-bluesky covers Bluesky post embeds at 2,000,000 bytes per image blob. compress-image-to-kb covers forms and marketplaces (GOV.UK, LinkedIn profile, Shopify). This page isolates GitHub’s 10 MB image/GIF attachment rule from GitHub Docs. Same Compress to KB tool; different destination budget.
Sources
- GitHub Docs — Attaching files: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files — 10 MB max for images and gifs; 25 MB for all other files; video limits on free vs paid repos; supported types; issue/PR/comment attach paths; public repo file access without authentication.
- web.dev — Compress images: https://web.dev/articles/compress-images — Experiment with quality settings; there is no one universal compression setting.
- Pillow — Image.save (JPEG quality, optimize): https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg — JPEG quality and optimize parameters used in the quality sweep behind Compress to KB.
Explore the compress to kb topic cluster
This guide covers GitHub image and GIF attachment size. Related guides cover general KB budgets, email, WhatsApp, LinkedIn share photos, Instagram Graph JPEG caps, Twitter / X still-image caps, Notion inline image caps, WordPress Media Library caps, Facebook Help photo upload caps, Pinterest web Image Pin caps, Discord, and Telegram caps, and the Compress to KB tool.
Related guides
-
Compress image to KB
General hard byte-budget workflow for forms and marketplaces.
-
Compress images for email
Gmail and Outlook.com 25 MB attachment caps.
-
Compress images for WhatsApp
Meta Cloud API 5 MB JPEG/PNG image-message cap.
-
Compress images for Discord
Discord Support 20 MB free per-file upload cap.
-
Compress images for Telegram bots
Telegram Bot API sendPhoto 10 MB cap for inline bot photos.
-
Compress images for LinkedIn posts
LinkedIn Help 5 MB cap for share-box photo uploads.
-
Compress images for Instagram
Instagram Graph API 8 MB JPEG cap for feed, Story, and Reels cover.
-
Compress images for Twitter / X
X API 5 MB still-image cap for Posts and DMs (animated GIF 15 MB).
-
Compress images for Notion
Notion Help 5 MB cap for inline PNG/JPG display (all plans).
-
Compress images for WordPress
WordPress Media Library 2560 px big-image threshold and PHP upload_max_filesize limits.
-
Compress images for Facebook
Meta Help Center 15 MB photo uploads; keep PNG under 1 MB to avoid pixelation.
-
Compress images for Pinterest
Pinterest Help 20 MB web Image Pin max; BMP, JPEG, PNG, TIFF, WEBP.
-
Compress images for YouTube
YouTube Help custom thumbnails: 50 MB on desktop; 50 MB mobile video, 10 MB mobile podcasts; JPG or PNG.
-
Compress images for Threads
Threads API image posts: 8 MB max JPEG or PNG; width 320–1440 px, aspect ratio up to 10:1.
-
Compress images for Bluesky
Bluesky post embeds: 2 MB max per image blob (image/*); up to 4 images; alt text required.
-
Compress to KB tool
Set a KB target and download a file under budget.
All compress to kb guides
- Compress image to KB: hit a hard file-size limit
- Compress images for email: hit Gmail and Outlook attachment caps
- Compress images for WhatsApp: hit the 5 MB image message cap
- Compress images for Discord: hit the 20 MB free upload cap
- Compress images for Telegram bots: hit the sendPhoto 10 MB cap
- Compress images for LinkedIn posts: hit the 5 MB photo share limit
- Compress images for Instagram: hit the 8 MB JPEG upload limit
- Compress images for Twitter / X: hit the 5 MB image upload limit
- Compress images for Notion: stay under the 5 MB inline limit
- Compress images for WordPress: Media Library size and big-image rules
- Compress images for Facebook: file size and format before upload
- Compress images for Pinterest: hit the 20 MB web Image Pin cap
- Compress images for YouTube: custom thumbnail file-size limits
- Compress images for Threads: hit the 8 MB image post limit
- Compress images for Bluesky: hit the 2 MB post embed limit
- Compress images for TikTok: hit the 20 MB photo upload limit
- Compress images for Shopify: hit the 20 MB and megapixel upload limits
- Compress images for Mastodon: hit the 16 MB post attachment limit
- Compress images for Slack: byte size and inline preview limits
- Compress images for eBay: hit the 12 MB listing photo limit
- Compress images for Etsy: stay under the 1 MB upload reliability tip
- Compress images for Medium: hit the 25 MB story-editor limit
- Compress images for Google Business Profile: fit 10 KB–5 MB photo rules
- Compress images for Wix: Media Manager limits and practical upload ceilings
- Compress images for Webflow: 4 MB Assets limits and upload prep
- Compress images for Squarespace: 20 MB cap and 500 KB performance recommendation
- Compress images for Ghost: Ghost(Pro) plan caps (5 MB–1 GB) and self-hosted 50 MB nginx default
- Compress images for Gumroad: 50 MB cover limit and thumbnail prep
- Compress images for beehiiv: 5 MB newsletter uploads, 1200×630 thumbnails, and 10 MB community posts
- Compress images for Mailchimp: 1 MB Content Studio uploads, 1024 KB targets, and legacy vs new builder widths
- Compress images for Kit: smaller-than-25 MB gallery, form/LP sizes, and email look-best width
- Compress images for Klaviyo: 10 MB email ceiling, 1024 KB load targets, form 5120 KB, and full-width dimensions
- Compress images for MailerLite: 10 MB File manager, 1024 KB campaign prep, GIF 4 MB, and width rules
- Compress images for Brevo: 5 MB Content library, layout widths, and HTML/attachment contrast
- Compress images for Substack: official sizes, PNG email banners, and dimension-first prep
- Compress images for Google Ads: 5120 KB JPG/PNG assets, aspect ratios, and surface-specific rows