opposite -extent or -shave

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

opposite -extent or -shave

Post by rmabry »

A simple thing...

I can use -extent to add pixels to the right and bottom of an image, but
what if I prefer the left and top?

convert rose: -extent 80x56 ...

This adds 10 pixels on the right and bottom.

I can get what I want with

convert rose: -rotate 180 -extent 80x56 -rotate 180 ...

but this seems horribly inefficient, as do other tricks involving compose,
draw and such. I would have thought that some -crop geometry and page
settings might do it, but I cannot figure out how.

Using -gravity with -extent would be cool, if it worked in tandem, but it
doesn't.

Also nice would be to have an inverse -shave, something like

convert rose: -shave -10x-10 ...

Anyway, what's the most efficient way to do this? (Here comes Anthony with just the one-liner I need...)

Thanks in advance,

Rick
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Try
  • convert rose: -extent 80x56 -roll +10+10 rose.miff
to add space to the left and top of the image. In the mean-time we'll get that gravity thing you talked about working by tommorrow.
Last edited by magick on 2007-01-02T13:13:39-07:00, edited 1 time in total.
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post by rmabry »

magick wrote: Try
  • convert rose: -extent 80x56 -roll +10+10 rose.miff
to add space to the left and top of the image.


Ah, yes, that's better than what I was doing. It still seems a shame that it cannot be done in one shot. These methods move things twice rather than just once, do they not? In other words, it's a shame one cannot have everything. Do you think a compose would be faster? (I guess I could try it...)

Thanks,

Rick
Post Reply