Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When you compress a line drawing as a jpg, it goes kind of blurry. Areas of solid colour become areas of slightly variable colour etc. Are there any tools out there that attempt to fix this kind of problem, removing the blurriness and making solid areas solid again so that the image looks better and can be usefully compressed with PNG or GIF?

In theory, just colour-reducing an image does the right thing, but in general, this always doesn't quite work well. I think an algorithm tuned to the specific task of repairing damage done by compressing as a jpg could do better.

Ideally I'd want something free that can be run in bulk from the command line.

share|improve this question
Could you post (a small representative section of) an example jpg? – RedGrittyBrick Jan 20 '11 at 16:43

Some image manipulation software can convert pixel images to vector images (by automatic "tracing"). You could use that to clean up the image and convert the vector back to a GIF, PNG or other format that uses lossless compression (JPEG is "lossy"). I've used Corel Suite in the past but I'm sure there are many vector-drawing tools with this capability.

At worst you can add the JPEG as a semi-translucent background image, add a vector layor, manually trace vector lines & curves over it and delete the under layer before saving as GIF, PNG etc. I've often done this to recreate company logos from the low resolution fuzzy hardcopy that businesses typically send when you ask for artwork to incorporate into software. It works well and can be quite fast once you get familiar with the vector art software's curve drawing / tweaking tools.

share|improve this answer
+1 for mentioning vectorization – David Cary Mar 16 '11 at 23:41

I had the exact same problem, and the solution I found was the Despeckle filter in The GIMP.

No Paint.Net filter did what I wanted, and the GIMP Despeckle filter takes a bit of manual fiddling, but this was the fastest solution I found.

Note that, as HarryMC says, there will be some image degradation. Try using the Sharpen filter after (not before) Despeckling.

share|improve this answer

A pixel gone is a pixel lost. Any destruction to an image is in general irreversible.

Specifically, you may use a photo editor to manually correct the problem, pixel by pixel. For example using Photoshop or the free Paint.NET or IrfanView.

You may get some help by applying some filters to the image, such as sharpen, but do not expect too much.

In general, the lossless TIFF format is best for keeping images for future editing, although it maximizes disk space usage.

share|improve this answer
I'm not expecting a 100% perfect job, just a slightly better job than you get with a simple colour reduction. – rjmunro Jan 20 '11 at 11:44
Then applying filters is the only way. If you have Photoshop, it's the one with the richest selection of plugins, and many more to be found on the Web. – harrymc Jan 20 '11 at 12:11
I want to do this from the command line to thousands of images - messing with filters in Photoshop or is not really an option. – rjmunro Feb 13 '11 at 15:56
With Photoshop one can apply a filter (or any series of operations) to an entire folder. – harrymc Feb 13 '11 at 16:11
IrfanView also has batch processing and the Sharpen filter. – harrymc Feb 13 '11 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .