Page 1 of 1

Command line - convert to webp and specify quality settings

Posted: 2017-01-21T18:48:46-07:00
by AlmostThere
Hi - fist time poster here :D

I'm trying to put together a command that specifies:
  • Quality 60
  • Method=6
So I've tried a couple of commands (most guessing)

Code: Select all

D:\...\convert.exe "2017-01-13 00-22-33.515.jpg" -quality 65 method 6 image_out.webp
leading to this output
convert.exe: UnableToOpenBlob 'method': No such file or directory @ error/blob.c
/OpenBlob/2691.
convert.exe: NoDecodeDelegateForThisImageFormat `' @ error/constitute.c/ReadImag
e/509.
convert.exe: UnableToOpenBlob '1': No such file or directory @ error/blob.c/Open
Blob/2691.
convert.exe: NoDecodeDelegateForThisImageFormat `' @ error/constitute.c/ReadImag
e/509.
I also tried with "="

Code: Select all

D:\...\convert.exe "2017-01-13 00-22-33.515.jpg" -quality 65 method=6 image_out.webp
That also resulted in an error message I don't understand.

I know that the command doesn't work because when changing number behind "method" to 1, Convert throws a file with identical size.

I have read this documentation about converting to webp
https://www.imagemagick.org/script/webp.php
but it doesn't provide answer on syntax to get the other options to work.

Please provide a working command example, so I can make it work.

Thanks in advance.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-21T19:10:35-07:00
by snibgo
AlmostThere wrote:'method': No such file or directory
IM is looking for an image called "method". Options always start with "-". But there is no option "-method".

The page you linked to shows that WebP encoding options need "-define webp:", eg:

Code: Select all

convert wizard: -quality 50 -define webp:method=6 wizard.webp

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-22T09:12:40-07:00
by AlmostThere
Thanks. But it still doesn't work properly - this is the command line I try to use:

Code: Select all

D:\...\convert.exe "2017-01-13 00-37-13.828.jpg" wizard: -quality 50 -define webp:method=6 wizard.webp
  • wizard-0.webp Seems to be correct.
  • wizard-1.webp Fail -Image of a "wizard" that doesn't belong to the folder.
I don't need that output image doesn't match the command line, and neither does I need a second image of a cartoon wizard :?

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-22T09:55:55-07:00
by dlemstra
You are getting that because you added 'wizard:' to your command. This is a built-in image of a wizard that you should not have added to your output. Remove that part and you will get the result that you want.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-22T17:03:38-07:00
by snibgo
Yes. I don't have a file named "2017-01-13 00-37-13.828.jpg", so I used the built-in "wizard:".

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-23T11:39:26-07:00
by AlmostThere
Tried to remove the "wizard:" but then I get an error message:

Code: Select all

D:\....\convert.exe "2017-01-13 00-37-13.828.jpg" -quality 50 -define webp:method=6 outputFileName.webp
But then it says:
Invalid parameter - 00-37-13.828.jpg"

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-23T11:59:54-07:00
by fmw42
Some systems do not permit spaces in file names. So the name is seen as two separate files, which cannot be used. Quotes usually work on unix systems. I do not know if they work on Windows.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-23T12:17:03-07:00
by snibgo
AlmostThere wrote:Invalid parameter
Try searching "invalid parameter" on these forums. You re not running ImageMagick.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-23T12:21:06-07:00
by fmw42
snibgo wrote: 2017-01-23T12:17:03-07:00
AlmostThere wrote:Invalid parameter
Try searching "invalid parameter" on these forums. You re not running ImageMagick.
I believe snibgo is suggesting that you are running the Windows convert.exe and not the IM convert.exe. You may need to rename your IM convert.exe to something like im_convert.exe to avoid confusion.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-24T08:15:05-07:00
by AlmostThere
No - that is because my Windows has a Norwegian interface (sorry I forget to mention that in my last post), and for every default messages I have to guess what the English version would be like. I cannot reproduce that exact error message until i got an English windows version in hand.

The actual error message that I see spells "Ugyldig parameter .... " and the rest is probably exact the same. You would probably see an output that is similar but not identical.

Also - the real full-length command line (not the shorted version that I put on forum because of long path) is
J:\download\ImageMagick\ImageMagick-7.0.4-2-portable-Q16-x86\convert.exe

That is the full path to the program, I always use that.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-24T09:24:46-07:00
by snibgo
What is the exact command you gave? What is the entire and exact error message? Please paste the entire message.

Re: Command line - convert to webp and specify quality settings

Posted: 2017-01-24T16:37:14-07:00
by AlmostThere
Hi. For some very strange reason, I don't get that error message now, even if the command was the same. Here is the full path version:

Code: Select all

D:\>cd D:\Dokmenter\Mine bilder\LifeCam Files\knott-4

D:\Dokmenter\Mine bilder\LifeCam Files\knott-4>J:\download\ImageMagick\ImageMagi
ck-7.0.4-2-portable-Q16-x86\convert.exe  "2017-01-13 00-37-13.828.jpg" -quality
50 -define webp:method=6 outputFileName.webp

D:\Dokmenter\Mine bilder\LifeCam Files\knott-4>J:\download\ImageMagick\ImageMagi
ck-7.0.4-2-portable-Q16-x86\convert.exe  "2017-01-13 00-37-13.828.jpg" -quality
50 -define webp:method=1 outputFileName_1.webp

D:\Dokmenter\Mine bilder\LifeCam Files\knott-4>
I ran this command twice with slightly different settings, and both worked perfectly :?

Thanks for your help folks, this one is solved.