Re: GIMP can not do it

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

 



elk dolk wrote:
Hi all,

I have some 600x450 pixel photos and want to reduce their size to 60K and keep the aspect ratio, GIMP can't do it , anyone know of a Linux photo manipulation SW for batch processing photos?

You are mixing units, 600x450 is pixels, and I assume you want 60k as a file size.

cd dir_with_images
mkdir SMALL
ls *.jpg |
while read file; do
  djpeg "${file}" | pnmscale -xys 400 300 |
  cjpeg -Q 60 -o -smo 20 -dct float >SMALL/"${file}"
done

Notes:
1 - the quotes are needed if you have special characters in the filenames
2 - -Q is quality, higher is larger, adjust to tune
3 - "-xys 400 300" scales to 400x300, you can also use a single f.p. number like 0.7 to scale to fractional sizes. You may not need to scale at all, that step is optional if the cjpeg makes things small enough.
4 - "-o" is optimize, create smaller image, keep that option
5 - "-smo xx" is smoothing, if you use too much the images will be smaller but look like garbage.
6 - don't use xargs, handling special characters in filenames is ugly
7 - don't simplify to "while file in *.jpg" because it fails if you have too many files, and bash gives you "line too long" errors

As you may have guessed I have done rather a lot of these, this script should be bulletproof. Install netpbm if you don't have it.

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux