Damien Dunlop on  wrote...
| Thanks Fred,
| 
| > >ImageMagick is definitely less confusing than it
| > >used to be, but the order of options still matters.
| > >
| > >>From Anthony's helpful description of how it works, I
| > >assumed that one can create a canvas and then place various
| > >objects on the canvas. In doing this, the objects would be
| > >layered in the order they appear within the command and
| > >then finally merged at the end with say -flatten.
| > >
| > >The following command creates a canvas, overlays a smaller area,
| > >then draws two lines. But it appears the lines are applied
| > >not only to the original canvas, they are also applied to the
| > >overlaid area.
| > >
| > >convert -size 1500x1500 xc:white \
| > >      \( -size 1000x500 xc:lightblue -repage 0x0+0+950 \) \
| > >         -stroke black -linewidth 5 \
| > >         -draw 'line 1499,50 50,50' \
| > >         -draw 'line 50,50 50,950' \
| > >         -flatten A.gif
| > >
| > >If the option overlaying the smaller area is shifted
| > >to after the -draw options as below, then the two lines appear
| > >as intended.
| > >
| > >convert -size 1500x1500 xc:white \
| > >         -stroke black -linewidth 5 \
| > >         -draw 'line 1499,50 50,50' \
| > >         -draw 'line 50,50 50,950' \
| > >     \( -size 1000x500 xc:lightblue -repage 0x0+0+950 \) \
| > >        -flatten B.gif
| > >
| > >The above is the reduction of a complex command involving
| > >multiple image overlays, multiple lines and multiple annotations.
| > >It took considerable time to discover why unwanted lines
| > >mysteriously appeared - sometimes in colors different from
| > >those originally specified.
| > >
| > Please clarify where you want the lines drawn. You do not say 
| > specifically in advance and it is hard to know from you examples.
| 
| > In general, you will need to include the line drawing in parenthesis 
| > with the processing of the image over which you want it, unless the 
| > lines are to be drawn over the composited result.
| > 
| 
| The lines are to be drawn over the composited result.
| 
| Given the hypothesis that one is adding objects  to successive
| layers in the order of the options on the command line, the first
| example was constructed as follows:
| 
| a) Create a a canvas 
| 
| b) Open parentheses to create a smaller area and do things to it 
| (if required) within the parentheses to avoid affecting the canvas
| 
| c) Position the smaller area on the canvas and leave the parentheses
| 
| d) Draw some lines. Because these are not in parentheses, their 
| coordinates are with respect to the canvas and they are intended 
| to cover whatever is before (below). They could cover the smaller
| area (if required), but still, with respect to the coordinates of 
| the canvas. In the particular example given, the lines did not 
| cover the smaller area.
| 
| e) Merge the lot.
| 
| With the example given, one way the required result can be
| achieved is by inserting -flatten after laying down the smaller 
| area and before drawing the lines.
| 
| convert -size 1500x1500 xc:white \
|      \( -size 1000x500 xc:lightblue -repage 0x0+0+950 \) \
|         -flatten \
|         -stroke black -linewidth 5 \
|         -draw 'line 1499,50 50,50' \
|         -draw 'line 50,50 50,950' \
|         -flatten A.gif
| 
| Either my hypothesis about how ImageMagick commands are
| interpreted is incorrect or ImageMagick still contains some
| `anomalies'.
| 
If you want to draw over the combined image,  yes that is correct.

You were never clear what you were trying to achieve.  that is what
image to draw over.

Remember untill you flatten you have two seperate images, and operators
apply to BOTH.

Read  Basics, parenthesis.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
    I have a Dragon here, and I am not afraid to use it!
                                    -- Donkey, "Shrek" the movie
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to