views:

121

answers:

4

Please help! Thanks in advance.


Update: Sorry for the delayed response, but if it is helpful to provide more context here, since I'm not sure what alternative question I should be asking.

I have an image for a website home page that is 300px x 300px. That image has several distinct regions, including two that have graphical copy on top of the regions.

I have compressed the image down as much as I can without compromising the appearance of that text, and those critical regions of the image.

I tried slicing the less critical regions of the image and saving those at lower compressions in order to get the total kbs down, but as gregmac posted, the sections don't look right when rejoined.

I was wondering if there was a piece of software out there, or manual solution for identifying critical regions of an image to "compress less" and could compress other parts of the image more in order to get the file size down, while keeping those elements in the graphic that need to be high resolution sharper.

+1  A: 

You cannot - you can only compress an entire PNG file.

You don't need to (I cannot think of a single case where compressing a specific portion of a PNG file would be useful)

Dividing the image in to multiple parts ("slicing") is the only way to compress different portions of a image file, although I'd even recommend again using different compression levels in one "sliced image", as differing compression artefacts joining up will probably look odd

Regarding your update,

identifying critical regions of an image to "compress less" and could compress other parts of the image more in order to get the file size down

This is inherently what image compression does - if there's a bit empty area it will be compressed to a few bytes (using RLE for example), but if there's a very detailed region it will have more bytes "spent" on it.

The problem sounds like the image is too big (in terms of file-size), have you tried other image formats, mainly GIF or JPEG (or the other PNG format, PNG-8 or PNG-24)?

I have compressed the image down as much as I can without compromising the appearance of that text

Perhaps the text could be overlaid using CSS, rather than embedded in the image? Might not be practical, but it would allow you to compress the background more (if the background image is a photo, JPEG might work best, since you no longer have to worry about the text)

Other than that, I'm out of ideas. Is the 300*300px PNG really too big?

dbr
you can't get compression artifacts from a lossless codec.If indeed breaking it into separate images is what Neep meant by "slicing", you could do that, but none of this make much sense.
simon
Hm? If it's a PNG, there should be no compression artifacts; it's a lossless compression format.
Brian Campbell
Since it's lossless, the only way to 'compress more' is to save it at lower resolution (size, or color palette). If you do that, the different slices of the image will look different when put next to each other (to make the full image again). Slicing is a common technique in web development: cutting up into different boxes, and then displaying the boxes next to each other to 'reassemble' the original image.
gregmac
A: 

Hi, Neep here,

Sorry for the delayed response, but if it is helpful to provide more context here, since I'm not sure what alternative question I should be asking.

I have an image for a website home page that is 300px x 300px. That image has several distinct regions, including two that have graphical copy on top of the regions.

I have compressed the image down as much as I can without compromising the appearance of that text, and those critical regions of the image.

I tried slicing the less critical regions of the image and saving those at lower compressions in order to get the total kbs down, but as gregmac posted, the sections don't look right when rejoined.

I was wondering if there was a piece of software out there, or manual solution for identifying critical regions of an image to "compress less" and could compress other parts of the image more in order to get the file size down, while keeping those elements in the graphic that need to be high resolution sharper.

Sorry, I'm not sure how to edit the original Q i asked- if anyone can advise, i would appreciate it.

Please edit this into your question rather than adding it as an answer
therefromhere
You need to be logged in as the same user you asked the question as. I've edited in your update, in case this isn't possible (since it makes the question far better)
dbr
Or rather, create a new account (using OpenID) and then "reclaim" your question (I think, it's been a while since I've done this myself..)
dbr
A: 

This is the funniest question ever! Yes you should "slice" your image! Learn HTML tables and CSS dude!

zvolkov
A: 

It sounds like you are compressing parts of your image using something like JPEG and then pasting those compressed images onto a PNG combined with other images, and the entire PNG is sent to the browser where you split them up.

The problem with this is that the more you compress your JPEG parts the more decompression artifacts you will get. Then when you put these low quality images onto the PNG, which uses deflate compression, you will actually end up increasing the file size because it won't be able to compress well.

So if you are keen on keeping PNG as your file format the best solution would be to not compress the parts using JPEG which you paste onto your PNG - keep everything as sharp as possible.

PNG compresses each row separately unless you have used a "predictor" in the compression.

So it's best to keep your PNG as wide as possible with similar images next to each other horizontally rather than under each other vertically.

Perhaps upload an example of the images you're working with?

Bing