Author Topic: Batch png resizing  (Read 608 times)

KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
Batch png resizing
« on: 2 February 2003, 20:28 »
I have about 20 png's that I need to resize a little smaller.

Just wondering what program would I use to shrink them and how would I put that into a bash script?
Contains scenes of mild peril.

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Batch png resizing
« Reply #1 on: 2 February 2003, 20:44 »
convert.
Do you want them resized to a particular size or % of their current size?
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
Batch png resizing
« Reply #2 on: 2 February 2003, 22:05 »
I have a particular size I need them to be (the same for all of them)
Contains scenes of mild peril.

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Batch png resizing
« Reply #3 on: 2 February 2003, 22:19 »
If they're all in one directory, this will create smaller versions of the pngs but leave the original files:

for i in *.png; do convert "$i" -resize 50x50 "small$i"; done

Change the 50x50 to whatever dimensions you want, and "small$i" to the output filename you want (this will just prepend "small" to the start of the original filename)

Or, if you don't want to keep the original files, this will overwrite them with the smaller ones:

for i in *.png; do convert "$i" -resize 50x50 temp.png; mv temp.png "$i"; done
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


KernelPanic

  • VIP
  • Member
  • ***
  • Posts: 1,878
  • Kudos: 222
Batch png resizing
« Reply #4 on: 2 February 2003, 22:57 »
Thanking you very much!
Contains scenes of mild peril.

preacher

  • VIP
  • Member
  • ***
  • Posts: 858
  • Kudos: 107
    • http://kansascity.cjb.net
Batch png resizing
« Reply #5 on: 2 February 2003, 23:32 »


[ February 02, 2003: Message edited by: ThePreacher ]

Kansas City Hustle
http://kansascity.cjb.net