View Single Post
  #17  
Old 01-24-2005, 07:52 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Quote:
Originally Posted by Goboom
Does anyone know what this equation is!?
I need it for a paint program I am writing which still needs a name by the way!
I develop an open source graphics program, and the 2 main methods for aliasing we use are...

1) A blur grib of {0,1,0},{1,4,1},{0,1,0}. What this means is for each pixel, we take 4 times its current value, and 1 times the value of those directly adjacent. We then divide this value by 8 in order to scale it back down.

2) When applying a matrix or such to the image (for rotation, scaling/resizing and trippy effects), whe use the inverse matrix to see where the pixel 'came from' (applaying a matrix using the inverse is much better as you dont get 'gaps'). So like for each pixel on the out put, we see where its colour must have come from. Ususally this will not fall on an exact pixels, so we take a proportionate ammount from the 4 with which it is nearest. We calculate our proportions by the following method.... imageine the four nearest pixels as the corners of a square. now where you inverse matrix falls, draw a cross so that the square is split into 4 regions. We now use the area of the region which is diagonally opposite each corner to decide the weighting. I have attached a diagram to try and make this clearer, and attached an image of what this looks like in effect.

I dont know if these are official methods but they give the effect we needed sooo....
Attached Thumbnails
Click image for larger version

Name:	aliasing_method.png
Views:	75
Size:	13.2 KB
ID:	30902   Click image for larger version

Name:	aliasing_example.png
Views:	83
Size:	162.9 KB
ID:	30903  
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote