参数
自定义参数¶
If gm
does not supply you with a method you need or does not work as you'd like, you can simply use gm().in()
or gm().out()
to set your own arguments.
gm().command()
- Custom command such asidentify
orconvert
gm().in()
- Custom input argumentsgm().out()
- Custom output arguments
The command will be formatted in the following order:
command
- ieconvert
in
- the input argumentssource
- stdin or an image fileout
- the output argumentsoutput
- stdout or the image file to write to
For example, suppose you want the following command:
gm "convert" "label:Offline" "PNG:-"
However, using gm().label()
may not work as intended for you:
gm() .label('Offline') .stream();
would yield:
gm "convert" "-label" "\"Offline\"" "PNG:-"
Instead, you can use gm().out()
:
gm() .out('label:Offline') .stream();
which correctly yields:
gm "convert" "label:Offline" "PNG:-"