Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bizarre anti-aliasing problem

Status
Not open for further replies.

thrybergh

MIS
Feb 10, 2003
52
GB
Hello.

I have a series of images (sized 100x100 pixels). They are all logos and have a standard shading effect applied to the left hand side of them which makes them appear to "fade" them into the distance. The effect is created by having every other line be a "graded-in" white solid line e.g.
Code:
xxxxxxxxxxxxxxxxxxxx
       x xx xxxxxxxx
xxxxxxxxxxxxxxxxxxxx
       x xx xxxxxxxx
xxxxxxxxxxxxxxxxxxxx
       x xx xxxxxxxx
xxxxxxxxxxxxxxxxxxxx
       x xx xxxxxxxx
xxxxxxxxxxxxxxxxxxxx
       x xx xxxxxxxx
xxxxxxxxxxxxxxxxxxxx


I'm using IE 5.0 and when I create a static HTML page my images (scaled down to 50x50) are rendered and the fading from the white lines is effectively "lost" due to the scaling. The logos appear to be made of solid colour. I understand why this is, as if the line of detail is 1 pixel, then it can't be scaled down. This is not a problem.

However things get a little strange [ponder] when I create the same page via a Java servlet and XSL stylesheet. The anti-aliasing algorithm seems to lose the non-white lines and my logos look like they are only half there! It's not a serious problem but I'd like to know if anyone else has had a similar encounter!

I just don't understand why there are inconsistencies in the anti-aliasing.
 
>>However things get a little strange when I create the same page via a Java servlet and XSL stylesheet.

Maybe another forum?
 
Hmmm... can't see why this would happen if the generated HTML is the same. Where is the XSL running - on the server or on the browser? Don't know enough about java servelets to offer an opinion.

However, you're taking a risk by assuming that browsers will scale your images in a particular way - if IE5.0 is a bit quirky, imagine what the panoply of other browsers, graphics set-ups and hardware platforms are going to do! If you NEED a 50x50 version of your graphics, better to MAKE a 50x50 version with a graphics program that to leave it to the browser. That way you can be sure they'll look how you want them to, and download quicker too!

-- Chris Hunt
Extra Connections Ltd
 
Thanks for the tips. I think it will be worth making a half-size version of each logo, even though there are 92 of them to do.

That's a valid point about different browsers and platforms. I tend to only cater for IE, through laziness.

:)
 
are these gifs? gifs do not resize well... if you save them as jpgs, you may have better luck and not need two copies
 
I used Fireworks which had a batch converter facility. I'd never seen that before, but it was useful. I made 100% quality JPGs and the page is looking a lot better now thanks.

[2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top