Page 1 of 1

-crop (Border-Tiles, which are not smaller)

Posted: 2008-07-03T06:04:12-07:00
by forumim
Hy

I tile a image:
convert -crop 100x100 -fill blue -quality 30 image.jpg test%02d.jpg

Unfotunately, the rightmost tiles and the bottom tiles are smaller
if the specified geometry extends beyond the dimensions of the input image.

I need the rightmost tiles and the bottom tiles in the same size. (100x100)
The area beyond the dimensions of the input image I would like to fill
with the color blue.

How is it possible?

Re: -crop (Border-Tiles, which are not smaller)

Posted: 2008-07-03T07:40:47-07:00
by Bonzo
What about compositing your image onto a blue image of the correct size first and then doing your crop ?
So if your image is 980 x 860 make a blue image 1000 x 900 composite your image onto it and then run your crop on the new image.

Untested but something like:

Code: Select all

convert 1000x900 xc:blue image.jpg -gravity northwest -composite temp.png
convert temp.png -crop 100x100 -quality 30 test%02d.jpg

Re: -crop (Border-Tiles, which are not smaller)

Posted: 2008-07-03T08:10:12-07:00
by forumim
A great simple idea! Thanks!

Code: Select all

convert -size 1000x900 xc:blue image.jpg -gravity northwest -composite temp.png
I added -size, it works fine!

Re: -crop (Border-Tiles, which are not smaller)

Posted: 2008-07-03T20:38:27-07:00
by anthony
The faster way is to get IM to just add the pixels using -background blue -extent 1000x900

See IM examples, Cutting and Bordering for all the details of this type of thing. Also see thumbnails, Padding Images, for other mtheods for 'centered' padding.