Results 1 to 3 of 3

Thread: Imagemagick/graphicsmagick resizing question

  1. #1
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    615
    Distro
    Ubuntu 12.04 Precise Pangolin

    Imagemagick/graphicsmagick resizing question

    Hi Folks,

    I have an image that is 2700x2700.
    I want it to be 1280x800

    When I try the Imagemagick command
    Code:
    convert <image name> -resize 1280x800 <image name>
    the image is resized to 800x800

    Likewise in Graphicsmagick when I run the command
    Code:
    gm mogrify -resize 1280x800 <image name>
    the image is once again resized to 800x800

    If I use GIMP I can resize the image correctly to 1280x800.

    Does someone see what bone-head error I am making?
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  2. #2
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Imagemagick/graphicsmagick resizing question

    Sure, the original image is a square 2700x2700, while the resolution you are resizing to would be a different aspect ratio (16:10 instead of the 1:1 of the original). Unless you specifically tell it to, Imagemagick will maintain the original aspect ration and resizes the image to fit inside the resolution you specified.

    Try this instead:
    Code:
    convert <image name> -resize 1280x800\! <image name>
    I haven't used Graphicsmagick but I'd assume it follows the same convention as Imagemagick does.

  3. #3
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    615
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Imagemagick/graphicsmagick resizing question

    Quote Originally Posted by mcduck View Post
    Sure, the original image is a square 2700x2700, while the resolution you are resizing to would be a different aspect ratio (16:10 instead of the 1:1 of the original). Unless you specifically tell it to, Imagemagick will maintain the original aspect ration and resizes the image to fit inside the resolution you specified.

    Try this instead:
    Code:
    convert <image name> -resize 1280x800\! <image name>
    The magic worked. I didn't know about the \! (obviously )
    I thought that supplying the desired dimensions was enough.

    Thank you - I've copied your code to my list of notes for future reference.

    Man I like this forum. Post a question, 20 minutes later a fellow enthusiast gives you the answer.
    Last edited by GrouchyGaijin; September 14th, 2013 at 11:49 PM. Reason: added third person singular s to the verb give
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

Tags for this Thread

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
  •