Aspect Correction - What it is & when and how to use it

General technical information about Sierra & classic games. Please do not ask game support questions here unless it directly relates to an existing thread.
Post Reply
User avatar
Collector
Grand Poobah
Posts: 11993
Joined: Wed Oct 08, 2008 12:57 am
Location: Sierraland
Contact:

Aspect Correction - What it is & when and how to use it

Post by Collector »

Aspect Correction
What it is & when and how to use it.
The Sierra EGA and early VGA games were designed for VGA Mode 13h 320x200 video mode. On the commonly available video hardware of the time with tall pixels that were 20% taller than they were wide and with fewer rows of pixels, this video mode took up the entire screen giving it a 4:3 physical aspect ratio.

When displayed on modern graphics hardware with square-pixels, 4:3 screen mode (640x480) and the same number of rows of pixels, these same graphics will appear distorted (unnaturally compressed vertically to a 16:10 aspect ratio) and letterboxed with black bars above and below. The graphics do not look as the developer intended.
Note how the circular Sierra Half Dome logo is displayed as a squat ovoid shape.
Note how the circular Sierra Half Dome logo is displayed as a squat ovoid shape.
SierraLogoNoApect.png (5.95 KiB) Viewed 19392 times
To preserve the original 4:3 ratio as the developer intended, the graphics need to be stretched vertically. This is the purpose of aspect correction. The aspect correction setting in DOSBox and ScummVM will extrapolate extra rows to extend the height and restore the 4:3 aspect ratio. Note that on modern wide screen monitors the game will be pillarboxed, but the game will be displayed properly.
Note how the Sierra Half Dome logo has been restored to its intended circular shape.
Note how the Sierra Half Dome logo has been restored to its intended circular shape.
SierraLogoApect.png (11.73 KiB) Viewed 19392 times
This distortion affects all of the graphics. Note how Graham's face looks oddly roundish without the correction while aspect correction removes this distortion. The shape of his head is closer to that of a real person's face.
Graham with no aspect correction
Graham with no aspect correction
GrahamNoAspect.png (3.97 KiB) Viewed 19392 times
Graham with aspect correction
Graham with aspect correction
GrahamAspect.png (4.16 KiB) Viewed 19392 times
Note that aspect correction is not always needed and sometimes cannot be set for one reason or another. The Sierra VESA era games used 640x480 resolution (4:3) if the VESA.DRV is set for the videoDrv setting in the game's configuration file (RESOURCE.CFG) and thus aspect correction is not needed. The ScummVM team disabled aspect correction for King's Quest VI Windows version for technical reasons for the intro AVIs to play properly. Some fan made SCI games were designed for a 16:10 ratio by not using aspect correction, so these games should not have aspect correction set. (also http://sciprogramming.com/fangames.php?eng=both )

To turn on aspect correction in DOSBox, under the [render] section of the dosbox.conf set:

Code: Select all

aspect=true
For ScummVM click the "Options..." button and under the Graphics tab in the GUI check the "Aspect ratio correction" box. If you only want to set it for just one specific game, click the "Edit Game..." button go to the Graphics tab to check the "Aspect ratio correction" box.

Then enjoy your game as Sierra intended.
01000010 01111001 01110100 01100101 00100000 01101101 01100101 00100001

Image
Asterisk
Noob
Posts: 7
Joined: Thu May 07, 2015 9:18 pm
Gender: Not Specified

Re: Aspect Correction - What it is & when and how to use it

Post by Asterisk »

Another thing to note is that DOSBox only captures raw screenshots in their original resolution, so any screenshots or video captures you take will just be straight 320x200. If you want to get upscaled but properly aspect-corrected screenshots and videos, the best way to do it is to scale the captured image up to 1600x1200 using a simple point scaler which transforms each pixel in the original image into a block of 5x6 pixels in the new image. Depending on what software you use, the filter will labelled "point" or "none", or something similar. (If you do the math, you'll find that 1600x1200 is actually the smallest resolution that can give you a pixel-perfect representation of a 300x200, 4:3 image, because the pixels themselves have an aspect ratio of 5:6, and since 5 is prime, there's no region of square pixels smaller than 5x6 that can have exactly the same shape.)

In GIMP, for example, you'd go to the "Scale Image" dialog, click on the little chain-link buttton in between the vertical and horizontal dimensions to stop it from maintaining the aspect ratio, choose "None" as the interpolation method, and then scale to 1600x1200. Then, if you want the image smaller, you can downscale it to a lower resolution, this time using one of the interpolative algorithms. You can also do all of this on the command line on either Linux or Windows with ImageMagick: I like to use the "box" filter to downscale, so my command line is usually something like:

Code: Select all

convert input.png -filter point -resize 1600x1200! -filter box -resize 800x600 output.png
For videos, you can do a similar process with tools like VirtualDub -- just set up a resize filter to scale to 1600x1200 without interpolation and with "maintain aspect" disabled, then add another subsequent filter to downscale to your desired resolution. Here's an example of the Conquests of Camelot opening sequence that I prepared in this way using AviSynth and FFmpeg. (As an aside, I used the ykhwong build of DOSBox to capture that video -- this has Munt integrated into it, so the audio you're hearing is actually the game's MT-32 music.)

By the way, note that if you're embedding a screenshot into a web page, the best thing to do is actually to scale the image up to 1600x1200, as described above, and leave it at that resolution; specify the height and the width for the image to be displayed at in your HTML or CSS. This seems a bit counterintuitive, but the 1600x1200 image will actually have a smaller filesize than an image downscaled to a lower resolution with interpolation (every block of 5x6 pixels is a completely uniform region, so it's much more compressible), and the browser itself will downscale the image quite well, with the added benefit of simply downscaling it less if the user zooms in on the page, and will still display a crisp and clear image with all of those wonderfully blocky pixels preserved. Compare these two images, for example: original 1600x1200, and a 400x300 version downscaled with the box filter in ImageMagick -- the first file is actually smaller. (I'd embed them both here if this version of phpBB supported height and width parameters for the "img" tag.)

Image
adeyke
Oldbie
Posts: 799
Joined: Wed Sep 16, 2009 11:47 pm

Re: Aspect Correction - What it is & when and how to use it

Post by adeyke »

If you actually display the image at the full 1600x1200, then it will look correct, yes. However, at any lower resolution, it will either blur colors or scale the different rows/columns differently (so a field of uniform dithering will no longer look uniform). This is a complete inevitability, regardless of what software you use (and that includes the browser).
User avatar
MusicallyInspired
Village Elder
Posts: 3143
Joined: Fri Oct 10, 2008 8:46 am
Gender: Male
Location: Manitoba, Canada
Contact:

Re: Aspect Correction - What it is & when and how to use it

Post by MusicallyInspired »

I await the day when computer displays aren't dependent on pixels at all so that emulating older 4:3 resolutions with pixels of different shapes won't be as frustrating as this.
01010100 01110010 01110101 01110011 01110100 00100000 01010100 01001000 00110001
User avatar
Qbix
DOSBox Author
Posts: 687
Joined: Sun Nov 09, 2008 4:19 pm
Location: Friesland
Contact:

Re: Aspect Correction - What it is & when and how to use it

Post by Qbix »

CRT monitors work pretty nicely..
Asterisk
Noob
Posts: 7
Joined: Thu May 07, 2015 9:18 pm
Gender: Not Specified

Re: Aspect Correction - What it is & when and how to use it

Post by Asterisk »

adeyke wrote:If you actually display the image at the full 1600x1200, then it will look correct, yes. However, at any lower resolution, it will either blur colors or scale the different rows/columns differently (so a field of uniform dithering will no longer look uniform). This is a complete inevitability, regardless of what software you use (and that includes the browser).
That's true, and you can never get any resolution that isn't a multiple of 1600x1200 to be perfect, but depending on the resolution you're scaling to and the interpolative algorithm you're using, you can minimize interference patterns, sometimes below the threshold of perception.

I've found downscaling the 1600x1200 image to 960x720 using the common Lanczos3 algorithm to work quite well with dithered EGA screenshots, and it's a perfect resolution for video. Compare the 400x300 screenshot of SQ3 I posted above, which has some noticeable interference patterns in the dithered area in the lower left, with this one, or go to about 2:00 in the Conquests of Camelot video above for an even better example.
Post Reply

Return to “Sierra Game Tech Info”