Dismiss
InnovationQ will be updated on Sunday, Jan. 21, from 9am - 11am ET. You may experience brief service interruptions during that time.
Browse Prior Art Database

# Approximation of Two-Dimensional Scale Factors, or Resolutions, Preserving Aspect Ratio

IP.com Disclosure Number: IPCOM000038825D
Original Publication Date: 1987-Mar-01
Included in the Prior Art Database: 2005-Feb-01
Document File: 3 page(s) / 80K

IBM

## Related People

Friend, DJ: AUTHOR

## Abstract

This article describes a technique for the approximation of two-dimensional scale factors, or resolutions, preserving aspect ratio. The basic concept is: having made an approximation in the x- direction, then the target y-scale factor is compensated by the same ratio - so preserving overall aspect ratio. That is having been forced to compromise an x-scale factor, there is no further penalty in compromising the y-scale factor by (up to) the same amount. The algorithm can be simplified into just a few statements. Problem solved by this invention When scaling an Image (or Graphics) picture in both the x and y dimensions, and the scale factors have to be chosen from a set of fixed values, the problem is how to choose values which most nearly give the desired aspect ratio.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 3

Approximation of Two-Dimensional Scale Factors, or Resolutions, Preserving Aspect Ratio

This article describes a technique for the approximation of two-dimensional scale factors, or resolutions, preserving aspect ratio. The basic concept is: having made an approximation in the x- direction, then the target y-scale factor is compensated by the same ratio - so preserving overall aspect ratio. That is having been forced to compromise an x-scale factor, there is no further penalty in compromising the y-scale factor by (up to) the same amount. The algorithm can be simplified into just a few statements. Problem solved by this invention When scaling an Image (or Graphics) picture in both the x and y dimensions, and the scale factors have to be chosen from a set of fixed values, the problem is how to choose values which most nearly give the desired aspect ratio. Discussion The problem is equivalent to the following: given a set of pairs of points in a plane, find the pair which is "nearest" to a specified point. There is no obvious measure of the "distance between" two points when each point represents a pair of scale-factors (resolutions, ratios, or multipliers). This discussion explains the problem with conventional measures, and the solution describes a simple algorithm which defines a two-dimensional measure in such a way as to bias it towards preserving aspect ratio when the points are used as scale- factors. First, consider the one-dimensional case, with two points: p and q. Since these points represent multipliers, we use their ratio as a measure of the "distance" between them: MAX (p/q, q/p) (to give the ratio >=1) Next, consider the two-dimensional case, with two points: (x1, y1) and (x2, y2). If we define the distance between these as the product of the distances between (x1 and x2) and (y1 and y2): MAX (x1/x2, x2/x1) * MAX (y1/y2, y2/y1) then we get the following properties: 1.The set of points equidistant from a given point C is shown (on logarithmic scales) in Fig. 1, using conventional measuring techniques. 2.The sets of points nearest to each corner of a rectangle are shown conventionally in Fig. 2, which is divided into four regions of points to which each corner is nearest. In this diagram, the "center" point is unstable because points near to it approximate to four different corners. The particular problem is the regions associated with the top-left and bottom-right corners, which represent changes of aspect ratio when scaling is applied. Since these two regions meet, a small change of scale factor near the center point could cause dramatic changes of aspect ratio. Solution A better division of t...