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?".
The first bars gradient is fine but the second is offset I assume the gradient is taken from co-ords 0,0 I just can't find a way to shift it, I need to do this in one command and no temp files/pipes, this is hopefully easy for an imagenagik expert but I just can't sus out how to do it, been googling my a*** off!
Last edited by Keith Hedger on 2011-12-20T13:17:58-07:00, edited 1 time in total.
I don't believe that you can do calculations such as $((H-1)) inside the draw. Do them outside as a variable calculation and then just reference the variable.
fmw42 wrote:I don't believe that you can do calculations such as $((H-1)) inside the draw. Do them outside as a variable calculation and then just reference the variable.
In bash $() is command replacement and (()) is c like integer maths so it does the calculation and then substitutes the result so is a valid command line, replacing with constants give the same results.
What is the objective of your command line. Perhaps we can help if we understood further what exactly you are trying to do or see an example. What do you want to do with the tiled gradient with respect to the two draw commands.
Here is what I get by running your command. What is wrong with it? Where do you want the second gradient bar to be located? Without setting -gravity, the default coordinates will be relative to the top left corner as 0,0.
The above should be fine with the right start coordinate and end coordinate for the second gradient. However, with parenthesis processing you can always create your background and two gradients of the size desired and then -compose .. -composite to place them where desired with -geometry. See
This command line is just a snippet and shows the problem (it is not the finished command line, just the bit I can't get working) with the gradient NOT the bar itself, as you can see by the second gradient it is not the same as the top gradient it starts half way. I need both bars to look the same just in different positions.
The -tile command sets an image that you generate as a gradient. by default that image alligns the 0,0 point of the tile with the 0,0 of the canvas when 'drawn'. However you can 'roll' the tile to change this using a -tile-offset setting.
NOTE this is equivalent to simply 'rolling' the tile image before it was set using -roll . As such you can DIY that effect yourself using 'Tiling with in-memory image' techniques. http://www.imagemagick.org/Usage/canvas/#tile_memory
NOTE that tiling a canvas using distorts, also allows you to set tile offsets (and lots more).
Sounds to me simpler to just make two gradient images of the size you want and composite them over the green background. That can be done in one command as mentioned before. See the links at the bottom of my post above.
Keith Hedger wrote:This command line is just a snippet and shows the problem (it is not the finished command line, just the bit I can't get working) with the gradient NOT the bar itself, as you can see by the second gradient it is not the same as the top gradient it starts half way. I need both bars to look the same just in different positions.
Perhaps if we can see more of what you are trying to accomplish we can help further.
For those who may be interested this is the final result, actually its one screen out of 34 generated by a graphical boot sequence, thanks for the help guys!
P.S.
Can I mark this thread as SOLVED like other forums?