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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-18-2005, 10:48 AM
|
#1
|
LQ Newbie
Registered: May 2005
Posts: 4
Rep:
|
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?
|
|
|
05-18-2005, 12:04 PM
|
#2
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
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
|
|
|
05-18-2005, 12:19 PM
|
#3
|
LQ Newbie
Registered: May 2005
Posts: 4
Original Poster
Rep:
|
What about the filesize issue. Is convert using a different codec to Kolourpaint? Can I get it to use another codec?
|
|
|
05-18-2005, 01:55 PM
|
#4
|
LQ Newbie
Registered: May 2005
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
05-18-2005, 05:52 PM
|
#5
|
Member
Registered: Nov 2004
Location: Brazil
Distribution: Gentoo
Posts: 363
Rep:
|
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?
|
|
|
05-20-2005, 03:04 PM
|
#6
|
Member
Registered: Oct 2004
Location: bergen, norway
Distribution: OpenSuSe (SuSe 10.1), Win XP Pro
Posts: 539
Rep:
|
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
|
|
|
06-10-2005, 11:18 AM
|
#7
|
LQ Newbie
Registered: Jun 2005
Location: Spain
Distribution: Mandrake 10.1
Posts: 1
Rep:
|
Try using Konqueror!
Tools=>Create Image Gallery. Resizes and creates thumbnails. It's a lot quicker than playing around with command line stuff.
|
|
|
All times are GMT -5. The time now is 08:26 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|