[Image-SIG] Aliasing problem using PIL ..

Bryan Lawrence b.n.lawrence@rl.ac.uk
Sun, 2 Feb 2003 18:28:31 +0000


Hi Folks

I'm a novice at this stuff, and was playing at producing a tool for making
photo-albums (yes I know there are plenty out there, but I wanted to
do it for myself) ... anyway, the following piece of code works but doesn't
give the quality of results i expected. Basically what I want to do is
embed images on a page at various places and with various sizes.
Sounds easy. When I do this the output looks terrible. In the example
below the tmp.jpg file looks fine, but the bad.jpg file looks terrible - 
whether on the screen or after printing.

import Image
outsize=4800,6600
#make a blank white image which should be ok at 300 dpi on A4
#I figured on having enough pixels so that there should be no
#interpolation required. NB printer is hp psc2115 on linux
output=Image.new('RGB',outsize,(255,255,255))
#tmp.jpg is 1310x1310 ...
panel_member=Image.open('tmp.jpg')
#embed tmp.jpg as a small picture near the top right of the page
output.paste(panel_member,(250,250))
output.save('bad.jpg')

I'd be happy to supply an example jpg if anyone wants to try this ...


I suspect I'm doing something stupid ... can anyone tell me what?
Apologies in advance if this is the wrong place for this query, if
so can you please  tell me the right place.

I'm not on the mailing list, so could you please copy me any replies!

Thanks in advance,
Bryan