Re: Compressing images without compressing quality

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

 



On Wed, 2006-06-14 at 12:08 +0100, Paul Smith wrote:
> On 6/14/06, Ben Lancaster <lists@xxxxxxxxxxxxxxxxxx> wrote:
> > >> some tool to automatically crop images. Any suggestions?
> > >
> > > Gimp scripting is what you're looking for.
> >
> > ...or ImageMagick and a bash script if you felt that way inclined.
> 
> Thanks for all suggestions. pngcrush seems quite effective!
> 
> Paul
> 
This is an exellent script I found on the web, that really compresses
png files:
###########
#!/bin/bash

# create backup copy
cp $1 $1.orig
#convert the image to indexed
convert -quality 0 +dither -colors 256 $1.orig $1
# shrink the PNG using three tools
pngrewrite $1 $1
optipng -zc1-9 -zm1-9 -zs0-2 -f0-5 $1
advpng -z4 $1

# display file sizes of the original and compressed image
ls -sla $1*
###########
It depends on three tools: pngrewrite, optipng and advpng.
If the image is a photo it may be a good idea not to convert it to
indexed, but then the gain will be smaller.

and this will compress all the png images in the current directory:
###########
#!/bin/bash
#
# This script converts all PNG files in the current directory to
# 256-color indexed using maximum compression.
#
# Written by Frank Schoep
#

# get file list and loop through all files
FILES=`ls -1S *.png`
for FILE in $FILES
do
cp $FILE $FILE.orig
convert -quality 0 +dither -colors 256 $FILE $FILE

pngrewrite $FILE $FILE
optipng -zc1-9 -zm1-9 -zs0-2 -f0-5 $FILE
advpng -z4 $FILE
done
###########

Greetings,
-- 
Peter Kostov
Sofia, Bulgaria

Photographer, web designer,
3D modeling, informational services

Home site: http://www.light-bg.com

-- 
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