mogrify questions

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
BabaG

mogrify questions

Post by BabaG »

the examples of mogrify that i've seen seem to all run from the
local directory. i'm having an issue where i need to specify a
specific directory in my commands because my command line
doesn't seem to be willing to relocate to a mapped network drive.
since my location remains c:\windows\system32, what would be the
syntax for use of mogrify? how would i specify both the destination
directory as well as the originating directory? would this be the syntax?

mogrify -path o:\im-tests -crop 2240x1260+512+425 -resize 1920x1080 m:\imtest_out\*

where o: is the destination drive, m: is the originating drive.

the intent here is to retain the original filenames while moving the
cropped/resized images to a new drive/directory.

thanks,
BabaG
BabaG

Post by BabaG »

this seems to have the pathing correct but the images are not sizing
as intended. what i was trying for is this:

1. crop the original 2896x1944 image down to a size of 2240x1260
using a beginning reference coordinate of 512 and 420

2. resize the resultant 2240x1260 image down to 1920x1080

this basic syntax works properly with the convert command but is
yielding an improperly framed image with mogrify. also, the final
image is coming out as 1097x655 rather than the intended 1920x1080.

thanks for any clarification on what i've got wrong here. i'm sure it's
me as im seems a great app!

thanks again,
BabaG
BabaG

Post by BabaG »

got it running as a batch script that separates the combined crop and
resize line into two commands. mogrify didn't seem to like putting
crop and resize into the same command like convert is able to do.
here's what worked:

mogrify -path o:\im-tests -crop 2240x1260+519+425 m:\imtests_out
mogrify -resize 1920x1080 o:\imtests

hope this might help someone. would love to know if there is a way to
get this all into a single command.

thanks,
BabaG
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Well you seemed to have solved it yourself.

I would however like to point out that unless you are saving to 'jpg' I would add a +repage
after the -crop or you will get offset problems later.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
BabaG

Post by BabaG »

like this?:

mogrify -path o:\im-tests -crop 2240x1260+519+425+repage m:\imtests_out
mogrify -resize 1920x1080 o:\imtests

or should there be a space between the numbers and the +repage?
didn't find any examples of the syntax. noob enough to really need to see
examples before i get it.

thanks very much for the pointer, anthony,
BabaG
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Examples... Examples... Your talking to the right person!!!

See IM Examples Crop and you will be up to your eyeballs in +repage examples!!!!
http://www.cit.gu.edu.au/~anthony/graph ... rop_repage

And yes there is a space. +repage is an option to reset the 'page' or virtual canvas aspects of the result, that -crop will preserve for use by advanced animations and layering effects.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
BabaG

Post by BabaG »

great! thanks anthony.
Post Reply