[SOLVED] How reduce picture file size in linux
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2010
    Location
    Finland - North Europe
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How reduce picture file size in linux

    Hello I'm all new to linux.
    I've got Fedora core 12 - I'm ex windows user.
    I have these 3 websites to maintain:
    These are in finnish language. So called pikalaina sites:
    pikalainat
    pikavipit
    vipit

    And I have to add pictures to these pages. I don't know how to do even that I don't know web programming or HTML

    But my images are about 1 mb in file size - I use to have windows and photoshop and there is this save for web feature where file size is reduced.

    I have this GIMP -program now - it's terrible compared to photoshop, but it's free.
    In GIMP there is no feature how to reduce file size for ex. 1mb to 20 Kb....
    How do I do this ? Do you know any good program to do it ?

  2. #2
    Join Date
    Jul 2009
    Location
    London,England
    Posts
    1,102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    To reduce file-size you usually need to reduce the image size. Alternatively to can convert to another format like gif jpg or png, but if the image is already in one of these formats it might not help with filesize. (Just open in something like gThumb image viewer and choose save as..)

    If you have huge images which you need to reduce in size then an easy command line tool is 'convert' from ImageMagick package

    Code:
    su -c 'yum install ImageMagick'
    Then to reduce an image size by 50% do:

    Code:
    convert image.jpg -resize 50% image_new.jpg
    To reduce a whole load of images in a directory do

    Code:
    for i in *.jpg; do convert "$i" -resize 50% "${i%%.jpg*}_new.jpg"; done
    or for subdirectory recursion and filenames with spaces do

    find . -type f -name "*.jpg" | while read i; do convert "$i" -resize 50% "${i%%.jpg*}_new.jpg"; done
    Last edited by Gödel; 11th March 2010 at 07:55 PM.

  3. #3
    Join Date
    Mar 2010
    Location
    Finland - North Europe
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    Okay I had a finnish version, but found it thanx

  4. #4
    Join Date
    Jul 2009
    Location
    London,England
    Posts
    1,102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    You mean gimp or ImageMagick?

    Both are very powerful packages, convert is command line but has a huge number or options (see man page), obviously use Gimp for anything more than just machine like reformatting:

    To mimic photoshop's convert for web you might want to play with

    convert <image> -quality XX -depth 8 -type palette result.jpg

    where XX <= 100

    or for gifs, you can reduce the colours with:

    convert <image> -depth 8 -colors YY -type palette result.gif

    where YY<256

  5. #5
    Join Date
    May 2005
    Location
    Sonoran Desert
    Posts
    2,420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    The quick-and-dirty method in the GIMP: load the image, select SAVE AS from the file menu, select JPEG, and you will see a dialogue that lets you select image quality. Lowering this percentage will reduce the size of the saved file. I always change the file name to preserve the original. If I reduce the percentage to 50%, I put 50 in the new filename, then examine the results.

    As Dan's Guide says, image quality can degrade quickly. But starting with a size ~1 meg, I can usually reduce it by 50% without noticing much difference, and the resulting file size will be in the 100-300k range, acceptable for emailing and web use.

  6. #6
    Join Date
    May 2009
    Location
    eastern Washington (state) USA
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    I just happened to do exactly what you're asking last night in Gimp, though I reduced a .gif file from 68kb to 40.4kb by opening it and saving it as a .jpg, then when I opened the jpg it tells you right on right side of the screen (preview) the image size and pixels. I then reduced the jpg of 385x588 pixels to 70x107 pixels at 3kb size.

    Select open, then when it's on the desktop, select >image > scale image and it'll let you select a new dimension in pixels (you probably want to copy the original image first!), if you just enter the new smaller width, and tab or enter it'll automatically re-do the length to keep the scale in proportion. (If you want to change the proportion, you'll have to unlink the chain beside the pixel dimensions...) you can also select percent, inches (centimeters), or points instead of pixels if you want.

    You can also then change the resolution underneath that. When you're in the main gimp window with the image open it'll have a file size, or some sort of size; it's not accurate as far as file size though. Save your result and then use your file browser to find the new file size -- at least that's what I did.
    Last edited by CiaW; 12th March 2010 at 05:45 AM. Reason: added something

  7. #7
    Join Date
    Jan 2010
    Posts
    892
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    fotoxx is a simple tool very friendly, although the name is not that great.

  8. #8
    Join Date
    May 2005
    Location
    Sonoran Desert
    Posts
    2,420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    I understood the OP to be asking about reducing the size of an image file, and to do that with the GIMP you don't need to scale it - just SAVE AS (and JPEG) under the file menu. Whether you change the file name or not, a sub-requester opens up with a QUALITY meter on top, as well as a section of ADVANCED OPTIONS. Simply by lowering the quality from 100% the file size will be greatly reduced.

    Just tried this, and a 925k photo was reduced in size to 132.5k by reducing the Quality setting to 50%. Side by side in the GIMP I cannot tell the two images apart at normal viewing.

  9. #9
    Join Date
    Jun 2006
    Location
    Paris, TX
    Posts
    24,121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How reduce picture file size in linux

    Folks ... there's a better than average chance we've been suckered and spammed here. I'm closing this and marking it solved.

    Also, if the OP hasn't PMed me by the end of the day with a lot better explanation, it gets summarily deleted and I hand him over to the tender mercies of Spam Wars Sam. - Dan

Similar Threads

  1. gdm user picture size
    By js72 in forum Using Fedora
    Replies: 5
    Last Post: 1st March 2008, 11:54 PM
  2. Replies: 3
    Last Post: 3rd May 2007, 05:41 PM
  3. how to reduce the picture size
    By first007boy in forum Using Fedora
    Replies: 2
    Last Post: 12th March 2007, 08:11 PM
  4. How to reduce Ghost Image file size
    By maxl1961 in forum Using Fedora
    Replies: 0
    Last Post: 13th February 2007, 06:43 PM
  5. Reduce your Linux memory footprint
    By Wayne in forum Linux Chat
    Replies: 2
    Last Post: 2nd February 2007, 06:34 AM

Posting Permissions

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