LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   batch image compression (https://www.linuxquestions.org/questions/linux-software-2/batch-image-compression-4175543501/)

bennypr0fane 05-24-2015 09:17 PM

batch image compression
 
Which GUI tool is best for compressing image files in a batch?

I scan a lot of text documents that I want to post-process to deliver good quality printouts that can be copied (scan > print the scan > copy the print), while not consuming huge amounts of disc space.
I am not talking about resizing, but compressing while preserving original resolution, and I want to achieve the best possible balance between file size and readability of the scanned documents.
I scan DIN-A4-format sheets to jpeg format in 600 dpi res, which usually gives me files between 1,5 and 3,5 MB in size. Getting these down to 0,5 MB or below would be great.

There are several basic image editing and management applications that have compression options, but the outcome varies a lot, and usually there is no option to do batch jobs.
E.g. Libreoffice Draw has a feature for exporting to jpeg. With jpeg compression set to 100, it turns a 3,7MB file into 325KB. That's cool, but readability suffers too much (also, you can't batch process in LO). GIMP has an extension that makes a few tools available for batch processing, but not compression.
On the other hand, there are tools like Phatch, where compression set to e.g. 50 will give me pretty much half the file size - which is still too big.
I don't understand the logic: one reduces size to about a tenth when set to 100%, the other to a half when set to 50% (where the latter makes more sense mathematically, but the outcome is less desirable).
The ideal would be to have a little less compression than what LO does, where file size would still be ok, but with less of a penalty on readability - but 100% is already the least possible compression! How does this work?

evo2 05-24-2015 09:50 PM

Hi,

why are you looking for a GUI to do batch processing? Surely a commandline tool would be a better choice here. Eg convert from the imagemajick suite.

http://www.imagemagick.org/script/convert.php
http://www.imagemagick.org/script/co...ns.php#quality

For the ultimate in compression and readability how about using OCR software on the high resolution originals and then archive (or if you are happy with the results delete) them. Eg http://jocr.sourceforge.net/

Evo2.

bennypr0fane 05-25-2015 09:03 AM

Quote:

Originally Posted by evo2 (Post 5366963)
Hi,
why are you looking for a GUI to do batch processing? Surely a commandline tool would be a better choice here. Eg convert from the imagemajick suite.
http://www.imagemagick.org/script/convert.php
http://www.imagemagick.org/script/co...ns.php#quality
For the ultimate in compression and readability how about using OCR software on the high resolution originals and then archive (or if you are happy with the results delete) them. Eg http://jocr.sourceforge.net/
Evo2.

Thanks. I don't suppose you'd like to give me the exact imagemagick commands? Because otherwise, GUI is the best way for me to do it. I have to use some kind of GUI tool in any case, because the scans also need to be cropped.
All the free OCR tools I have tried so far (including GOCR) give subpar results. All the powerful enough OCR software I have seen is commercial, and, more irritatingly, Windows only. Also the kind of documents I scan is not just text, but with images, charts etc and complex layout. That means, even if the OCR gets the text right enough, more post-processing is required, and that's a show-stopper for me.
Anyway thanks for your suggestions, but something along the lines of what I asked would be awesome.

John VV 05-25-2015 06:46 PM

normally tif's are used in OCR

just use imagemagick's "mogrify" program to convert them to lossless png's


Code:

mogrify png *.tif
that should be it , but i normally do not use IM much in the last few years
double check the png and tiff might need to be flipped
" mogrify *.tiff png " ????

evo2 05-25-2015 07:35 PM

Hi,
Quote:

Originally Posted by bennypr0fane (Post 5367144)
Thanks. I don't suppose you'd like to give me the exact imagemagick commands? Because otherwise, GUI is the best way for me to do it.

It's basically a one liner. Eg if your files are all *.jpeg in the current directory...
Code:

mkdir compressed
for f in *.jpeg ; do convert -quality 75 "${f}" "compressed/${f}" ; done

Quote:

Originally Posted by bennypr0fane (Post 5367144)
I have to use some kind of GUI tool in any case, because the scans also need to be cropped.

You don't need a gui to crop. http://www.imagemagick.org/script/co...tions.php#crop
Eg
Code:

convert -crop <width>x<height>+<x-offset>+<y-offset> infile.jpeg outfile.jpeg
Quote:

Originally Posted by bennypr0fane (Post 5367144)
All the free OCR tools I have tried so far (including GOCR) give subpar results. All the powerful enough OCR software I have seen is commercial, and, more irritatingly, Windows only. Also the kind of documents I scan is not just text, but with images, charts etc and complex layout. That means, even if the OCR gets the text right enough, more post-processing is required, and that's a show-stopper for me.

Ok, seems like OCR is not for you.
Quote:

Originally Posted by bennypr0fane (Post 5367144)
Anyway thanks for your suggestions, but something along the lines of what I asked would be awesome.

You mean a gui instead of a shell one liner?

Evo2.


All times are GMT -5. The time now is 08:58 PM.