Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!rutgers!dimacs.rutgers.edu!bcm!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Re: Zooming Message-ID: <2631@gazette.bcm.tmc.edu> Date: 7 Nov 90 15:47:40 GMT References: <55592@brunix.UUCP> Sender: usenet@bcm.tmc.edu Reply-To: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Organization: Baylor College of Medicine, Houston, Tx Lines: 20 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu You can't do this explicitly in X. The VERY easiest method is as follows: Assume original image I1 with dimensions m x n Assume new image I2 with dimensions M x N Each pixel I2(x,y) = I1(x * m / M,y * n / N) This is a good first try. Better algorithms utilize smoothing for enlarging images and averaging for shrinking images. These alogorithms, however, assume a sophisicated color scheme for 8 bit machines. -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bmc.tmc.edu (713) 798-3776