GetStrokeColor with stroke_pattern

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

GetStrokeColor with stroke_pattern

Post by rmabry »

I asked about it in the Users forum,

http://redux.imagemagick.org/discourse- ... hp?p=25356

but maybe it is better here:

There is code in draw_private.h, in the function GetStrokeColor, that allows for strokes to be filled with a pattern, just as are fills. Is this not yet implemented in PerlMagick or the command line?

Rick
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

We'll add fill-pattern and stroke-pattern to Annotate() and Draw() or PerlMagick in the next point release. In the mean-time you can annotate/draw from an MVG script which permits fill and stroke patterns.
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post by rmabry »

magick wrote: We'll add fill-pattern and stroke-pattern to Annotate() and Draw() or PerlMagick in the next point release.


How about the command line?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

We'll add -fill-pattern and -stroke-pattern to the command line in the next point release.
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post by rmabry »

magick wrote: We'll add -fill-pattern and -stroke-pattern to the command line in the next point release.


Cool. Is -fill-pattern synonymous with -tile? And how does the -origin setting fit inhere? I can imagine situations where an independent origin for strokes and fills is desirable. On a commandline it makes sense to have

Code: Select all

... -origin +20+20 -stroke-pattern stroker.png -origin +100+25 -fill-pattern filler.png ...
.

What about in PerMagick? Does the order of options and settings act the same way?

Code: Select all

...
$image->Draw(..., origin => "+20+20", 
                 stroke-pattern => $stroker, 
                 origin => "+100+25",  
                 -fill-pattern => $filler, ...);
...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

After some thought, and noticing how it works in the drawing module, we'll enhance -fill and -stroke to accept filenames as a parameter on the command line and in PerlMagick. For example,
  • -stroke stroke.png
This feature will be available within the next few days in ImageMagick 6.3.2-2 Beta. We'll make sure -origin updates the patterns.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Now that makes a lot of sense for these color options. It will also obsolete the current usage of -tile in convert, opening the way for this setting to have more montage like usage in convert

However I can see people then wanting -background 'tile_image' and so on. Arrrggghhhhh.....

When you document you better make it clear that "tile_image" is only usable for
-fill and -stroke settings.

I still also need to example the use of 'origin' in tile drawing, though that will be in the 'draw' section of IM Examples, even though it is used in many other places.

WARNING: currently -tile is NOT used to override -fill for label: and caption:. This change may also effect that aspect of IM so some extra testing may be needed, to determine the extent of the change.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply