Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

  1. #11
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

    I found this paper abstract on predicting the size of a JPEG after resizing and changing quality factor published by the IEEE Computer Society.
    Very Low Cost Algorithms for Predicting the File Size of JPEG Images Subject to Changes of Quality Factor and Scaling

    They give a sample table in the abstract, but you'd have to get a hold of the full paper for the others. It sounds like if a few percent error was acceptable that may work out for you, and then you could write a script that runs the formula and calls ImageMagick to resize to the dimensions and quality that you want. This assumes you're going from JPEG to JPEG, but there may be similar work out there for RAW to JPEG.

  2. #12
    WasMeHere is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    May 2008
    Location
    Sverige
    Beans
    1,133

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

    In order to learn shell programming, I suggest that you search for 'bash tutorial' in your browser. This way I found the following links, which might help you in different ways. You will find more, including what you need with good examples of small shell-scripts.

    http://linuxconfig.org/Bash_scripting_Tutorial
    http://www.hypexr.org/bash_tutorial.php
    http://tldp.org/LDP/abs/html/


    Have fun
    Olle

  3. #13
    Join Date
    Feb 2006
    Location
    uk
    Beans
    Hidden!

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

    Code:
    convert -define jpeg:extent=100kb input.jpg output.jpg
    http://www.imagemagick.org/Usage/formats/#jpg_write

  4. #14
    Join Date
    Jul 2011
    Beans
    1

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?


  5. #15
    Join Date
    Jan 2010
    Location
    Slovakia
    Beans
    19
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

    Hi,

    perhaps jpegoptim would be worth trying? I believe from version 1.3.0 it has the -S / --size option to set target size for output.

    Although I use it only with the --max attribute to set maximum quality of the optimized pirctures, the -S / --size option might be way forward...you can write a simple vash script to automate this task for you.

  6. #16
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 17.04 Zesty Zapus

    Re: How best to batch shrink JPEG file size (not pixels) to a given number of KBs?

    Old thread closed.

Page 2 of 2 FirstFirst 12

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
  •