<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thank you, Kevin - the image got much better. JPG accepts the "quality" tag (ex.: quality=95). Still, as someone pointed out, it seems I should try other formats like TIFF or PNG.<br><br>Eduardo<br><br><hr id="stopSpelling">CC: image-sig@python.org<br>From: kevin@cazabon.com<br>To: eismb@hotmail.com<br>Subject: Re: [Image-SIG] PIL - problem with crop()<br>Date: Mon, 27 Apr 2009 06:58:36 -0400<br><br>are you setting the resolution when re-saving as a PDF in PIL? &nbsp;That would explain the scaling issue, and likely the quality too.<div><br></div><div>PIL now supports resolution settings for most common file formats - add a dpi=300 tag when saving, for example:</div><div><br></div><div>im.save("test.pdf", dpi=300)</div><div><br></div><div>Kevin.</div><div><br></div><div><br></div><div><br><div><div>On 26 Apr 2009, at 16:53, Eduardo Ismael wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana;">Hi!<br><br>I have a bunch of .jpg images of 2866 x 4047. When I right-click on them and use the "Convert to Adobe PDF" option from Acrobat, an Acrobat window opens showing the document with great quality and zoom of 121% - and if I zoom down to 100%, it looks like the original quality.<br><br>However, I would like to crop the bottom of all pages before conveting to PDF, so i get back to the original and use "im.crop((0, 0, 2866, 3760))".<br><br>Now, if I use the method above to convert to PDF, the PDF will open at 21,9% - the image got much bigger! - and if I zoom up to 100%, it gets awful. I understand PIl is not only cropping the image, but also affecting its quality.<br><br>Any suggestions on how to avoid that?<br><br>Here is the complete script:<br><dl class="EC_codebox"><dd><code>import os, Image<br><br>preCropFolder = "C:\\PDF\\preCropFolder"<br>postCropFolder = "C:\\PDF\\postCropFolder"<br><br><br>inputImages = os.listdir(preCropFolder)<br><br>for file in inputImages:<br>&nbsp; &nbsp; eachImage = preCropFolder + "\\" + file<br>&nbsp; &nbsp; im = Image.open(eachImage)<br>&nbsp; &nbsp; im = im.crop((0, 0, 2866, 3760)) # original is<span class="EC_Apple-converted-space">&nbsp;</span></code>2866 x 4047<br><code>&nbsp; &nbsp; eachImage = postCropFolder + "\\" + file</code></dd></dl><br><hr>Quer saber qual produto Windows Live combina melhor com o seu perfil?<span class="EC_Apple-converted-space">&nbsp;</span><a href="http://www.windowslive.com.br">Clique aqui e descubra!</a><span class="EC_Apple-converted-space">&nbsp;</span>_______________________________________________<br>Image-SIG maillist &nbsp;- &nbsp;<a href="mailto:Image-SIG@python.org">Image-SIG@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/image-sig">http://mail.python.org/mailman/listinfo/image-sig</a><br></div></span></blockquote></div><br></div><br /><hr />Quer deixar seu Messenger turbinado de emoticons? <a href='http://specials.br.msn.com/ilovemessenger/pacotes.aspx' target='_new'>Clique aqui e baixe agora. É grátis!</a></body>
</html>