AuthorTopic: Scientific AA help  (Read 3191 times)

Offline ChrisButton

  • 0001
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile

Scientific AA help

on: February 06, 2011, 12:51:03 pm
Hey guys.

I forgot I had an account on this place, and it does prove to be pretty impressive.
I'm going to try and hang around on Pixelation AND PixelJoint.

Firstly, here are a few tests I've been doing on Anti Aliasing scientifically which I
have posted on PixelJoint, and I hope by also posting them here, I can gain more
feedback on the topic.

Here are my successful AA conversions, I plopped them onto one piece:

I know, there isn't much. Sorry!

You probably already know, but for those who don't - the way I achieve getting
a straight line between two points is by expanding each pixel to a 10x10 pixel
and then depending on the shape, I draw or rule what it would look like in a
higher resolution, and then when I go to convert it back, since it's a 10x10
pixel I can calculate how much of that colour is in that individual pixel as a
percentage.

So now I was wondering how I could achieve something like this with rounded
line art, it's easier when there isn't line art and you're doing something rounded,
but I am specifically trying to do it with rounded line art. Here is an example I'm
working on:

« Last Edit: February 06, 2011, 12:53:14 pm by ChrisButton »

Offline Ambient

  • 0001
  • *
  • Posts: 19
  • Karma: +0/-0
  • Aspiring artist
    • View Profile
    • ambient-art.net

Re: Scientific AA help

Reply #1 on: February 06, 2011, 04:33:22 pm
Just saying I use GraphicsGale, and I put dots of the line at different 'opacities' depending on my pallet against its background. I then look at the preview, seeing if it's better or worse. If it's better I move on. If you're going to make it 10x- which I think is too much effort- you might as well draw a thick line and calculate the percentage of it in the region to get the corresponding pixel's line opacity.
Art gives me a joy that nothing else can.

Offline ptoing

  • 0101
  • ****
  • Posts: 3063
  • Karma: +0/-0
  • variegated quadrangle arranger
    • the_ptoing
    • http://pixeljoint.com/p/2191.htm
    • View Profile
    • Perpetually inactive website

Re: Scientific AA help

Reply #2 on: February 06, 2011, 06:43:22 pm
What you need is a weighted average of all the RGB values if you want to do it this way.

So the math would be:

(colour_1_red*colour_1_red_amount)+(colour_2_red*colour_2_red_amount) and so on if you have more colours.

colour_n_red or green or blue would just be a number between 0 and 255, and the amount would be a number between 0 and 1, so 27% would be 0.27.

This works for however many colours you need and works well, tho the problem is that it is work intensive unless you make yourself a tool and it will create many many colours. If you look at my example there are some really close colours which perceptively do not make much of a difference.
« Last Edit: February 06, 2011, 06:49:59 pm by ptoing »
There are no ugly colours, only ugly combinations of colours.

Offline StaticSails

  • 0001
  • *
  • Posts: 78
  • Karma: +0/-1
    • View Profile

Re: Scientific AA help

Reply #3 on: February 06, 2011, 08:39:03 pm
I don't think I understand why you want a scientific approach to this. In most of your examples it looks blurry instead of smooth. Maybe you should limit your palette or use a palette like c64s with less than straight color ramps.

Also be nice to see all of these "experiments" applied to something other than basic rounded colors. Maybe take something from the lineart thread. You can practice more than just AA. You can even attempt to make more monsters or whatever in the same style. Now wouldn't that be a nice little project. While I'm more than happy to see people asking for help, it's sad seeing it go to nothing.
I might be a little cynical or even out of line but recently there's been a lot of nothing posts on pixelation. Can people wait until they have some substantial before posting? There are plenty of GOOD examples on this site and quite a few others.

Consider looking around the site. There are plenty of topics on anti-aliasing that can answer some if not all of your questions.

Offline ChrisButton

  • 0001
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile

Re: Scientific AA help

Reply #4 on: February 07, 2011, 01:09:04 am
@Static,
I appreciate your concern. Although you shouldn't worry, as this is the last of those tests, because if I can do this, I can cover basically all bases of AA'ing things - which will then lead me to start working on projects. I just want to get the techniques down first. Please don't patronise me because I'm new saying to check the forum or whatever, as already know a lot about Anti Aliasing, and I have read a lot of tutorials (especially on PixelJoint).
The whole reason I posted this thread was because no one covered this basis of 'curved' lines in tutorials, only straight lines.

@Ptoing, your formula is very similar to mine, and they even work in the same way! My brother and I worked out our first formula to be:

R = 10   R = 123
G = 34   G = 234
B = 56   B = 146
(Made those values up)
(Left side could be a grey colour, and right could be idk a light brown)
To find a mix between the colours, I calculate the percentage depending on the grid.

We want 86 percent brown

Finding red: smallest red + ( the highest red's percentage * (highest red-smallest red))
Finding red: 10 + (0.86 * (123-10))
Sometimes you have to use the percentage of the other number depending on which is bigger.
Which I found annoying, so then I went on to figure this formula out:

(colour one's percentage * (R,G or B value)) + (colour two's percentage * (R,G or B value))
« Last Edit: February 07, 2011, 01:16:01 am by ChrisButton »

Offline ptoing

  • 0101
  • ****
  • Posts: 3063
  • Karma: +0/-0
  • variegated quadrangle arranger
    • the_ptoing
    • http://pixeljoint.com/p/2191.htm
    • View Profile
    • Perpetually inactive website

Re: Scientific AA help

Reply #5 on: February 07, 2011, 10:12:06 am
That bottom formula is essentially the exact same as what I posted. :)

Tho I have to say, while this scientific approach works it is time consuming and not very practical at all. But if it helps you to learn understanding the principles of aa, that's good. At a certain level you should be able to get good results with whatever colours you choose yourself and not care about whether stuff is 100% correct as long as it looks good.
There are no ugly colours, only ugly combinations of colours.

Offline ChrisButton

  • 0001
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile

Re: Scientific AA help

Reply #6 on: February 07, 2011, 10:58:23 am
Yeah I realised that as I was writing it to you, silly me! I couldn't reply until now because I had to go into
the city, but anyways the reason I actually do it scientifically is because I'm still relatively new to the pixel
art scene and I've been trying to stop clinging to it like my life depended on it. So lately I've been rounding
the percentages to the nearest 10%.  :)