[plt-scheme] slideshow/textpic bitmaps

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Mar 14 08:14:26 EST 2004

At Sun, 14 Mar 2004 06:44:29 -0500, Daniel Silva wrote:
> why does an image look pixelated when blown up for a larger screen
> even when the final size is less than or equal to the image's
> original dimension?

Perhaps the scaling process could be better.

Which platform are you using? If scaling looks bad mainly under X, it
could be improved easily, since we implement scaling ourselves.
Currently, scaling just copies or deletes rows/columns, and probably it
looks worse than for other platforms. Under Mac OS, I'm fairly certain
that scaling averages pixels. Under Windows, I'm not sure, and perhaps
it depends on the display driver.

> That is, in the following
> code:
> (scale (bitmap "filename.png") 0.10)
> is the image first blown up to 156.25% its original size (to fit a
> 1600x1200 screen), creating a new pixelated larger image that is then
> scaled down by 10%? Or is the image first scaled down by 10%, creating
> a new smaller image that is then blown up by 156.25%?

Neither. The image is scaled directly by 15.625%.

In particular, `size-in-pixels' just calls `scale' with factors that
cancel scaling for the current screen.

> Maybe a pict struct could hold the original image buffer and a
> scaling factor that's applied on display

Just to be clear, that's effectively what happens now, because all
scaling is through dc<%>'s `set-scale' at display time.


Posted on the users mailing list.