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?
-crop (Border-Tiles, which are not smaller)
Re: -crop (Border-Tiles, which are not smaller)
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:
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)
A great simple idea! Thanks!
I added -size, it works fine!
Code: Select all
convert -size 1000x900 xc:blue image.jpg -gravity northwest -composite temp.png
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: -crop (Border-Tiles, which are not smaller)
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/