LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2015, 10:17 PM   #1
bennypr0fane
Member
 
Registered: Jan 2012
Location: Central Europe
Distribution: Manjaro, Kubuntu
Posts: 133

Rep: Reputation: Disabled
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?
 
Old 05-24-2015, 10:50 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,032

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
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.
 
Old 05-25-2015, 10:03 AM   #3
bennypr0fane
Member
 
Registered: Jan 2012
Location: Central Europe
Distribution: Manjaro, Kubuntu
Posts: 133

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
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.
 
Old 05-25-2015, 07:46 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,460

Rep: Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602Reputation: 2602
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 " ????
 
Old 05-25-2015, 08:35 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,032

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
Hi,
Quote:
Originally Posted by bennypr0fane View Post
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 View Post
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 View Post
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 View Post
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.
 
  


Reply

Tags
batch, compression, images


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
image file compression Tukatz Linux - Desktop 7 04-15-2014 07:50 PM
image compression using LZW in GTK sumitshining Programming 6 11-16-2008 09:13 PM
Image Compression kumu Linux - Software 3 04-30-2005 10:52 AM
batch image resize and compression Darkfalz Linux - Software 3 08-01-2004 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration