Find the answer to your Linux question:
Results 1 to 8 of 8
Hello guys! I am currently doing some projects where I have several thousand of pictures downloaded from the internet and I need to standardize their size to 95x86. Mostly jpg, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272

    Help Resizing Photo Sizes Using Terminal


    Hello guys!

    I am currently doing some projects where I have several thousand of pictures downloaded from the internet and I need to standardize their size to 95x86.

    Mostly jpg, a few are gif format. Different sizes too.

    I would appreciate it if someone can share how I can resize them using the terminal. I have some experience resizing movies/videos but as far as pictures, no experience whatsoever.

    Thank you in advance for any advises.

    Regards,

    nujinini
    nujinini
    Linux User #489667

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Imagemagick is a console app that should work well for getting the job done:

    http://www.imagemagick.org/

    ImageMagick: Command-line Tools

    It might already be installed on your system, depending which distro you run.
    oz

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,386
    ImageMagick: Convert, Edit, Or Compose Bitmap Images can be used for this.

    An example looks like this
    Code:
    convert example.gif    -resize 95x86  small_example.gif
    Of course, there are a lot of options.
    Knock yourself out
    Resize or Scaling -- IM v6 Examples
    You must always face the curtain with a bow.

  4. #4
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272
    Thanks Ozar and Irithori!

    ImageMagick doesn't seem to be installed in my jaunty and I'm having a little difficulty getting it as per my output.


    Code:
    jun@jun-laptop:~$ sudo apt-get install imagemagick
    [sudo] password for jun: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      imagemagick-doc
    Suggested packages:
      transfig
    The following NEW packages will be installed:
      imagemagick imagemagick-doc
    0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
    Need to get 3330kB of archives.
    After this operation, 21.4MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    WARNING: The following packages cannot be authenticated!
      imagemagick imagemagick-doc
    Install these packages without verification [y/N]? y
    Err http://security.ubuntu.com jaunty-security/main imagemagick 7:6.4.5.4.dfsg1-1ubuntu3.1
      404 Not Found [IP: 91.189.92.166 80]
    Err http://ph.archive.ubuntu.com jaunty-updates/main imagemagick 7:6.4.5.4.dfsg1-1ubuntu3.1
      404 Not Found [IP: 91.189.92.169 80]
    Err http://ph.archive.ubuntu.com jaunty-updates/main imagemagick-doc 7:6.4.5.4.dfsg1-1ubuntu3.1
      404 Not Found [IP: 91.189.92.169 80]
    Failed to fetch http://ph.archive.ubuntu.com/ubuntu/pool/main/i/imagemagick/imagemagick_6.4.5.4.dfsg1-1ubuntu3.1_i386.deb  404 Not Found [IP: 91.189.92.169 80]
    Failed to fetch http://ph.archive.ubuntu.com/ubuntu/pool/main/i/imagemagick/imagemagick-doc_6.4.5.4.dfsg1-1ubuntu3.1_all.deb  404 Not Found [IP: 91.189.92.169 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    jun@jun-laptop:~$
    nujinini
    Linux User #489667

  5. #5
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    I don't know much about jaunty or its repositories, but if the imagemagick package isn't in the repos, you might be able to use the package from one of the other ubuntu releases, or at the very least you should be able to install it from source. You might try googling install imagemagick jaunty for some howto articles where others have installed it.
    oz

  6. #6
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272
    Quote Originally Posted by ozar View Post
    I don't know much about jaunty or its repositories, but if the imagemagick package isn't in the repos, you might be able to use the package from one of the other ubuntu releases, or at the very least you should be able to install it from source. You might try googling install imagemagick jaunty for some howto articles where others have installed it.
    Thank you Ozar, I think this did it for me. I have it already.

    I am trying to convert


    Code:
    Image Type: jpeg (The JPEG image format)
    Width: 125 pixels
    Height: 162 pixels
    and resize them to 95 x 86 and I got about a thousand of these jpegs.

    Can someone please share if its possible at all to do it in the CLI using a *jpeg to do everything in one shot? And also to direct the output to another folder?

    Just curious, thanks! Well actually I'm hoping it can be done really
    nujinini
    Linux User #489667

  7. #7
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Quote Originally Posted by nujinini View Post
    Can someone please share if its possible at all to do it in the CLI using a *jpeg to do everything in one shot? And also to direct the output to another folder?

    Just curious, thanks! Well actually I'm hoping it can be done really
    Look at using mogrify to resize multiple images:

    ImageMagick: Command-line Tools: Mogrify
    oz

  8. #8
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272
    Quote Originally Posted by ozar View Post
    Look at using mogrify to resize multiple images:

    ImageMagick: Command-line Tools: Mogrify

    Code:
    jun@jun-laptop:~/ImageMagick-6.6.7-10$ mogrify -resize 95x86 '/home/jun/Desktop/Folder/Sub-folder/file.jpg'
    mogrify: error while loading shared libraries: libMagickCore.so.4: cannot open shared object file: No such file or directory
    jun@jun-laptop:~/ImageMagick-6.6.7-10$
    Hi!

    I tried mogrify but can't seem to get it right. The error says "no such file" but I am quite sure I have the picture in that folder. In fact I dragged it to the terminal.

    Maybe something is wrong with my syntax? Would appreciate any help please. Thank you!

    regards,

    nujinini

    EDIT: I got it already. I executed

    $ sudo ldconfig /usr/local/lib


    A little googling went a long way. I got the tip from this site.

    Thank you for your patience!
    Last edited by nujinini; 08-07-2011 at 05:22 AM. Reason: Added Updates
    nujinini
    Linux User #489667

Posting Permissions

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