Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Subpixel rendering
Subpixel rendering [message #20139] Sat, 21 February 2009 17:24 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Today I have spend some time trying to implement subpixel rendering (that is the technique using individual RGB subpixels to enhance horizontal resolution).

I am not quite sure whether it is worth it:)

See enclosed pictures and tell me if you see the difference, please:)

(One is using normal aliasing, second employs subpixel rendering).

index.php?t=getfile&id=1592&private=0

Mirek
  • Attachment: normal.PNG
    (Size: 62.56KB, Downloaded 853 times)
Re: Subpixel rendering [message #20140 is a reply to message #20139] Sat, 21 February 2009 17:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
index.php?t=getfile&id=1593&private=0
  • Attachment: subpixel.PNG
    (Size: 87.06KB, Downloaded 816 times)
Re: Subpixel rendering [message #20142 is a reply to message #20140] Sat, 21 February 2009 18:48 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
Are you following Maxim Shemanarev's advices about RGB subpixel rendering for fonts (very interesting article, I give the link for interested people: http://antigrain.com/research/font_rasterization/index.html) or another technique of yours?

In his examples, it seems obvious that the result is much more interesting with RGB subpixel rendering, when done correctly. But indeed there is not so much difference between your two pictures. Can you show us a sample with a smaller scale factor? Maybe small fonts could make the difference more obvious. If not, then maybe it's not worth it... Is it much slower ?

Thanks for all your work on Painter.

regards,
Lionel
Re: Subpixel rendering [message #20143 is a reply to message #20142] Sat, 21 February 2009 19:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
chickenk wrote on Sat, 21 February 2009 12:48

Are you following Maxim Shemanarev's advices about RGB subpixel rendering for fonts (very interesting article, I give the link for interested people: http://antigrain.com/research/font_rasterization/index.html) or another technique of yours?



Well, I have seen that. One thing I do not really agree about is discarding the hinting information, but I have used links there to get info about low-pass-filter etc...

Quote:


In his examples, it seems obvious that the result is much more interesting with RGB subpixel rendering, when done correctly.
But indeed there is not so much difference between your two pictures.



Actually, if you download Maxim's demo of subpixel rendering, there is not so much difference either.

Also, very likely, arial font is not the one most useful here.

Quote:


Can you show us a sample with a smaller scale factor? Maybe small fonts could make the difference more obvious. If not, then maybe it's not worth it... Is it much slower ?



Well, look at "White" text in the example. IMO there is some visible difference...

In any case, subpixel rendering seems to add about 100 lines to Painter, something we can easily afford as option.

BTW, Painter will be the single software renderer to support subpixel rendering for non-text shapes Smile (cairo only does it for texts, AGG does not really seem to support subpixel rendering).

Mirek
Re: Subpixel rendering [message #20144 is a reply to message #20139] Sat, 21 February 2009 20:27 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I think the text looks quite a bit better with subpixel rendering, but it seems as if the vertical lines of the bottom table are "colored" in the subpixel picture. That doesn't look so good. I don't know if this is an error in your implementation or a side effect of the used algorithm.
Re: Subpixel rendering [message #20145 is a reply to message #20144] Sat, 21 February 2009 20:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Sat, 21 February 2009 14:27

Hi,

I think the text looks quite a bit better with subpixel rendering, but it seems as if the vertical lines of the bottom table are "colored" in the subpixel picture. That doesn't look so good. I don't know if this is an error in your implementation or a side effect of the used algorithm.


Well, that IMO is unavoidable. I believe they look OK if seen from distance - the computed colors should blend into gray.

IMO, you are going to see such artifacts in any subpixel rendering system. It is just that the text usually is not thin vertical line....

OTOH, it is still possible I have error somewhere Smile

Mirek
Re: Subpixel rendering [message #20147 is a reply to message #20139] Sat, 21 February 2009 22:37 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
If I had to choose between the 2 I would definitely choose the subpixel picture, and it really looks OK from a "normal" distance. I just thought there could be a problem because the line left from the text "white" is blue and the pixels left and right from that line are nearly perfect white and I thought that could be a problem.

But it really looks great. Smile
Re: Subpixel rendering [message #20149 is a reply to message #20144] Sat, 21 February 2009 23:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Sat, 21 February 2009 14:27

Hi,

I think the text looks quite a bit better with subpixel rendering, but it seems as if the vertical lines of the bottom table are "colored" in the subpixel picture. That doesn't look so good. I don't know if this is an error in your implementation or a side effect of the used algorithm.


Well, after rechecking and rethinking, I think there really might be a bug in the code.... Smile

Mirek
Re: Subpixel rendering [message #20154 is a reply to message #20149] Sun, 22 February 2009 18:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, after fixing the bug and optimizing:

- it really shows, especially with italics and thinner fonts
- it can be up to 60% slower (in 'Lion' test) than normal mode

I am not posting more screenshots, just test PainterExamples from svn...

Anyway, to make the long story short, we have now subpixel rendering in Painter, with modest price of 2KB of code... Smile

Mirek
Re: Subpixel rendering [message #20155 is a reply to message #20139] Sun, 22 February 2009 19:17 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Nice Smile

And I think the 60% are OK for subpixel rendering. For text it is well worth it.
Re: Subpixel rendering [message #20157 is a reply to message #20155] Sun, 22 February 2009 20:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Sun, 22 February 2009 13:17

Nice Smile

And I think the 60% are OK for subpixel rendering. For text it is well worth it.


Interestingly, for text it is much less (~10%). I think that it is caused by fact that text spends a lot of time parsing glyph definition and then approximating quadratic curves (which is same for normal mode). I guess that in future, we might want to introduce some optimizations for text rendering. OTOH, it quite depends on Painter usage scenarios.

Lion test is mostly about filling polygons, no expensive glyph parsing, no quadratic curves.

Mirek
Re: Subpixel rendering [message #20163 is a reply to message #20139] Mon, 23 February 2009 08:39 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Impressive work, thank you Mirek. Very Happy
Re: Subpixel rendering [message #20165 is a reply to message #20163] Mon, 23 February 2009 10:24 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I looked at the screenshots on several different LCD, and on average office LCD, they look almost identical. Upon more closer inspection, the second looks slightly better, but more blurry. On a more high quality and resolution display, the difference is more pronounced, and the second looks better, nut not universally. So I guess I vote for the second.

But were the screnshots taken under Windows? Because they both look horrible and are hard to read when compared to simple native Windows rendered text (ClearType) Smile. Maybe results are better under Linux, where antialised fonts are generally ugly.

[Updated on: Mon, 23 February 2009 10:35]

Report message to a moderator

Re: Subpixel rendering [message #20167 is a reply to message #20165] Mon, 23 February 2009 10:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 23 February 2009 04:24

I looked at the screenshots on several different LCD, and on average office LCD, they look almost identical. Upon more closer inspection, the second looks slightly better, but more blurry. On a more high quality and resolution display, the difference is more pronounced, and the second looks better, nut not universally. So I guess I vote for the second.

But were the screnshots taken under Windows? Because they both look horrible and are hard to read when compared to simple native Windows rendered text (ClearType) Smile. Maybe results are better under Linux, where antialised fonts are generally ugly.



There were some bugfixes on the way, better check PainterExample from svn...

But of course, it is not the same thing as Cleartype. Generally, Painter will always prefer subpixel accuracy, that in some cases might lead to blurring....

Mirek
Re: Subpixel rendering [message #20170 is a reply to message #20154] Mon, 23 February 2009 14:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
luzr wrote on Sun, 22 February 2009 12:52


- it can be up to 60% slower (in 'Lion' test) than normal mode



Well, after 6 hours of optimizing the crap out of it and wasting 500 more bytes of really wicked code, it is now only 40% slower in Lion test...

Mirek
Re: Subpixel rendering [message #20171 is a reply to message #20163] Mon, 23 February 2009 15:28 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

mr_ped wrote on Mon, 23 February 2009 02:39

Impressive work, thank you Mirek. Very Happy

Exactely! Can't wait for chart controls based on painter.
Re: Subpixel rendering [message #20172 is a reply to message #20139] Mon, 23 February 2009 16:23 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
I played a bit with the demo and found another small problem. If you choose Subpixel AA and you play around with the opacity slider there are some artifacts. Best seen in the RichText example.
Re: Subpixel rendering [message #20173 is a reply to message #20172] Mon, 23 February 2009 16:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Mon, 23 February 2009 10:23

I played a bit with the demo and found another small problem. If you choose Subpixel AA and you play around with the opacity slider there are some artifacts. Best seen in the RichText example.


Already fixed. At least I hope Smile

Mirek
Re: Subpixel rendering [message #20174 is a reply to message #20139] Mon, 23 February 2009 19:18 Go to previous message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
yes Wink

The google svn mirror was probably not fast enough ^^
Previous Topic: Runtime Linking
Next Topic: Painter future
Goto Forum:
  


Current Time: Fri Mar 29 09:55:15 CET 2024

Total time taken to generate the page: 0.01691 seconds