[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Batch Process Images - Debian



On 11-Oct-07 12:15:26, Richard Ibbotson wrote:
> Hi
> 
> Oh... right.... thanks for everyone's help :)  Here we go... 'man 
> imagemagick'.  I'd forgotten about that.  Too much use of KDE and 
> Gnome...
> 
>> JPEG images at 1024x768 tend to range from 200-300KB, so I'd
>> suggest you perhaps try ImageMagick's 'convert' program, say, on
>> the lines of
>>
>> for i in *.jpg ; do
>>  j=`basename $i jpg`
>>  convert -geometry 1024x768 $i newpics/$j.1024x768.jpg
>> done
> 
> Hmm... looks useful :)
> 
>> This should work OK, since digital camera photos generally
>> have a 4:3 aspect ratio.
> 
> Yes, but the pro cameras tend to have 3 to 10Mb files for the 35 m/m 
> SLR replacement and the digital Rollei medium format camera is about 
> 10Mb to 30Mb in size.  Hence the need for image processing when 
> uploading to a web page.  In my case 3008x2000 pixels is small.

I think you may have misunderstood what I wrote, Richard.
You asked for a final approx 300KB file size, so I took that
as the target (since, as I say, 1024x768 generally has a file
size in the 200-300KB range). The "- geometry 1024x768" option
in the above command sets the size of the final ('convert'ed)
image, and has nothing to do with the size of the original
(which could be anything, provided it's not too big to be handled).

My comment about "4:3 aspect ratio" is of course associated
with the 1024x768, since 1024:768 = 4:3; of course if the
format in your original photos used a different aspect ratio
then you'd need to change the 'geomtry' option appropriately.
Just as an illustration, here are some results from "ls -l"
for one of my photo directories (just file size, date & name):

2002032 Apr 19 12:17 ElyCathRosPits_2007.04.19_A.jpg
 198931 Apr 19 12:22 ElyCathRosPits_2007.04.19_A_1024x768.jpg
2016377 Apr 19 12:18 ElyCathRosPits_2007.04.19_B.jpg
 211643 Apr 19 12:23 ElyCathRosPits_2007.04.19_B_1024x768.jpg
2018138 Apr 19 12:18 ElyCathRosPits_2007.04.19_C.jpg
 290582 Apr 19 12:25 ElyCathRosPits_2007.04.19_C_1024x768.jpg
2054771 Apr 19 12:18 ElyCathRosPits_2007.04.19_D.jpg
 284507 Apr 19 12:27 ElyCathRosPits_2007.04.19_D_1024x768.jpg
....

The final file sizes would have been similar even if the originals
had been 30MB!

> You can do this with Photoshop in Mac or winduhs but to be honest I 
> prefer the Linux desktop and think that ImageMagick is better anyway.  
> Oh....  mogrify... might work !
> 
> 
> -- 
> Richard

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.harding@xxxxxxxxxxxxxxxx>
Fax-to-email: +44 (0)870 094 0861
Date: 11-Oct-07                                       Time: 13:36:55
------------------------------ XFMail ------------------------------

_______________________________________________
        Sheffield Linux User's Group
  http://www.sheflug.org.uk/mailfaq.html
 GNU - The choice of a complete generation