Page 1 of 2

Batch magnify from a folder to an another one [solved]

Posted: 2019-04-01T01:56:40-07:00
by kimono
Hi, I'm totally new here. I use ImageMagick-7.0.8-Q16 on Windows 10.
I wish to use the -magnify command (scale2x filter) to .png files toward an another folder in .png format.

I've got simply two questions:
- Can someone tell me what is the correct command line to do this?
- Can you explain what -minify command exactly does on an image?

Thank you for your help! :)

Re: Batch magnify from a folder to an another one

Posted: 2019-04-01T10:19:30-07:00
by fmw42
Change directories to the folder where you have your input. Be sure you already have an output directory.

Code: Select all

magick.exe image.png -magnify paphto_output_directory\image.png
There is no minify function according to the commands list at https://imagemagick.org/script/command-line-options.php

If you want a general enlarging or shrinking image command, then use -resize.

Re: Batch magnify from a folder to an another one

Posted: 2019-04-01T11:58:04-07:00
by kimono
@fmw42: Thanks for your answer. I've got a folder with around 100 png images and I wish to magnify all of them in one time to another directory.
How can I do that?
Is -resize (= nearest neighbor? )the best way to shrink an image without having a blurred pixelart?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-01T15:05:02-07:00
by fmw42
1) use mogrify -- it will process all images in a folder and write to a new folder

create a new folder
change directories to the current folder
magic.exe mogrify -path path_to_new_folder -magnify *.png

See https://imagemagick.org/Usage/basics/#mogrify

2) you resize smaller using nearest neighbor as -filter nearestneighbor -resize ...

or

use -sample

see

https://imagemagick.org/script/command- ... php#resize
https://imagemagick.org/script/command- ... php#sample


________________

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Re: Batch magnify from a folder to an another one

Posted: 2019-04-02T13:50:37-07:00
by kimono
Ok I tested this:

Code: Select all

C:\ImageMagick-7.0.8-Q16>magick.exe mogrify -path Karatedo -magnify *.png
mogrify: UnrecognizedOption `-magnify' @ error/mogrify.c/MogrifyImageCommand/5557.
It seems that the magnify option is not recognized.
Can you tell me what I've done wrong? Thank you :)

Re: Batch magnify from a folder to an another one

Posted: 2019-04-02T14:35:51-07:00
by snibgo
"-magnify" isn't an option for "magick mogrify".

Re: Batch magnify from a folder to an another one

Posted: 2019-04-02T14:42:27-07:00
by fmw42
You can request that it be added on the Discourse server. In the meantime you will have to write a loop over all the images you want to process or the images in a folder and use convert or magick to process them depending upon what your IM version is - 6 or 7.

Re: Batch magnify from a folder to an another one

Posted: 2019-04-03T00:48:45-07:00
by kimono
@snibgo: Thanks for the information, I'll search where I can post this request.

@fmw42: I use the latest version of IM-7 and I don't know how to write a loop :/. Can you show me please the global writing?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-03T09:53:10-07:00
by fmw42
Sorry, I do not use Windows. I can show you in Unix, but then you would need to use Windows 10 Unix. Perhaps one of the Windows users here can help you further or do a Google search for .bat scripting.

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T01:39:18-07:00
by kimono
I retested with an updated version (ImageMagick-7.0.8-38-Q16-x64-dll) and I've got the following message:
"Le client ne dispose pas d'un privilège nécessaire"
"Client does not have a necessary privilege"
I reboot windows 10 and authorized to have a total control with all the files of the Imagemagick folder and the input folder but it doesn't seem to work.
Do you have any clue on how to solve it?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T01:57:12-07:00
by snibgo
I don't think that message came from ImageMagick.

What were your commands? Which command produced that message?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T02:29:30-07:00
by kimono
I came from that command line:

Code: Select all

C:\ImageMagick-7.0.8-Q16>magick.exe mogrify -path Karatedo -magnify *.png
Is it because I don't have an output folder? Do you know how I cad add an output to this command line?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T02:49:24-07:00
by snibgo
kimono wrote:C:\ImageMagick-7.0.8-Q16>magick.exe
You are in the ImageMagick installation directory, and running the command from there. This is a bad idea. I suggest you create a different directory for your image processing, and change to that directory.

Ensure that "C:\ImageMagick-7.0.8-Q16" is on your system path.

You are writing to the output directory "Karatedo". If that directory does not exist, the command will fail.

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T12:36:54-07:00
by kimono
@snibgo: I think I had got a problem of read only with some files in win10. I run a window command as administrator and I've got the following message:

Code: Select all

Access Denied.
So the correct command could be:

Code: Select all

C:\[Inputfolder]>magick.exe mogrify -path [outputfolder] -magnify *.png
?

Re: Batch magnify from a folder to an another one

Posted: 2019-04-07T12:37:07-07:00
by fmw42
The output directory must be created ahead of time. Mogrify will not create one.

create a new directory Karatedo
change directory to your directory containing the images. Do not work in the ImageMagick directory as snibgo said.

Code: Select all

magick.exe mogrify -path path_to_existing/Karatedo -magnify *.png