PDA

View Full Version : How to convert scans to reasonable size?


svga
08-07-2009, 05:01 PM
First my environment:
Hardware: Epson Perfection V200 Photo scanner
Software: xsane-0.995 (Linux)

I scan magazines at 300dpi with this environment, which produces PNM files which are about 25MB (2544x3509 pixel, depth 24). Of course I can't (or am not willing) upload these images directly to an image hoster. Therefore I currently convert the images with the convert program from ImageMagick (www.imagemagick.org):

convert -resize '1680x1680>' infile outfile.jpg;

This produces images with a maximum side length of 1680 pixels, the image size is about 300 KB.

My question: Is there a better way to compress the images to a reasonable size?

Xxphd
08-07-2009, 06:31 PM
I always batch-convert with GraphicConverter

PICT 32 bit -> jpeg

svga
08-07-2009, 07:03 PM
Thanks for the response, butI have to rephrase my question: Is there a better way to get a better quality/image size (in bytes) ratio?

One example: I've converted the same scan with two different options to approximately the same size (380 kB):

1st Conversion: convert -resize '1680x1680>' page26.pnm page26-1680x1680.jpg (uses standard compression 85):
http://img235.imagevenue.com/loc391/th_71408_page26-1680x1680_123_391lo.jpg (http://img235.imagevenue.com/img.php?image=71408_page26-1680x1680_123_391lo.jpg)

2nd Conversion: convert -quality 27 page26.pnm page26-q27.jpg (this sets the "JPEG compression" to 27 without changing the image size):
http://img162.imagevenue.com/loc895/th_74726_page26-q27_123_895lo.jpg (http://img162.imagevenue.com/img.php?image=74726_page26-q27_123_895lo.jpg)

Which one is better?

Of course proposals for other programs which produce better results are welcome

icu
08-08-2009, 03:09 PM
Panorama : resize / resample

http://img188.imagevenue.com/loc647/th_42816_00000002_123_647lo.jpg (http://img188.imagevenue.com/img.php?image=42816_00000002_123_647lo.jpg)

left origin 95%, middle resize + zoom , right resample + zoom. ( irfanview )

The resample function in Irfanview softens during the resample and reduces the filesize.



Panorama: jpg compression

http://img257.imagevenue.com/loc370/th_43539_95_123_370lo.jpg (http://img257.imagevenue.com/img.php?image=43539_95_123_370lo.jpg)

from left to right:
100%, 501KB
60%, 69KB
95%, 302KB
85%, 156KB

It can be useful to save with high compression values ( 85%+ ) if the pic contains reflexions ( metal, fingernails, hair, ... ). Lower compression values decreases the depth effect due to lower brilliance.

Jism Jim
08-08-2009, 04:32 PM
I scan magazines at 300dpi with this environment, which produces PNM files which are about 25MB (2544x3509 pixel, depth 24).
Can your scanning software produce bitmap files too? If so, this will increase your choice of converting software.
I don't know about Linux, but I use Irfanview myself. IMO it produces very good results with the quality setting at 80%.

svga
08-08-2009, 04:43 PM
Can your scanning software produce bitmap files too? If so, this will increase your choice of converting software.
I don't know about Linux, but I use Irfanview myself. IMO it produces very good results with the quality setting at 80%.

No, the software itself can only produce PNM, but the formats are similar and I can convert to BMP with another tool without any loss of information.

Xxphd
08-08-2009, 05:22 PM
I scan magazines at 300dpi with this environment, which produces PNM files which are about 25MB (2544x3509 pixel, depth 24).

producing a BMP or PICT will reduce the size to about 50% or even less of that I guess

svga
08-08-2009, 06:16 PM
producing a BMP or PICT will reduce the size to about 50% or even less of that I guess

No, it's almost the same size (26781040 respective 26780742 bytes in the example):


> convert page26.pnm page26.bmp # converts PNM to BMP (lossless)
> ls -l
-rw-r----- 1 anon anon 26781040 Jun 26 23:43 page26.pnm
-rw-r--r-- 1 anon anon 26780742 Aug 8 18:41 page26.bmp


As far as I know PNM has also an ASCII representation instead of using raw binary data. If this would be used you would be right.

PNM and BMP are almost the same formats, they store for every pixel the full information (e..g. 24 bits RGB value or 8 bit grey value).

tuffy
08-08-2009, 08:33 PM
Thanks for the response, butI have to rephrase my question: Is there a better way to get a better quality/image size (in bytes) ratio?

One example: I've converted the same scan with two different options to approximately the same size (380 kB):

1st Conversion: convert -resize '1680x1680>' page26.pnm page26-1680x1680.jpg (uses standard compression 85):
http://img235.imagevenue.com/loc391/th_71408_page26-1680x1680_123_391lo.jpg (http://img235.imagevenue.com/img.php?image=71408_page26-1680x1680_123_391lo.jpg)

2nd Conversion: convert -quality 27 page26.pnm page26-q27.jpg (this sets the "JPEG compression" to 27 without changing the image size):
http://img162.imagevenue.com/loc895/th_74726_page26-q27_123_895lo.jpg (http://img162.imagevenue.com/img.php?image=74726_page26-q27_123_895lo.jpg)

Which one is better?

Of course proposals for other programs which produce better results are welcome

Which one is better?

The first picture.

Why?

Because the second picture has too many JPEG artifacts.(the Quality=27 is too low)

There is a problem here, the first picture's size is 1218x1680 (resized 50%), the second picture's size is 2544x3509. It's not easy to compare them when they have different sizes.

Is there a better way to get a better quality/image size (in bytes) ratio?

No. If you want good quality you pay with a bigger file size.

The JPEG compression is lossy, you can use it with Quality setting between 70-100, 85 is a good compromise.

Some HQ (big sizes) examples:

1. 200dpi descreen on - 600kB
http://img262.imagevenue.com/loc137/th_75281_1_NC89_CC_p06_200dpi_1313x1889_descr_on_1 23_137lo.jpg (http://img262.imagevenue.com/img.php?image=75281_1_NC89_CC_p06_200dpi_1313x1889 _descr_on_123_137lo.jpg)

3. 300dpi descreen off, edited - 1MB
http://img209.imagevenue.com/loc432/th_75294_3_NC89_CC_p06_300dpi_1969x2824_descr_off_ e_123_432lo.jpg (http://img209.imagevenue.com/img.php?image=75294_3_NC89_CC_p06_300dpi_1969x2824 _descr_off_e_123_432lo.jpg)

5. 300dpi descreen on, edited - 1MB
http://img142.imagevenue.com/loc443/th_75300_5_NC89_CC_p06_300dpi_1969x2825_descr_on_e _123_443lo.jpg (http://img142.imagevenue.com/img.php?image=75300_5_NC89_CC_p06_300dpi_1969x2825 _descr_on_e_123_443lo.jpg)

It's interesting that the 300dpi pic with descreen ON has a little moire, and with descreen OFF no moire.

Tuffy

beutelwolf
03-15-2012, 11:20 AM
Back in the days when I was fiddling with these options, my rule of thumb was: scan with high resolution, reduce afterwards - although I left the reduction to a picture editor (PaintShop Pro), not the scanning software. Though this may have also been influenced by the tiny little issue that my first scanners didn't support picture reduction.:rolleyes:

Anyway, that strategy that seemed to help with Moire patterns. When I got Moire with scanning at 300dpi I moved to 500pdi or even 1000dpi, creating a monster-sized file, and then let the picture editor do its magic afterwards.

Super8
06-06-2012, 12:07 PM
I personaly have good experiences with T++nypic I always convert my BMP scans into jepec with this programm , its very easy.I tried irfan too but it was to comlicated for me