Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
Posts: 488
Threads: 19
Joined: Sep 2005
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... :???:
Posts: 1,774
Threads: 62
Joined: Aug 2003
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.
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 484
Threads: 14
Joined: Apr 2005
Look up laplace kernel filtering. Also look at the comp.graphics.algorithms FAQ
EVEN MEN OF STEEL RUST.
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Got it, thanks.
Heh heh heh, and excuse to use highcolour mode!
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,774
Threads: 62
Joined: Aug 2003
So let's see what you made.
Posts: 3,616
Threads: 287
Joined: Jan 2003
I'm working on it.
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.