#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    2
    Rep Power
    0

    windows user, linux newbie - ImageMagick Problem


    Hi,

    I want to reduce an image so that it is no larger than 100x80 pixels.

    I then want the reduced image to be centered on a larger canvass.

    Under Paint Shop Pro, I'd open the image then
    >> image >> resize >> 100x80
    >> image >> canvas size >> 100x80 centered on white

    With ImageMagick I tried:

    reduce image
    convert -geometry 100x80 image1.jpg image2.jpg

    create canvas
    convert -size 100x80 xc:white canvas.jpg

    composite image on canvas
    composite image2.jpg canvas.jpg image3.jpg

    It doesn't center

    I can't seem to find out how to get image2.jpg centered on canvas.jpg.

    And can it all be done in one command line?

    Thanks
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    2
    Rep Power
    0

    Got it


    Got it!

    This is what I did, created a template canvas. Shrunk the images then composited with template canvas using the -gravity center option.

    convert -size 100x80 xc:white canvas.jpg

    convert -geometry 100x80 image1.jpg image2.jpg | composite image2.jpg canvas.jpg image3.jpg

    Sorry about posting unnecessarily.
  4. #3
  5. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Don't worry about the unnecessary post. Now the thread's been archived so anyone with the same problem can search for it.

IMN logo majestic logo threadwatch logo seochat tools logo