Optimize to file size (image)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • André Næss

    #1

    Optimize to file size (image)

    Photoshop has a function called optimize to file size which tries to fit an
    image to some given file size. Because I need to make sure no images on a
    site I'm working on are larger than X KB I need something similar so that
    users don't have to worry so much about image file size. Does anyone know
    of a way to do this, preferably using ImageMagick or GD?

    Doing several calls to ImageMagick with different optimize settings is a not
    a good option.

    André Næss
  • Andy Hassall

    #2
    Re: Optimize to file size (image)

    On Tue, 25 Nov 2003 13:52:01 +0000, André Næss
    <andrena.spamre allysucks@ifi.u io.no> wrote:
    [color=blue]
    >Photoshop has a function called optimize to file size which tries to fit an
    >image to some given file size. Because I need to make sure no images on a
    >site I'm working on are larger than X KB I need something similar so that
    >users don't have to worry so much about image file size. Does anyone know
    >of a way to do this, preferably using ImageMagick or GD?
    >
    >Doing several calls to ImageMagick with different optimize settings is a not
    >a good option.[/color]

    I don't think there's any other alternative; there's no way of determining how
    well an arbitrary image will compress without doing at least most of the work
    of compressing it.

    --
    Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
    Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

    Comment

    • André Næss

      #3
      Re: Optimize to file size (image)

      Andy Hassall:
      [color=blue]
      > On Tue, 25 Nov 2003 13:52:01 +0000, André Næss
      > <andrena.spamre allysucks@ifi.u io.no> wrote:
      >[color=green]
      >>Photoshop has a function called optimize to file size which tries to fit
      >>an image to some given file size. Because I need to make sure no images on
      >>a site I'm working on are larger than X KB I need something similar so
      >>that users don't have to worry so much about image file size. Does anyone
      >>know of a way to do this, preferably using ImageMagick or GD?
      >>
      >>Doing several calls to ImageMagick with different optimize settings is a
      >>not a good option.[/color]
      >
      > I don't think there's any other alternative; there's no way of
      > determining how
      > well an arbitrary image will compress without doing at least most of the
      > work of compressing it.[/color]

      Yeah I ended up definining a max width and height and forcing all images
      into 60% jpeg. This keeps me well within the limits. I'm sure there is an
      upper bound on how large a jpeg image can become if you know the max
      dimension, but I didn't bother to check.

      André Næss

      Comment

      Working...