Python - how to make BMP into JPEG or PDF? so that the file size is not 50MB but less?
<p>I have a scanner when i scan the page it makes a BMP file but the size per page is 50MB. How do i tell Python, make it JPEG and small size.</p>

<pre><code>rv = ss.XferImageNatively()
if rv:
(handle, count) = rv
twain.DIBToBMFile(handle,'imageName.bmp')
</code></pre>

<p>how do you tell him to make it JPEG or PDF? ( Native transfers are always uncompressed images, so your image size will be:
(width-in-inches * dpi) * (height-in-inches * dpi) * bytes-per-pixel)</p>