Forum Moderators: not2easy
I sometimes use backgrounds that I repeat vertically; imagine vertical lines like a pinstripe.
While the design differs from left to right, the patter is the exact same when moving up to down.
When saving this image I'm faced with a dilema.
Should I save the image with a height of 1px? This would result in the tiniest graphic file size, but might require more viewer's processing power to display the image many, many times on the screen.
Or, should I save the image with a height of 100px? This would result in an increased graphic file size, but might require less viewer's processing power to display the fewer images on the screen.
Any suggestions? Thanks.
However; Knowing what the optimum balance between HTTP requests (I guess this rather depends on the resolution of the screen of your user) and image dimensions would be useful...
To take thecoalman's view a bit further - for increased site-wide load speed I have taken to adding a CSS parachute include to the page head - it contains a dozen or so lines of CSS so if the page doesn't load the external sheet for some reason the page maintains 'brand'. The CSS parachute contains background colour/images, some type styling and logos.
The significance of a few bytes here and there is massively diminished.
I did it purely for cosemtic reasons, the backgrounds simply load quicker. This is actually how I noticed it because they weren't showing up quickly. It's only a split second... but noticeable to me. I can be quite anal with things like that. :P
Originally I had only thought that it might take more user end resources to display a tiny image thousands of times compared with displaying a large image a couple of times.
I was wondering if there was some kind of magic point between file size and file dimension that I should hit, like making the dimensions as large as I should while maintaining the file size below one data chunk. The more efficient the better I think, but sometimes my mind goes off on a tangent and I wanted to make sure my underlying theory was correct.
I didn't even think about issues such as caching and other factors.
You gave me a lot to thank about.
Right now, though, my understanding is the tinier the dimensions the better. Theres no need to make an image larger, especially when it will increase file size.
Thanks again.
thecoalman hit the nail on the head. IE6 doesn't cache background images.
Where did you get this info from?
My eyes ... :) It's only a split second (assuming the image is very small) but you can see it if the background image heavily contrasts with the background color.
Just to be clear, the background image is specified in an external stylesheet. It's a relative path so perhaps that is the difference? Also I'm referring to subsequent page loads.
My eyes ... :) It's only a split second (assuming the image is very small) but you can see it if the background image heavily contrasts with the background color.