homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
Forum Library, Charter, Moderators: not2easy

Site Graphics and Multimedia Design Forum

Crunching a jpeg
keeping the background clean

 3:54 pm on Apr 12, 2002 (gmt 0)

I am working with product scans on a white background. I can crunch the image way down and keep the product looking ok but the white background starts to get dirty looking.

Is there a trick to keep this from happening?



 4:27 pm on Apr 12, 2002 (gmt 0)

So far as I know, that effect is a product of the compression routines used when you crunch JPEGs, and is basically inherent in any lossy compression routine to some extent I think.

The answer is to use bigger images... one the real gurus may be abel to suggest a better solution. I'm not enough into the maths/techniques used by graphics compession routines


 4:36 pm on Apr 12, 2002 (gmt 0)

There are probably some telltale pixels in your background that aren't "pure" white getting caught up in the compression. Try scrubbing the background, ie, wand select with a moderate tolerance level, and flood-fill with white. Then compress.


 5:32 pm on Apr 12, 2002 (gmt 0)

I have been selecting the white background with a wand then cutting it out. Just tried the flood with white and it helps a little on some images so I guess it has to do with what else is going on.

Perhaps it is inherent to the compression process. I have some images I just can't get below a 55% crunch. I can keep the product looking ok sometimes as low as 35%.

I am sure it depends on the software but ..

How low can you go ?


 5:57 pm on Apr 12, 2002 (gmt 0)

How low can you go ?

The best answer to that is 'just before it looks bad'. That is, compress till it hurts, then back off. The compression amount will normally vary even in a series of otherwise similar images, so 35% to 55% is not uncommon.
Have you been using any tools like JPG cleaner? It will remove non-image data; reduces size considerably with no quality loss.
Also I believe Pegasus' jpgwizard is a favourite among image squishers.
As for the background - I've sometimes found it necessary to select large swatches with the rectangle to get the single pixel hangers-on too small for "marching ants" highlighting.


 6:35 pm on Apr 12, 2002 (gmt 0)

I have been selecting the white background with a wand then cutting it out

That's probably the easiest idea, unless you want to test-drive all of the available JPEG compression plug-ins, and report back on which ones leave your backgrounds cleanest. ( ;) Your assignment, should you choose to accept it...)

I've heard good things about BoxTop software's ProJPEG as well as Pegasus JPEG Wizard... Can't test both myself, as Pegasus doesn'thave a Mac version, and with the rate of software change out there, something better may have come along last week that I just haven't heard about.

However, I generally just use Photoshop's native JPEG compression, and use little workarounds like your wand selection trick when needed. Seems easiest to me.


 7:19 pm on Apr 12, 2002 (gmt 0)

I can confirm that Pegasus will let you compress sections of the image only.

You can scrunch the tricky bits and leave the background clean.

Works for me.


 7:31 pm on Apr 12, 2002 (gmt 0)

Your assignment, should you choose to accept it...

I am on a Linux box, so chances are my research wouldn't help to many.

I am using The Gimp and it is doing a better job then Fireworks did for me on windows. These images are crunched pretty good, this is just turning into a big product page.

Just looking for the benchmark of the Perfect Crunch :)


 9:37 pm on Apr 19, 2002 (gmt 0)


If you were compressing gif or png and using Photoshop 6, you could "lock" the color palette to only allow one and only one value and tint of white (or whatever your 1-color background color was). Then the artifacts have nothing to render with and disappear.


 11:02 pm on Apr 19, 2002 (gmt 0)

You can also take the correct way and clip the image from the background and then paste into a new file with a white background. Run your compression on the clipped image before pasting into the new file. I find it really difficult to get pure white backgrounds. Since we are coming at it from the traditional printing side first, we have to clip the images so I'm already one step ahead of it.


 1:06 am on Apr 21, 2002 (gmt 0)

I happen to LOVE using Paint Shop Pro 7 for my jpeg, and gif compressions... It has a GREAT export feature, that lets you preview the output, and set your compression value according to how you want it to look. Theres a scale of 1 to 100 for compression, and a few other options i think. If this is for web use, you could always use PSP7's gif export. You can choose a very good pallette and still preserve most of the colours, and have a true white bg.

Butttt, if its for print, why use jpeg?

Thors Hammer

 2:22 am on Apr 26, 2002 (gmt 0)

I too love paint shop pro. I use it alot. What I have found is before doing any sort of optimization (other than a resize maybe.........) I will use the wand (tweak the tolerance, dont rely on the default.) and pull the back ground out. You can then export with transparency.

Once you get it down, you can get that background out of there reallllll fast.

Hope that helps.



 11:00 am on Apr 26, 2002 (gmt 0)

Photoshop 6 ships integrated with ImageReady, and calls up ImageReady when you chose "Save for the Web". I've used 5 different jpeg crunchers so far, and none of them can touch ImageReady's results in this latest incarnation -- plus the ease of use and comparison features it offers make finding the optimal solution a breeze.

For jpg images, artifacts do tend to become visible first in the border areas where a solid color changes to a more photographic image. ImageReady has some nice algos to find those edges and weight the compression levels appropriately across the image. This keeps those edges clean looking at higher compression values than saving with the native PhotoShop jpg.

Hoever, I am often surprised at photo-like images which still give better results as a gif. ImageReady is still right there with the great back-and-forth comparisons between gif and jpg so you can create the optimal choice.

Until ImageReady came along, I always tweaked my gif palettes by hand. But now, although I still do this at times, more and more I just use the algo.

There's a PhotoShop gif feature that many people do not realize. There's a common situation with gif's -- when the palette reaches a certain small size, somewhere in the image you begin to see visible color banding, and that's unacceptable.

Don't give up hope! If you make a selection over the banded area, and leave it active when you index the image, the PhotoShop color index algo will concentrate the palette in just those tones. You can often knock a gif down much smaller than you thought by using this selection trick. You can even get smooth looking gradients in a gif image, when you would think that only jpg will work!

Thors Hammer

 3:05 am on Apr 28, 2002 (gmt 0)

OK, I looked at Photoshop 7, and I was impressed with its optimization of web graphics. Anyone else using 7, what are your thoughts?



 10:48 am on Apr 28, 2002 (gmt 0)

If it's as good as v.6, it's worth the investment, IMO. I'm just waiting until I can afford the upgrade... probably later this summer.


 6:10 pm on May 4, 2002 (gmt 0)

On a Linux box using the Gimp :)

Once you have a clean white background..

Right click - Image - Alpha - Add Alpha Channel

Right click - select - color, then click the white background.

Right click - edit - clear

This is letting me crunched as low as 30% while keeping the product image clean.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved