Results 1 to 10 of 10

Thread: How to batch resize images to keep under a certain size

  1. #1
    Join Date
    Apr 2006
    Beans
    11

    Smile How to batch resize images to keep under a certain size

    Hi all,

    I'd appreciate a bit of help on this. I have a collection of about 600 photos from my wedding. I will be uploading them to a photo website to make prints, and the photos need to be under 10mb.

    I have been dabbling with mogrify and the gimp tools, but I have not been able to achieve what I would like to do, which is to batch resize a folder full of images with the scaling automatically determined so that the final image size is under 10mb.

    Anyone got any ideas? There may be a program that does this, or it may be a matter of scripting.

    Thanks

    Leigh

  2. #2
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,634
    Distro
    Ubuntu

    Re: How to batch resize images to keep under a certain size

    You could try imagemagick.

    I don't know if you can specify a size in mb but to reduce all the photo's by half

    Code:
    for p in *.jpg; do convert -resize 50% "$p" new_"$p"; done
    Use 75% or whatever is suitable for your requirements.

    This assumes they all end with a .jpg extension, change that bit if they don't.

  3. #3
    Join Date
    Apr 2006
    Beans
    11

    Re: How to batch resize images to keep under a certain size

    Quote Originally Posted by nothingspecial View Post
    You could try imagemagick.

    I don't know if you can specify a size in mb but to reduce all the photo's by half

    Code:
    for p in *.jpg; do convert -resize 50% "$p" new_"$p"; done
    Use 75% or whatever is suitable for your requirements.

    This assumes they all end with a .jpg extension, change that bit if they don't.
    Thanks for the above. It was really something a bit more fancy whereby imagemagick or another program actually scaled automatically so that all final images were 10mb.

  4. #4
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,804

    Re: How to batch resize images to keep under a certain size

    you can also do this from right click context menu in nautilus

    sudo apt-get install nautilus-image-converter imagemagick

    then select images and choose edit menu or right click
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  5. #5
    Join Date
    Jun 2006
    Location
    UnderTheSea
    Beans
    265

    Re: How to batch resize images to keep under a certain size

    try phatch
    So She Said Internet, And I Said Inter-Not



  6. #6
    Join Date
    Jan 2010
    Location
    Hyperborea
    Beans
    1,465
    Distro
    Ubuntu

    Re: How to batch resize images to keep under a certain size

    +1 phatch
    It has a maximum file size in the save options
    Attached Images Attached Images

  7. #7
    Join Date
    Oct 2011
    Location
    Katowice, Poland.
    Beans
    77
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: How to batch resize images to keep under a certain size

    Quote Originally Posted by haqking View Post
    you can also do this from right click context menu in nautilus

    sudo apt-get install nautilus-image-converter imagemagick

    then select images and choose edit menu or right click
    the above doesnt seem to work. there's nothing from the right click menu.

    Phatch seems unusable.


    but

    "mogrify -resize 1024x800 -format -quality 85 jpg *" in terminal works perfectly

  8. #8
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,804

    Re: How to batch resize images to keep under a certain size

    Quote Originally Posted by tomek_wap View Post
    the above doesnt seem to work. there's nothing from the right click menu.

    Phatch seems unusable.


    but

    "mogrify -resize 1024x800 -format -quality 85 jpg *" in terminal works perfectly
    that depends on what you are using, it is only good for nautilus and you need to log out and back in again first.

    Anyways use what works for ya.

    cheers
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  9. #9
    Join Date
    Oct 2011
    Location
    Katowice, Poland.
    Beans
    77
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: How to batch resize images to keep under a certain size

    Indeed
    Needed to re-log in.
    Works now. And qualitywise not bad either.
    Thnx

  10. #10
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,804

    Re: How to batch resize images to keep under a certain size

    Quote Originally Posted by tomek_wap View Post
    Indeed
    Needed to re-log in.
    Works now. And qualitywise not bad either.
    Thnx
    no worries, you are welcome.
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •