Log in

View Full Version : The secrets of Pocket Internet Explorer/VGA rendering explored with some practical/useful advice


Menneisyys
04-23-2005, 02:35 PM
A lot of people have been discussing the problem of pixel doubling in Pocket Internet Explorer (PIE) on current VGA devices in the default SE VGA mode (that is, not using a tool like ozVGA or SE_VGA - please read, for example, mr_Ray's explanation of the meaning of the different VGA modes at http://www.firstloox.org//forums/showthread.php?t=3052 ). The problem is a very interesting one; therefore, I've decided to make some experiments.

I've captured several screenshots of text on screen in several resolutions to see how the image stretching / double pixeling algorithm works in PIE. I'd say it was certainly worth the effort - now, I know a lot more about how PIE works (and this info has never been published before either)!

I've made sure the character set/size that the original images use don't really span two adjacent rows/columns. This way, both the lack and the doubling of a particular pixel column/row can easily be spotted. As is with the resolution, of course. (Incidentally, I've used similar, textual stuff in my image viewer roundup at http://menneisyys.freeweb.hu/PICVIEWERS to be absolutely sure the given image viewer is capable of rendering an image in full VGA resolution, and not with just pixel doubling. With a "real-life" photo of anything "real", and not a screenshot of, say, fine-printed text, flowcharts or other machine-generated stuff, checking the effective resolution would have been much harder.)

These experiments were pretty useful in that they clearly show the problems related to using the default SE mode for, say, browsing images containing text, hand-drawings, flowcharts and the like. The stretching of PIE in SE VGA applies to medium-sized images (exact sizes/image size categories are to be mentioned below) can really make the readibility of the given image horrible. Then, simply switching to native VGA mode and/or the Desktop view will cure the problem.

The SE-mode algorithm is pretty logical: with small images that, when pixel-doubled, will still fit in the available (horizontal) screen estate, it uses pixel doubling, while with images that are (horizontally) larger than half of the (horizontal) available screen estate for displaying images, aren't - they're "only" streched, which may result in unwanted, aesthetically unpleasing results.

This distinction, however, only works in Default/One Column view; in Desktop view, pixel-doubling is always used, no matter what the original sizes are.

Incidentally, these three view modes are the view modes available in PIE shipped with WM2003SE devices. The first two tries to "crunch" everything to the available horizontal screen estate; the third doesn't. This makes the last mode impossible to use in most cases. Images that aren't in a vertical frame-table cell are always crunched successfully, but tables that have too many columns are only with varying success - in my article on CHM readers at http://menneisyys.freeweb.hu/chm , I've shown the horizontal scrolling problems caused by "wide tables". That's another problem of PIE in SE and another reason for switching entirely to native VGA mode when using PIE (or, for that matter, forgetting PIE entirely and switching to Netfront in forced/native VGA mode.)

So, this is how the image rendering algorithm works (only for the Default/One Column view and, again, only in the default SE VGA mode, not in true VGA):

- small images: when it encounters images that are thinner than half of the available screen area for HTML/image rendering (that is, in Portrait mode, thinner than about 210-220 pixels and, in Landscape mode, about 290-300 pixels), they are always pixel doubled. This means the real resolution of these images is QVGA.

- medium-sized images: images that are wider than the above-mentioned horizontal sizes but are still thinner than the real screen estate (two times the sizes cited above) are streched to the full available screen estate. This, of course, can result in aesthetically really unpleasing images, especially with images containing text. (Check out the 400*400 test image below, in Portrait mode - it's streched a bit, about 10%; this is why some, once in about every ten, of its vertical and horizontal pixel rows are doubled. This effect is especially visible in some of the screenshots below.) Now, as opposed to the first case, no pixel doubling takes place.

- large images: images wider than the available horizontal screen estate are resized to fit in there. This is visible in the shots below too. An example of this is the 450*450 image in Portrait, SE. As the available screen estate for images in Portrait mode is some 440 pixels, PIE "crunched" the image by dropping about one row/column in every 45. This is why some original columns are simply missing, and some letters are, therefore, next to unreadable.

In native VGA (up to now, I've only discussed the default SE mode), on the other hand, the situation is entirely different. No pixel doubling takes place in any (Desktop vs. the other two) mode and images that are wider than half of the screen aren't streched either. The latter means medium-sized images aren't resized to fill in the entire available horizontal screen estate. Large images are indeed crunched, but only if you use the One column/Default view, and not in Desktop mode.

And, as the last question, what happens if a third-party application (for example, a CHM viewer - all CHM viewers except for uBook) uses the PIE HTML renderer to render HTML with inline images? Images will always be pixel doubled in SE, no matter their size. Therefore, you will want to resort to sticking to native VGA mode for browsing CHM files having some important inline images - for example, technical stuff, help files etc.

Bottom line: now, you know when to switch to native VGA mode to avoid the controversial effects of, say, image stretching and what happens to images of different width.


Actual screenshots:

The test images can be found at http://menneisyys.freeweb.hu/PIErescheck .

Some screenshots in Portrait mode on a VGA device (horizontal screen estate is about 440 pixels in SE and about 460 pixels in native VGA):

Default/One Column view, SE:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault1.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault2.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault3.gif

As can be clearly seen, the first two image with 100 and 200 pixels are thinner than half of the available horizontal screen estate and are, therefore, pixel doubled. The third and the fourth image, which are middle-sized, are streched to occupy the available 440 pixels. The fifth image, which is 450 pixels wide, already has some missing pixel rows/columns, which certainly shows it has been crunched. And, the same is true of all the images of higher resolution.


Desktop view, SE:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDesktop1.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDesktop2.gif

Nothing to be said here: all images are pixel doubled; no streching/crunching takes place.


Default/One Column view, native VGA mode:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADefault1.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADefault2.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADefault3.gif

There is no pixel doubling for small images. No stretching for medium-sized images either, unlike the case with SE. The 450x450 image, because the available horizontal screen estate is a bit more than 450 pixels (the scrollbar and the white borders are thinner than in SE) isn't crunched either, unlike the case with SE. Larger images are, however, crunched, as you can expect from the Default/One Column view mode.

Desktop view, native VGA mode:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADesktop1.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADesktop2.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestTrueVGADesktop3.gif

Nothing interesting in here. The difference between the previous (native VGA, Default/One Column view, Portrait) mode is that it doesn't crunch images into the available horiz. screen estate.

Finally, some screenshots in Landscape mode (horizontal screen estate is about 605 pixels in SE and about 620 pixels in native VGA). The point in these tests (as opposed to Portrait tests) was to find out that PIE indeed dynamically changes between the two SE algorithms, depending on the actual orientation. That is, the images are pixel-doubled/streched according to the current (landscape) horizontal screen estate and not to the portrait screen estate.


Default/One Column view, SE:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault1L.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault2L.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault3L.gif

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDefault4L.gif

Of interest are the 300x300 and the 400x400 images (both on the second shot). The image with the width of 300 pixels are pixel doubled because the current (landscape) screen estate is a bit above 600 pixels. The 400 image is streched. Incidentally, the width of the 600x600 image is so close to the available (landscape) screen estate that almost no effect of stretching is visible. (Only very few pixel lines are doubled, if any.)

Desktop Column view, SE:

http://menneisyys.freeweb.hu/PIErescheck/PIEResolutionTestDesktop1L.gif

Nothing new in here - everything is pixel-doubled.

whydidnt
04-24-2005, 04:00 AM
Thank you for the very informative post. This helps explain why images always appear mangled in PIE in SE VGA mode.

However, it doesn't explain what the heck MS's software engineer's were thinking when they thought up this perfectly illogical way to render images in PIE. :evil:

F_B_i
04-24-2005, 04:01 AM
fine, but where are the pictures in your msg?? :roll:

Darius Wey
04-24-2005, 04:17 AM
fine, but where are the pictures in your msg?? :roll:

They are there. Ensure your browser (or firewall) is not blocking the display of images.

MitchellO
04-24-2005, 06:44 AM
Good post. I was a bit confused, but none the less quite good. Finally, someone who attempts to explain the "thinking" (or lack of) as Micro$oft.

I wish i had a VGA pda. I would run it in the real vga all the time, as i do a good deal of websurfing and msn on my current ppc, and its only qvga!!

Menneisyys
04-24-2005, 06:46 AM
Thank you for the very informative post. This helps explain why images always appear mangled in PIE in SE VGA mode.

However, it doesn't explain what the heck MS's software engineer's were thinking when they thought up this perfectly illogical way to render images in PIE. :evil:

Pixel doubling is logical in SE if you take into account that some of small-sized images are icons (menu items, submit buttons etc) to click on. Then, may indeed be better, accessibility-wise, to have them larger in the small VGA screen.

Unfortunately, all the other effects in SE mode, particularly, the image streching for middle-sized images, can be a real pain the back. The same stands for the unavoidable pixel doubling in third party programs (all CHM readers that use the PIE engine etc.) and the wide table problem. So, I'd say the current rendering algorithm of PIE is indeed pretty much messed up.

whydidnt
04-24-2005, 03:42 PM
Pixel doubling is logical in SE if you take into account that some of small-sized images are icons (menu items, submit buttons etc) to click on. Then, may indeed be better, accessibility-wise, to have them larger in the small VGA screen.

Well, that helps me understand a little better and makes some sense. It would seem to me the default should be NOT to pixel double. That way we could view web pages as intended. They could surely add a button to PIE that you could use to toggle this "feature" on if needed to better view menu items, etc. Of course that would be logical.... :wink:

PR.
04-25-2005, 09:42 AM
Seing as SE has the option to shrink the text so small you need a magnifying glass to read it why be so awkward about images? :(

Menneisyys
04-28-2005, 03:07 PM
Now, some additional images. I've reduced the height of the images so that they can all be seen at once. This shows the effect of pixel doubling/stretching/compression even better. Note that I only took shots in Default view (that is, there're no Desktop view shots).

Orginal test link: http://menneisyys.freeweb.hu/PIErescheck/addon.html


SE VGA, landscape:
http://menneisyys.freeweb.hu/PIErescheck/PIEResCheckFlat-L-SE.gif


SE VGA, portrait:
http://menneisyys.freeweb.hu/PIErescheck/PIEResCheckFlat-P-SE.gif


Native VGA, landscape:
http://menneisyys.freeweb.hu/PIErescheck/PIEResCheckFlat-L-native.gif


Native VGA, portrait:
http://menneisyys.freeweb.hu/PIErescheck/PIEResCheckFlat-P-native.gif

Menneisyys
04-28-2005, 05:06 PM
Over at PM ( http://www.pocketmatrix.com/forums/viewtopic.php?t=21256 ) and here at PPCThoughs ( http://www.pocketpcthoughts.com/forums/viewtopic.php?t=39489&start=20 ) there have been some questions about whether PIE plug-ins affect the above-explained behaviour of PIE. This is why I also took some new shots, now with all the available PIE plug-ins (the latest Spb Pocket Plus has the same effect - that is, the lack of it -, so I haven't made shots of it).

Unfortunately, all PIE plug-ins (including ftxPBrowser using the forced VGA hack) leave the standard SE PIE image rendering algorithm intact. I've made some example screenshots of this:

Latest ftxPBrowser, forced VGA:
http://menneisyys.freeweb.hu/PIErescheck/ftxPBrowser-forced.gif

Latest ftxPBrowser without any hack:
http://menneisyys.freeweb.hu/PIErescheck/ftxPbrowser.gif

Latest MultiIE, native VGA (all the other shots are in SE!):
http://menneisyys.freeweb.hu/PIErescheck/MultiIE-P-native.gif

Latest MultiIE
http://menneisyys.freeweb.hu/PIErescheck/MultiIE-P-SE.gif

Latest (3.0 beta2, see my review of it at, say, http://www.pocketmatrix.com/forums/viewtopic.php?t=20782 ) PIEPlus
http://menneisyys.freeweb.hu/PIErescheck/PIEPlus-P-SE.gif

Incidentally, I've also made some shots of both NetFront 3.1 and 3.2, in SE, using Smartfit (which, when displaying images, works the same as Justfit). Both 3.1 and 3.2 requires the forced VGA mode hack (and, in addition, the 3.1 an additional DLL hack) to display Web content without pixel doubling. As can clearly be seen, no pixel doubling takes place (in SE):

http://menneisyys.freeweb.hu/PIErescheck/NF31-Smartfit-ForcedVGA-P-SE.gif
http://menneisyys.freeweb.hu/PIErescheck/NF31-Smartfit-P-SE.gif
http://menneisyys.freeweb.hu/PIErescheck/NF32-Smartfit-ForcedVGA-P-SE.gif
http://menneisyys.freeweb.hu/PIErescheck/NF32-Smartfit-P-SE.gif

Jonathon Watkins
05-09-2005, 08:45 PM
Interesting stuff. Thanks for your work on this Menneisyys. 8)

bigray327
06-23-2005, 03:15 PM
Seems like some enterprising programmer could make a lot of money by making some software to disable the pixel doubling. Paging ctitanic, ctitanic please pick up the white courtesy phone.