Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Tip for digital camera owners, Image recompression< Next Oldest | Next Newest >
WDef Offline





Group: Members
Posts: 798
Joined: Sep. 2005
Posted: July 24 2007,11:01 QUOTE

If you have a directory full of big digital camera images, here's one way to batch recompress these down to a more manageable size for storage.

Suppose for argument's sake you have a mixture of pics in there and only want to recompress those from your FURTLEWANG camera

1. Load jhead.uci, imagemagick.uci and gnu-utils.dsl

2.  Back up your images first

cp -a image-dir image-dir.bak

3. cd image-dir

4.
Code Sample

 find -type f -name '*' -size +2048k -print0  2>/dev/null | xargs -0 jhead -exonly -model FURTLEWANG -cmd "/opt/imagemagick/bin/mogrify -quality 80 &i"


This will find jpegs from your camera over 2MB size (change the size switch on 'find' to suit yourself) and recompress at 80% quality. Or lower if you want, to get smaller images.  Experiment to see if you can detect any difference.  This is lossy so only do it once.

You can then reduce the size a bit further if you wish by loading stegdetect_i686.uci (which happens to contain the jpeg utils as dependencies) and running:

Code Sample

jpegtran -progressive somepic.jpg >somepic_prog.jpg


This will need to be put in a loop to do a batch; the batch instructions in the jhead docs don't seem to work with this jpegtran.
Back to top
Profile PM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: July 24 2007,11:46 QUOTE

make jpegtran also use -optimize, it takes a little more time but produces smaller images..

--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
1 replies since July 24 2007,11:01 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Tip for digital camera owners

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code