I have this image that have been damaged by JPG, and would very much like to restore it, as if it had never been compressed with JPG.

enter image description here

Can someone help me with this? I assume I need to fill with similar colours to get the sharp edges back?

  • Is that shown at 100% or is it enlarged for clarity? – e100 Oct 3 '11 at 18:02
  • @e100 I have just found a better version and inserted that instead. But yes, it is shown at 100% – Louise Oct 4 '11 at 19:25

If this image is representative of your other images, with large, flat areas of color, then a simple color quantize can give a good result. In the sample images there are only three intended colors: two shades of grey, and yellow.

Open the image in Photoshop, and choose Image > Mode > Indexed Color


  • Colors: 3
  • Forced: None
  • Transparency: Unchecked
  • Dither: None

Then, select Palette: Custom...

Change the three colors to:

363636 f8df2c 282325

And apply. You should get this:

enter image description here


My approach would be to use Select > Color Range:

  • Eyedropper a clean area of the yellow to make it the foreground color. Be sure to set the sampling to 3x3 or 5x5, not single pixel.

  • Choose Select > Color Range and click the "+" icon in the dialog. Work with the image until all the icon pixels are selected but none of the background (should be easy).

  • Ctl/Cmd-J to copy the selected area to a new layer.

  • Add a layer below this and fill with black.

  • You can Zoom in and clean up any rough bits with a single-pixel eraser tool, but I suspect that won't be necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.