Usage Tip: Specify a Canvas as a Single Argument
Posted: 2015-08-05T18:16:28-07:00
Many times you have a script (be it Fred's, or Snibgo's) that takes a base image as an argument.
For example a script that takes a input and output image and processes it in some magical way
Many times I ask it to display the result on screen without saving to a file
But it has always been harder to just give a 'blank' input image to the script, requiring you to do things like...
Or modify the script to generate a blank starting image.
Well here is a tip for you... Supply a blank canvas image of any size or color as a single argument....
NOTE the '!' is important as you are basically resizing a base xc: image, and without it the input will be a square 300x300 pixels (or something else if -size is set where it gets inserted into the IM command in the script).
I added the canvas generation technique to IM Examples, Canvas page.
Enjoy
For example a script that takes a input and output image and processes it in some magical way
Code: Select all
do_some_magick input.png output.png
Code: Select all
do_some_magick input.png show:
Code: Select all
convert -size 400x300 xc:Salmon miff:- | do_some_magick miff:- show:
Well here is a tip for you... Supply a blank canvas image of any size or color as a single argument....
Code: Select all
do_some_magick 'xc:Salmon[400x300!]' show:
I added the canvas generation technique to IM Examples, Canvas page.
Enjoy