Browse Prior Art Database

Changing the Size of Bitmaps

IP.com Disclosure Number: IPCOM000117982D
Original Publication Date: 1996-Aug-01
Included in the Prior Art Database: 2005-Mar-31
Document File: 2 page(s) / 80K

Publishing Venue

IBM

Related People

Griffiths, E: AUTHOR

Abstract

Conventional methods of changing the size of bitmaps require bit shifting and logical operations for every single pixel of the input and/or output image. This can make the operation very slow, especially on very large images such as maps, technical drawings, etc.. This problem is difficult to overcome because computers do not usually provide a method of accessing individual bits to the reduction in size which must be done by using the shift and logical operators that allow individual bit manipulation.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 53% of the total text.

Changing the Size of Bitmaps

      Conventional methods of changing the size of bitmaps require
bit shifting and logical operations for every single pixel of the
input and/or output image.  This can make the operation very slow,
especially on very large images such as maps, technical drawings,
etc..  This problem is difficult to overcome because computers do not
usually provide a method of accessing individual bits to the
reduction in size which must be done by using the shift and logical
operators that allow individual bit manipulation.

      The solution described here makes use of a Look Up Table
(LUT) which replaces the shift and logical operations with an index
operation into the LUT followed by a logical OR to insert the value
from the LUT into the output image.  This results in much faster
scaling of the image.

      This solution assumes that the minimum addressable unit on
the computer is a byte and that the computer may allow larger units
(e.g., two bytes or four bytes) to also be addressed as a unit for
computation.

      The method relies on using the numerical value of the input
byte to index into a LUT which maps that value into a bit pattern
that represents the input byte either expanded or reduced by a
certain scale  factor.  The bit pattern is then copied into the
output image in the appropriate place.  Because input bytes are taken
one at a time and mapped to an output bit pattern in one operation it
is possible to reduce  not only the number of loop iterations to
process an image (i.e., one loop iteration per eight input bits) but
also the need to use shifting  and logical operations to find out the
value of a bit and then insert corresponding bits into the output
image.

A typical sequence would be:
  1.  Build the appropriate LUT for the given scale factor
  2.  Loop through the input image one byte at a time
  3.  Use each byte value as an index into the LUT
  4.  Use a logical OR, an assignment or even a memory copy
       operation to move the LUT bit pattern into the output image.

The following factors should be taken into account:
  o  The input image is taken one byte at a time because this means
      that the LUT nee...