Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!peregrine!falk From: falk@peregrine.Sun.COM (Ed Falk) Newsgroups: comp.graphics Subject: Re: Fast Image Scaling Message-ID: <1526@exodus.Eng.Sun.COM> Date: 19 Oct 90 01:30:54 GMT References: <1990Oct18.014905.1846@lia> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 58 In article <1990Oct18.014905.1846@lia> jgro@lia.com (Jeremy Grodberg) writes: > >Does anyone have any references on raster image scaling that is *FAST*, >even if it is slightly non-optimal. I need to do arbitrary scaling of >1-bit-per-pixel images as fast as possible, and am not too concerned with >optimum averaging or stuffing of the reduced or expanded pixels. What I >am concerned with is scaling a 2MB source image in 1-2 seconds on a >SPARCstation. Note that I can't take advantage of simple power-of-2 >optimizations. What you obviously want to do is drop rows and columns out of the image. The "simple power-of-2" method you refer to is the most obvious one, simply drop alternate rows and columns: for(i=0; i 0 ) { ++ix ; cx -= ow ; } } cy += ih ; while( cy > 0 ) { ++iy ; cy -= oh ; } } This should work for scaling in either direction. I haven't tried it. -ed falk, sun microsystems sun!falk, falk@sun.com card-carrying ACLU member.