Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Anti-aliasing GIF Images

Reply
Thread Tools

Anti-aliasing GIF Images

 
 
Kevin Bertman
Guest
Posts: n/a
 
      11-26-2004
I have created a Java Dodgems game at
http://www.kevinbertman.co.uk/japan/dodgemsRules.shtml

Each dodgem is a gif image. Since the applet often rotates each
dodgem, is there a way that I can use anti-aliasing to reduce the
jagged edges? Or can anti-aliasing only be applied to things 'drawn'
like drawLine, fillRect, or drawString?
 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      11-26-2004
Kevin Bertman wrote:
> Each dodgem is a gif image. Since the applet often rotates each
> dodgem, is there a way that I can use anti-aliasing to reduce the
> jagged edges? Or can anti-aliasing only be applied to things 'drawn'
> like drawLine, fillRect, or drawString?


Anitaliasing is indeed best done during rasterisation (what you call
'drawing'). Which means, when some data with (theoretically) infinite
resolution is fitted into the discrete raster of which e.g. a gif image
consists of.

There are other techniques to reduce the effect in images. Essentially
these are image filter. Typically a filter, like a bilinear filter, is
applied to a super-sampled version of the image (an image e.g.
originally created twice as large as needed) during downscaling. The
results is a (hopefully only) slightly blurred image. It depends very
much on the contents of the image, and the type of filtering if such an
image is perceived as better or worse than the original. java.awt.image
provides a few filters, you just have to try what works best for you.

/Thomas

PS: comp.lang.java.gui is next door.

--
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
 
Reply With Quote
 
 
 
 
Boudewijn Dijkstra
Guest
Posts: n/a
 
      11-27-2004
"Kevin Bertman" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) om...
>I have created a Java Dodgems game at
> http://www.kevinbertman.co.uk/japan/dodgemsRules.shtml
>
> Each dodgem is a gif image. Since the applet often rotates each
> dodgem, is there a way that I can use anti-aliasing to reduce the
> jagged edges? Or can anti-aliasing only be applied to things 'drawn'
> like drawLine, fillRect, or drawString?


Enlarge the gif files. When drawing, rotate them and then rescale.


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      11-27-2004
Kevin Bertman wrote:
> I have created a Java Dodgems game at
> http://www.kevinbertman.co.uk/japan/dodgemsRules.shtml
>
> Each dodgem is a gif image. Since the applet often rotates each
> dodgem, is there a way that I can use anti-aliasing to reduce the
> jagged edges? Or can anti-aliasing only be applied to things 'drawn'
> like drawLine, fillRect, or drawString?


They're quite simple shapes. Why not define a dodgem as a shape? Then
you can avoid images.

JOhn
 
Reply With Quote
 
marcus
Guest
Posts: n/a
 
      11-29-2004
One time in ancient history I played with partial transparency in an
image in an applet. It will take some digging to find the info, but
what I did was grab the graphics of the image and changed the
transparency byte of each pixel to (255/2) or whatever. This allows the
pixel to blend with the background. Might be easier to make the outside
edge of your image partially transparent than to learn the hardcore
techniques game designers use.

I gave up and created 16 rotated versions of my image, saved them all as
gifs, and loaded them into an array. The thing about antialiasing this
way is it blends the image with a fixed background color, and looks
worse if you change the background later.

Kevin Bertman wrote:
> I have created a Java Dodgems game at
> http://www.kevinbertman.co.uk/japan/dodgemsRules.shtml
>
> Each dodgem is a gif image. Since the applet often rotates each
> dodgem, is there a way that I can use anti-aliasing to reduce the
> jagged edges? Or can anti-aliasing only be applied to things 'drawn'
> like drawLine, fillRect, or drawString?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeware to make animated GIF (can Irfanview make an animated GIF?) Annu Pai Digital Photography 4 11-23-2009 12:52 AM
Re: filename.gif or filename.gif.jpg? Bergamot HTML 0 05-30-2008 02:56 PM
Re: filename.gif or filename.gif.jpg? Beauregard T. Shagnasty HTML 1 05-30-2008 01:23 PM
How to convert a base 64 encoded GIF image to a *.gif file? hb ASP .Net 6 09-28-2004 08:24 PM
.png doesn't work for dynamically generated images, but .jpeg and .gif does Chris Jones ASP .Net 0 06-25-2003 12:47 PM



Advertisments