Pixelation

General => General Discussion => Topic started by: Mr. Fahrenheit on August 05, 2012, 03:37:21 pm

Title: Sub Pixels
Post by: Mr. Fahrenheit on August 05, 2012, 03:37:21 pm
I was looking around reading about sub pixel rendering and found this topic: http://www.wayofthepixel.net/pixelation/index.php?topic=1882.0 and some others about sub pixel animation and all that. However the topic's picture that i linked are broken So I am wondering, are sub pixels just anti-aliasing, is it something different, or is it a special type of anti-aliasing that conforms to the red green blue colors of the sub pixels in out monitors? I know in some text there is sub pixel rendering that uses what i would say oddly hued colors for the aaing.
Title: Re: Sub Pixels
Post by: Grimsane on August 05, 2012, 03:52:42 pm
its using colours, usually halfway between the colour of the pixels the motion is flowing in, it's a method of implying more resolution of motion than is possible with single pixels.

(http://i.imgur.com/YsIDZ.gif)

there is an example I put together, need further elaboration?
Title: Re: Sub Pixels
Post by: API-Beast on August 06, 2012, 11:04:08 pm
Usually with sub pixels not anti aliased colors are ment but actually the smaller pixels one pixel consists of on LCD displays. For every component of a color (Red, Green, Blue) there is one subpixel.
http://en.wikipedia.org/wiki/Subpixel_rendering (http://en.wikipedia.org/wiki/Subpixel_rendering)

Here is one really simple example of subpixel animation:
(http://i.imgur.com/72mOF.gif)
This aliased circle is moving 10 pixels (5 forward, 5 backward)... but actually has 30 animation frames, in each frame it's moving one sub-pixel. Note that the effect is much more smooth if the circle would have sub pixel anti aliasing.

As comparison, left the sub pixel animation, right the normal animation:
(http://i.imgur.com/72mOF.gif)(http://i.imgur.com/B3zlW.gif)

Well, its usefulness is rather restricted, it bloats the color count, doesn't work when scaled in, and that you have to move something less than one pixel is quite rare. It's more something you bother with just for fun.

PS: somebody still has those pictures from that thread?  ;D
Title: Re: Sub Pixels
Post by: Helm on August 07, 2012, 12:29:03 am
Here's a good example I made later today

(http://www.locustleaves.com/sub.gif)
Title: Re: Sub Pixels
Post by: API-Beast on August 07, 2012, 12:50:29 am
Looks fancy... but has pretty little to do with sub-pixels ??? This would probably look proper if it were using technical (R,G,B) sub pixels but this way it looks like the two lines are dancing around a black pole in the middle rather then moving left/right in 2D space.  :-X
Title: Re: Sub Pixels
Post by: ptoing on August 07, 2012, 12:52:49 am
When we speak about sub pixel animation we usually do not mean real sub pixels. Those are pretty useless for anything other than white on black stuff (or vice versa).

A better name would be animated tween aa or something, I dunno. But when people here say sub pixel animation that is usually what is meant.
Title: Re: Sub Pixels
Post by: Stab on August 07, 2012, 01:52:27 am
So, basically, there's "real" sub-pixel animation that abuses the orientation of the 3 coloured diodes that actually make up each pixel in order to literally break a single pixel down to thirds, visually...

...And there's another "real" sub-pixel animation that abuses peoples' natural visual understanding of the world to make the viewer believe that an object or part of an object is occupying a space between the pixels, rather than occupying two separate pixels themselves.

I'd imagine the RGB-abuse technically-sub-pixel animation would be practically impossible to use practically, unless the many different types of visual displays are reasonably consistent in their methods of displaying. Abusing people's visual understandings, on the other hand, should be fairly universal and result in more reliable results. Reliably.
Title: Re: Sub Pixels
Post by: Mr. Fahrenheit on August 07, 2012, 02:08:01 am
Thanks for all the answers guys I guess what I was mainly wondering was whether or not pixel art sub-pixels are the real sub-pixels or just changing color as I've heard before. Also is there a real "way" to come up with the colors you would use as real sub-pixel animation because I think it would be interesting to put sub-pixels into use in pixel art.
Title: Re: Sub Pixels
Post by: Grimsane on August 07, 2012, 08:39:40 pm
oh yeah, site went down before I edited my post, was going to additionally ask do you mean actual sub pixels, and made these examples

(http://i.imgur.com/TgXMv.png) <breakdown of a pixel on a TFT screen (full RGB would be white)

(http://i.imgur.com/tTSjd.gif) <theoretically utilizing sub pixels to move at finer than pixel amounts, only the top left, the bottom is at 3x zoom to breakup what is theoretically happening, to be honest it isn't very noticeable at all, and in pixel art and animation it's all about effective colour usage to imply the pixels are moving between each other.

*just read the thread response, I honestly think that 1bit sub pixel-less circle is as effective and smoother to my eyes, the one on the left just reads the same but with awful colour aliasing at the penumbra, helm's example is rather smooth and really fine amounts of motion is achieved within 2 pixel lines, also the only real practical use of sub-pixels on font is entirely scale relative and has a lot more going into it than simply using RBG values per pixel and is calculated and used as a form of anti aliasing

just zoom in on this to see exactly what I mean (http://i.imgur.com/qUVt3.png)

if you had some fancy software you could turn a 1 bit animation at a higher resolution into a half resolution animation using sub-pixel anti-aliasing to effectively reproduce the same level of detail. but yes as everyone has said it's not what people mean at all when they say Sub pixel animation in relation to pixel art

*bit further away from my monitor, that circle slide does look smoother, but if it was greyscaled it'd arguably look as smooth
Title: Re: Sub Pixels
Post by: ptoing on August 08, 2012, 02:02:21 pm
Also, not all displays might be RGB, there are also BGR ones, which will fuck your stuff up pretty bad. On the original DS and the DS lite one of the displays is BGR for example.
Title: Re: Sub Pixels
Post by: Grimsane on August 08, 2012, 05:25:32 pm
I'm not entirely sure, but I recall reading about and not sure if there is a matrix difference between VA (Vertical Alignment), TN (Twisted Nematic) and IPS (In Plane Switching)  LCD types, I have a vague recollection that TN monitors have horizontal sub pixels Vs Vertical.

might be wrong here but here's my assumption based on what I can recall

(http://i.imgur.com/GPjr3.png)

and I've read IPS stuff before and It's possible it doesn't even have sub pixels, actual mechanical/electronic/hardware colour blending per display pixel

so ontop of different RBG orders there is that factor too, so It further pushes the point manual adherence to 'real sub pixels' is fruitless, further adding to what I mentioned about theoretical software, it'll probably be a runtime based animation because it'd need to do the relevant sub pixel adjustments for different monitor types, as far as I know driver monitors actually effect the rendering of font too because of the sub pixel driven nature of it.

even so cons of using real sub pixels in animation is it will only work at 1x resolution, so you'd need graphics readable at 1x on most monitors, and as actual display pixels get smaller and smaller, it won't scale and will be impractical you won't even be able to perceive it unless your nose was against your display
Title: Re: Sub Pixels
Post by: Mr. Fahrenheit on August 10, 2012, 12:11:12 pm
I was testing out a theory I had with sub pixels yesterday and it didnt work out as planned. I made a 36x36 pixel image and i filled it with the red green blue pattern for each block of three pixels.
(http://img341.imageshack.us/img341/9640/subpixel.png) I made what should be a white circle with slight antialiasing around a slightly purple background. However when i shrunk it to 1/3 of its size that is not what it was. (http://img88.imageshack.us/img88/4046/subpixel13.png) is what I came up with, a green circle. I am not sure why this happened though i believe it is because the green subpixel is the subpixel most related to brightness.
Title: Re: Sub Pixels
Post by: API-Beast on August 10, 2012, 12:30:55 pm
Scaling simply doesn't work like that  :-X It's green because you are scaling without interpolation so he simply picks every third pixel and discards everythng else. Unfortunally there are no graphics applications I know that have a additive or subpixel scaling mode, so you have to do it manually.
Title: Re: Sub Pixels
Post by: Ashbad on August 10, 2012, 12:43:35 pm
I was testing out a theory I had with sub pixels yesterday and it didnt work out as planned. I made a 36x36 pixel image and i filled it with the red green blue pattern for each block of three pixels.
(http://img341.imageshack.us/img341/9640/subpixel.png) I made what should be a white circle with slight antialiasing around a slightly purple background. However when i shrunk it to 1/3 of its size that is not what it was. (http://img88.imageshack.us/img88/4046/subpixel13.png) is what I came up with, a green circle. I am not sure why this happened though i believe it is because the green subpixel is the subpixel most related to brightness.

Well, for one, I tried it out in MSPaint to see if that's what you used -- I got the exact same result.  I honestly wouldn't trust MSP's abilities to conduct such an experiment.  In fact, I'm unsure of the point of said experiment, since the result of the scale-down and color blend would be entirely dependent on the algorithm of the used image editor for said procedure.  To further my point, try scaling down a 3x3 block with the first column red, second one green, third one blue.  Try scaling down the same thing except mirrored backwards.  Try rotating it 90 degrees and doing it.  Try rearranging the colors in other ways.  Every time will have a different result, and in fact, none of them will yield white.

As for the green subpixel being the "source of brightness", a simple look at what you've got there confirms that the green stands out from the other colors, almost as a white in contrast to the moderate red and very dark blue.  For a related tie-in: http://en.wikipedia.org/wiki/Luma_(video)#Rec._601_luma_versus_Rec._709_luma_coefficients
Title: Re: Sub Pixels
Post by: Grimsane on August 10, 2012, 04:10:45 pm
(http://i.imgur.com/hBpEq.png)

bluring is the only reliable way to combine RGB values, rescaling linear cubic and sinc all produce images that try to maintain detail.

also if you open this in a new window and drag it around the screen you can identify sub pixel flicker ( i get quite alot at the very top portion of my screen)
(http://i.imgur.com/SDrEx.png)


also looking closely at something that will probably produce some strange effects, besides the subpixel wobble, on my screen it has a dark shapes flowing up and down and a wavy pattern in the colours, some of which could be an interesting effect happening due to vertical tearing (which presents it self as horizontal disturbances(doesn't work if Vsynch is on, and most systems can't Vsynch on desktop/outside of a fullscreen app)

(http://i.imgur.com/aSqyx.gif)