Mail Archives: djgpp/1997/11/23/20:22:15
killferfun AT aol DOT com (KillFerFun) writes:
> The problem is, I created these graphics with a ray-tracer (POVRay), and I use
> Microsoft Imager to mess with them. I resize the images (these are little
> images, 8x20 pixels) but they turn out incomprehensible and unrecognizable,
> because I resize them from about 100x150 to 8x20. I mean to use these things as
> little sprite-like soldiers for a Warcraft ripoff game. (You don't have to tell
> me that Im going beyond myself here, I know that perfectly well :)
> More comments? Thanks...
If you use Allegro's stretch_blit, then it may be your problem.
I think, when it scales bitmap down, it divides width and height
of original bitmap on width and height of resulting bitmap, and
each pixel in target bitmap is is taken as an upper-left pixel
in corresponding part from original bitmap.
+-+-+-+-+-+-+-+-+-+
|o |o |o | Original bitmap (9 pixels wide),
|| || || | divided on 3 boxes
| | |
+---+ | +---+
| | |
V V V
+-+-+-+
| | | | Target bitmap (3 pixels wide)
This scheme is not symmetrical. It will be more symmetrical
if you take central pixel from each box as a value for target pixel.
Another idea is to use rgb components of all pixels in a box to
create rgb components of target bitmap (and use makecol to convert
it into color index). Simple one is just calculate average
of each red, green and blue. Or calculate average with weights.
Central pixels in a box have more weight...
This may have a little problem. You may have no transparent color
in resulting bitmap made in this way. You can try to solve it
by calculating the number of transparent pixels in original bitmap.
If their number is large (say, more than half of all pixels number),
then put transparent pixel in target bitmap.
- Raw text -