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-18-2005, 10:48 AM   #1
ObsessiveMathsFreak
LQ Newbie
 
Registered: May 2005
Posts: 4

Rep: Reputation: 0
Batch converting images


Hi, I've got a large selection of JPEG images that I wish to reduce the size (in KB) of without losing too much quality.

I have messed about with KolourPaint, and have discovered that a 150x115 jpeg image weighing in at 28.4KB can be saved again as a JPEG, selecting 90% image quality, and is reduced to a 10KB image. The loss in image quaility is barely perceptable.

I want to do this for a large number of images, i.e. batch convert. I have tried using Imagemagik convert, but for some bizarre reason it makes the final image bigger?! (30KB).

Is there any way I can get convert to give the the results that Kolourpaint is giving me?
 
Old 05-18-2005, 12:04 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
It's been a while but the last time I used convert, it was something like this...

for i in *jpg; do echo "$i" ; convert -size 20% "$i" -resize 20% "$i" ; done

or using -geometry may look like this...
for i in *jpg; do echo "$i" ; convert -geometry x70 "$i" -geometry x70 "$i" ; done
 
Old 05-18-2005, 12:19 PM   #3
ObsessiveMathsFreak
LQ Newbie
 
Registered: May 2005
Posts: 4

Original Poster
Rep: Reputation: 0
What about the filesize issue. Is convert using a different codec to Kolourpaint? Can I get it to use another codec?
 
Old 05-18-2005, 01:55 PM   #4
ObsessiveMathsFreak
LQ Newbie
 
Registered: May 2005
Posts: 4

Original Poster
Rep: Reputation: 0
To answer my own question.

Actual batch converting is done as above, but the quality issue I was expieriencing was occurring becasue KolourPaint was using libjpeg and imagemagick was not.

I still need to use libjpeg somehow in a batch and happily I was able to. Libjpeg also install, or at least it should install, a little program called cjpeg. So now I run.

for i in *jpg;
do echo "$i" ; convert -size 20% "$i" -resize 20% out.bmp;
cjpeg out.bmp > "$i";
done

Which should work. Basically, I use convert to turn the image into a bitmap so cjpeg can understand it, then use cjpeg to compress the image down to a smaller size.

Hope this helps someone else out there.
 
Old 05-18-2005, 05:52 PM   #5
leosgb
Member
 
Registered: Nov 2004
Location: Brazil
Distribution: Gentoo
Posts: 363

Rep: Reputation: 31
there's no way to do it using gimp? it would be very nice to be able to do it this way... can anyone help?
 
Old 05-20-2005, 03:04 PM   #6
ungua
Member
 
Registered: Oct 2004
Location: bergen, norway
Distribution: OpenSuSe (SuSe 10.1), Win XP Pro
Posts: 539

Rep: Reputation: 30
this is supposed to work from gimp 2.2 and up. i only have 2.0 and wonder if i do bother to download a newer version... so if you try and really like it - convince me!

regards
ungua
 
Old 06-10-2005, 11:18 AM   #7
cb2000
LQ Newbie
 
Registered: Jun 2005
Location: Spain
Distribution: Mandrake 10.1
Posts: 1

Rep: Reputation: 0
Try using Konqueror!
Tools=>Create Image Gallery. Resizes and creates thumbnails. It's a lot quicker than playing around with command line stuff.
 
  


Reply


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
Urgent!! Image batch converting, how? hottdogg Linux - General 1 09-26-2005 07:22 AM
Converting 3d CAD images Simon_6162 Linux - Software 0 08-22-2005 12:26 PM
converting JPEG images to MPEG-2 video using <convert>? BeetleBailey Programming 3 06-11-2004 09:07 AM
converting .tif images to an animated .gif file with a script illiniguy3043 Programming 2 06-01-2004 03:11 PM
converting .tif images to an animated .gif file (Red Hat 7.2, bash shell) illiniguy3043 Linux - General 0 06-01-2004 01:07 PM

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

All times are GMT -5. The time now is 08:26 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
Open Source Consulting | Domain Registration