Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!agate!bionet!csd4.milw.wisc.edu!leah!itsgw!rpi!sun.soe.clarkson.edu!nelson From: nelson@sun.soe.clarkson.edu (Russ Nelson) Newsgroups: comp.graphics Subject: Re: stretching an image Message-ID: Date: 9 Jan 89 14:56:06 GMT References: <8698@bloom-beacon.MIT.EDU> Sender: news@sun.soe.clarkson.edu Reply-To: nelson@clutx.clarkson.edu Organization: Clarkson University, Postdam NY Lines: 24 In-reply-to: hackeron@athena.mit.edu's message of 9 Jan 89 09:26:45 GMT I've done it before, and I couldn't find nor create a way that's any better than the obvious method: o Do a Bresenham's substituting OLD X for X and NEW X for Y. o With this list of X coordinates, do a Bresenham's substituting OLD Y for X and NEW Y for Y. (Y can be a function of X if desired. This lets you stretch four sided rhombuses). o If you have more new pixels than old (in Bresenham's concepts, the line's slope is greater than 45 degrees) then you need to replicate old pixels. This works pretty well in most cases. o If you have more old pixels than new then you have a decision to make. You can either drop "extra" pixels (okay for continuous tone images, crummy for line images) or you can compute an average and truncate or you can do a Floyd-Steinburg dither, or any other technique for discarding information in a controlled manner or you can preserve black pixels (good for black on white line images) or you can preserve white pixels (good for white on black line images). Can anyone help Harris and I by providing a better algorithm? -- --russ (nelson@clutx [.bitnet | .clarkson.edu]) "I saved the whales!" - Rebecca L. Nelson, 3.5 years old, on receiving her Christmas present of a whale "adoption" certificate. Bless her liberal heart.