How do I run this script?

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
jottocraft
Posts: 4
Joined: 2017-05-15T19:02:56-07:00
Authentication code: 1151

How do I run this script?

Post by jottocraft »

I know this is a dumb question, but I can't seem to figure out how to run this script. I can't have multiple lines in the command prompt to run this. I'm on Windows.

Code: Select all

convert myimage.png \
  -adaptive-resize '144x168>' \
  -fill '#FFFFFF00' -opaque none \
  -dither FloydSteinberg \
  -remap pebble_colors_64.gif \
  -define png:compression-level=9 -define png:compression-strategy=0 \
  -define png:exclude-chunk=all \
  myimage.pbl.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I run this script?

Post by fmw42 »

The command is not a script, it is just a one-line command written on multiple lines to make it easier to read. It is in unix format. If you change all the \ to ^, then it will run in Windows. So after changing (be sure there are no spaces after the ^) and copy and paste it in the CMD window. Or remove all the \ and new lines and make it into one long line, then copy and past it into your CMD window.
jottocraft
Posts: 4
Joined: 2017-05-15T19:02:56-07:00
Authentication code: 1151

Re: How do I run this script?

Post by jottocraft »

Thanks, but I'm getting this error now:

convert: invalid argument for option '-adaptive-resize': '144x168 @ error/convert.c/ConvertImageCommand/667.

I ran it like this: convert myimage.png -adaptive-resize '144x168>' -fill '#FFFFFF00' -opaque none -dither FloydSteinberg -remap pebble_colors_64.gif -define png:compression-level=9 -define png:compression-strategy=0 -define png:exclude-chunk=all myimage.pbl.png
jottocraft
Posts: 4
Joined: 2017-05-15T19:02:56-07:00
Authentication code: 1151

Re: How do I run this script?

Post by jottocraft »

I also got these after removing the part that gave me the error

convert: unable to open image ''#FFFFFF00'': No such file or directory @ error/blob.c/OpenBlob/3094.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/509.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I run this script?

Post by fmw42 »

Change all single quotes to double quotes for Windows.
jottocraft
Posts: 4
Joined: 2017-05-15T19:02:56-07:00
Authentication code: 1151

Re: How do I run this script?

Post by jottocraft »

Thanks, it worked perfectly!
:)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I run this script?

Post by fmw42 »

This may help you in the future. See http://www.imagemagick.org/Usage/windows/
Post Reply