Date: Sat, 3 May 1997 18:27:38 -0400 (EDT) From: Dave Coffin To: xvtech@trilon.com Subject: Improved smoothing algorithm for XV Hello, I just rewrote the Smooth24() routine, which implements the Smooth command on the Display Menu. Contrary to its name, this routine is not intended for "smoothing", but for interpolating a smaller image into a larger one. The problems I've found with Smooth24() are: (a) It's slow. (b) It's imprecise. (c) It shifts the input image down and right by 0.5 pixel. (d) Because of (c), increasing one dimension of the image causes *both* dimensions to get blurred. The last one is especially annoying with a Canon Powershot 600. This camera produces 832x608 images that must be resized to 832x624 for the proper aspect ratio. Smooth24() causes these pictures to lose focus. My Smooth24() routine: (a) Runs twice as fast. (b) Delays all rounding until the last possible moment. (c) Does not shift the input image. (d) Interpolates only in the directions that have changed size. To see the difference in precision, load the enclosed 3x3 image, blow it up to cover most of the screen, and smooth it. If you want to include my code in the next release, there's one caveat. I assume that using the '>>' operator on a signed integer performs an arithmetic right shift. That may not true for all CPUs and compilers. Please don't take me for a whiner, I really love XV... Dave Coffin 5/3/97