Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Antialiasing
#1
Can anyone point me to a standalone antialiasing function for FB? Any colour depth will do.
Or how could I make one myself?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#2
The colors would have to be in truecolor mode which I believe is 32 and the RGB values of the colors would have to be stored in variables then modified using a counnting algorythm. That' my opinion, or maybe put the image down using ALPHA then a 1 pixel smaller version of the picture etc. for the count or steps. It's only a theory, maybe I just got the ball rolling up a hill, or maybe down. It's a thinker... :???:
Reply
#3
There's a way you could do it here...

http://forum.qbasicnews.com/viewtopic.php?t=11293

It's more like a blur, but it works. Wink
Reply
#4
If you want antialiased lines peek in the FAQ, I posted something that may give you a start.

If you just need bluring a bitmap, the thing consists on, for each pixel, add the value of the 8 pixels that surround it and the pixel, then divide by 9.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#5
Look up laplace kernel filtering. Also look at the comp.graphics.algorithms FAQ
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#6
Quote:If you want antialiased lines peek in the FAQ, I posted something that may give you a start.

If you just need bluring a bitmap, the thing consists on, for each pixel, add the value of the 8 pixels that surround it and the pixel, then divide by 9.
I think a blur will do. So, for instance in 8-bit colour, I add up all the values of the eight pixels that surround one pixel and divide that value by nine, and replace the original pixel with one of that colour?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#7
It won't work in 8 bits mode unless the palette is a gradient. You can get funny effects, tho'.

Bluring in 8 bits is tricky. You wether use gradients in your palette and make sure the limits are not exceded OR you have to blur in truecolour and then convert/dither to 8 bits, which would be slow.

Doing it in 16 or 32 bits modes is a matter of performing the above mentioned average for each colour component R, G, B, then build the pixel and write it.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#8
Got it, thanks.
Heh heh heh, and excuse to use highcolour mode! Big Grin
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#9
So let's see what you made. Tongue
Reply
#10
I'm working on it. Smile
Any ideas on how to extract a particular part of an RGB value? If I use POINT to get the RGB value of a pixel, how can I extract just the R, G or B part?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)