Half your photo is gray? How to fix a corrupted JPEG or PNG
Why a damaged JPEG turns gray from one line down, what a repair tool can really fix, and how Repairit, EaseUS, Stellar, jpeg.repair, and Bytevive compare free.
By the Bytevive team9 min read

The top of the photo looks perfect. Then, at one exact row, it turns into a flat gray slab all the way to the bottom. Or the picture won’t open at all and your viewer says the file is damaged, corrupted, or “not a valid image”.
Both are common, and both have plain causes. Knowing which one you have tells you whether a repair can bring the photo back, or only save the part that survived. For a broader guide covering every photo symptom, see how to fix corrupted photos.
Why half the photo turns gray
A JPEG starts with a start-of-image marker (FF D8), followed by settings such as the camera’s EXIF data and the compression tables, then the compressed picture itself, and finally an end-of-image marker (FF D9). These codes are defined in the JPEG standard, ITU-T T.81. The picture data is stored in strips from the top of the image to the bottom. You can test how start and end markers behave in our interactive JPEG walkthrough.
Inside a JPEG file
The picture is stored top to bottom, so losing the end of the file means losing the bottom of the photo.
- FF D8Start
- EXIFCamera info
- TablesHow to decode
- Image dataTop rows → bottom rows
- FF D9End
Copy or save stops here: everything after about 68% of the file is missing, which takes out Image data, FF D9.
When a photo is cut off by a failing memory card, an interrupted transfer, or a full disk, the decoder runs out of data partway down. libjpeg-turbo, the library behind most image viewers and browsers, then raises its “Premature end of JPEG file” warning and, in the words of its own source code, leaves the rest set to zeros so that it returns “uniform gray for the remainder”. That’s the gray slab. It’s not a color fault you can correct; it’s where your data stops.
What a photo repair can genuinely fix
| Problem | Symptom | Can it be fixed? |
|---|---|---|
| Wrong file extension | A HEIC, PNG, or WebP named .jpg won’t open in some apps | Yes, completely. Rename it to its real type |
| Junk bytes before the image | “Not a valid image”, though the size looks right | Yes, completely |
| Missing end marker | Some apps refuse it, others open it fine | Yes, completely |
| PNG checksum errors | “CRC error” or a blank image | Often. The data is usually fine; the checksums aren’t |
| File cut off | Gray or missing bottom section | Partly. The top is saved; the rest is gone |
| Data overwritten | Shifted colors, stripes, scrambled blocks | Rarely without a header from the same camera |
PNG and GIF have their own versions of these problems. The PNG specification gives every chunk of the file a CRC-32 checksum and requires a closing IEND chunk; the GIF89a specification ends every file with a single byte, 0x3B. When those are wrong or missing, strict viewers give up, even though the picture is intact.
Photo repair tools, compared
| Tool | Where it runs | Free allowance | Paid | Worth knowing |
|---|---|---|---|---|
| Bytevive | In your browser, nothing uploaded | Up to 256 MB, free account | None | Reports how much of the picture survived |
| Wondershare Repairit Online | Their servers | 3 photos in total, 5 MB each | US$5.99 per photo or US$9.99/month | Mixes repair with AI enhancement |
| EaseUS Fixo Online | Their servers | Under 100 MB; email required to download | Pro plan | Download code sent by email |
| Stellar Repair for Photo (online) | Their servers | 1 photo up to 20 MB | From US$9.99/month | Desktop app from US$39.99/year |
| jpeg.repair | Their servers | Free, no sign-up | None | JPEG only; re-encodes the image |
| pngcheck, jpeginfo, JPEGsnoop | Your computer | Free, open source | None | Diagnose rather than repair |
Largest photo you can repair for free online
Per file, on each service's free tier.
- Bytevive
- 256 MB
- Runs in your browser
- EaseUS Fixo Online
- 100 MB
- Email required
- Stellar (online)
- 20 MB
- 1 photo
- Repairit Online
- 5 MB
- 3 photos in total
To be fair to the others: jpeg.repair is free and refreshingly honest that missing data “can’t be invented”, and the paid desktop apps can do things a browser tool can’t, such as borrowing the header from a healthy photo taken on the same camera. If your photos have scrambled colors rather than a gray band, that’s the kind of tool you need.
How to fix a photo in your browser with Bytevive
- Open Photo Repair and sign in with a free account.
- Drop the photo onto the page. It never leaves your device.
- Bytevive reads the first bytes to work out what the file really is. It repairs JPEG, PNG, and GIF wrappers, identifies and checks WebP, BMP, and AVIF (up to 256 MB), and flags HEIC or TIFF as unsupported rather than guessing. A photo that opens on a phone and not on Windows is often a HEIC file.
- It strips stray bytes, fixes a wrong extension, adds a missing end marker, and checks every PNG chunk’s checksum, rebuilding the file if they’re wrong.
- It decodes the result and shows it to you. If the file was cut off, your browser shows what’s left with an estimate of how much is still there, though stricter apps may still refuse a cut-off file.
The command-line route
# List every PNG chunk and check its CRC
pngcheck -v photo.png
# Fully decode a JPEG and report errors (exit code 1 if damaged)
jpeginfo -c photo.jpgBoth are free and open source. They won’t fix anything, but they’ll tell you precisely what’s wrong, which is half the battle. JPEGsnoop goes further on Windows, decoding a file block by block.
The bottom line
Many broken photos are only mislabeled or missing a few bytes at the edges, and those come back completely. A photo with a gray band can’t be made whole, but the part above the line is yours to keep. Check it in your browser to find out which you have, before uploading a personal photo anywhere. If Windows Photos says it doesn’t support the file format at all, see our guide to that message.
Frequently asked questions
Why is the bottom half of my photo gray?
Can AI repair the gray part of a photo?
My photo won't open on Windows but works on my phone. Is it corrupted?
Is my photo uploaded when I use Bytevive?
Does Bytevive repair HEIC or camera RAW photos?
Sources
Every claim, error message, price, and limit cited above comes from these pages, checked on November 22, 2026. If one has changed, tell us at support@bytevive.com and we’ll update the article.
- ITU-T T.81: the JPEG standard (marker codes)
- libjpeg-turbo source: jdhuff.c ("uniform gray" fill)
- libjpeg-turbo source: jdatasrc.c ("Premature end of JPEG file")
- W3C: PNG specification (chunks and CRC)
- W3C: GIF89a specification (trailer)
- Wondershare Repairit Online Photo Repair
- Wondershare Repairit online store (limits and prices)
- EaseUS Fixo Online Photo Repair
- Stellar Repair for Photo, online
- jpeg.repair
- pngcheck
- jpeginfo
- JPEGsnoop


