How do I force ImageMagick to use x pixel spacing?

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
warnic
Posts: 2
Joined: 2013-11-04T12:36:52-07:00
Authentication code: 6789

How do I force ImageMagick to use x pixel spacing?

Post by warnic »

Hi.

I have 1217 (jpg) images I am using to create 8 posters in the 0.707:1 ratio that A1/A2/A3 sizes etc use.
The images themselves are 370:410

This is the script I've gotten down so far

Code: Select all

"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\montage.exe" -quality 100 -tile 14x17 -define registry:temporary-path="D:\Temp" -define png:include-chunk=none -mode concatenate  "C:\Users\Master\Desktop\Runs\Run1\*.jpg" "C:\Users\Master\Desktop\Final\FINAL1.png
But obviously the result never strictly adheres to the 0.707:1 ratio.
It would be fine if I used some images twice or skipped out on <50 images, or if there was some even spacing in between
all of the images, but I can't for the life of me find how I add say, 1 pixels, 2 pixels or 3 pixels in between all images so as to adhere to the ratio.

Can someone help me?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I force ImageMagick to use x pixel spacing?

Post by fmw42 »

I am not sure what you mean by x pixel spacing. Do you want spaces between the images in each row, but not in each column? Add -geometry +3+0 to your montage command to have 3 pixels of horizontal spacing and 0 pixels of vertical spacing.

Are all the images the very same pixel dimensions of 370x410?


"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\montage.exe" -quality 100 -tile 14x17 -geometry +3+0 -define registry:temporary-path="D:\Temp" -define png:include-chunk=none -mode concatenate "C:\Users\Master\Desktop\Runs\Run1\*.jpg" "C:\Users\Master\Desktop\Final\FINAL1.png


If after the montage, the images are not in the .707:1 ratio, then resize the result


"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\montage.exe" -quality 100 -tile 14x17 -geometry +3+0 -define registry:temporary-path="D:\Temp" -define png:include-chunk=none -mode concatenate "C:\Users\Master\Desktop\Runs\Run1\*.jpg" miff:- | convert - -resize 70.7x100%% "C:\Users\Master\Desktop\Final\FINAL1.png

or

"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\montage.exe" -quality 100 -tile 14x17 -geometry +3+0 -define registry:temporary-path="D:\Temp" -define png:include-chunk=none -mode concatenate "C:\Users\Master\Desktop\Runs\Run1\*.jpg" miff:- | convert - -resize 70.7x100%^%% "C:\Users\Master\Desktop\Final\FINAL1.png
warnic
Posts: 2
Joined: 2013-11-04T12:36:52-07:00
Authentication code: 6789

Re: How do I force ImageMagick to use x pixel spacing?

Post by warnic »

Thanks very much 'fmw32', I had already attempted to use geometry but must have gotten the usage wrong since it gave me an error emssage.

This is the code I'm running and it's splendid:

"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\montage.exe" -quality 100 -tile 9x17 -geometry +90+0 -define registry:temporary-path="D:\Temp" -define png:include-chunk=none "C:\Users\Master\Desktop\Runs\Run1\*.jpg" "C:\Users\Master\Desktop\Final\FINAL1.png

Thanks for assisting.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I force ImageMagick to use x pixel spacing?

Post by fmw42 »

Note that for -quality the value means something different for png output than it does for jpg. See http://www.imagemagick.org/script/comma ... hp#quality
Post Reply