InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

ImageMagick tutorials

  • Install Imagemagick on Mac
  • Install Imagemagick on Ubuntu
  • Create animated gif using Mac preview
  • Create animated gif on command line
  • Edit animated gif speed
  • Find image width and ppi
  • Find image unique colors and bit depth
  • Resize image dimention
  • Compress images
  • Crop image
 
  • Home
  • > Tutorials
  • > Linux/Unix Command Line
  • > ImageMagick

How to resize image (including animated gif) using Image magick convert

By admin on Dec 3, 2015

Imagemagick convert can be used to resize and image (including animated gif). Here are some scenarios where convert can be used to change size of an image. For these commands to work Imagemagick need to be installed on your Mac or Linux.

Resize image to specific width

Resize image to width=300 and take height automatically in same proportion

$ convert image1.gif -resize 300x image2.gif

Resize image to specific height

Resize any image to height=200 and take width automatically in same proportion

$ convert image1.gif -resize x200 image2.gif

Resize image to fit in specific width and height container

Resize image to width=300 height=200. To maintain aspect ratio convert will take height and width such that target image remains with in 300×200. In target one of height or width may be lower than specified width and height.

$ convert image1.gif -resize 300x200 image2.gif

Resize image to percentage

Resize image to 50%.

$ convert image1.gif -resize 50% image2.gif

Resize animated gif

To handle animated gif first run convert with -coalesce. Then regular conversion methods will apply.

$ convert image_animation_1.gif -coalesce coalesce.gif
$ convert coalesce.gif -resize x200 image2.gif

Suggested posts:

  1. How to create animated gif using Mac preview
  2. How to check if a user has password on Linux
  3. Get image width and ppi using imagemagick identify on command line
  4. Mysql find current timezone offset
  5. How to install node.js on Ubuntu Linux
  6. Find used ports by an app on Android using Adb
  7. WordPress mysql query to get all custom keys and values for a post
  8. Mac brew – how to relink installed binaries for a package
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged ImageMagick, Linux, Linux/Unix Command Line, Mac, Tutorials, Ubuntu Linux
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress