Re: Checking out the new GradientImage in 6.4.4-2
Posted: 2008-10-26T15:47:18-07:00
Channels in PerlMagick are specified like this: channel=>'rgb' or channel=>'red' or channel=>'cmyk'.
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=12225
Thanks, I gather from this that my Red | Green | Blue should be 'rgb', which is not in the lists I see in the PerlMagick doc:magick wrote:Channels in PerlMagick are specified like this: channel=>'rgb' or channel=>'red' or channel=>'cmyk'.
Both 'rgb' and 'grb' work identically; same as 'reg,green,blue' and 'green,red,blue', so I think that 'rg', 'red,green' and such make sense. But my particular tests with 'rg' and other two-channel choices give white images, so I really don't know how to interpret that. It could be that I don't understand what I should get.magick wrote:Try something like channel=>'rg'. This may work as well channel=>'red,green,blue'. And even channel=>'red|green|blue'. Not sure on that one.
Regarding the last statement, does this mean that this future option will produce only the color within the triangle, as in the example?However be warned that the gradient does not just 'stop' but continues to change beyond those points. Traditionally a barycentric gradient will be limited to within the enveloping triangle of points used to generate it.
For example..
convert -size 100x100 xc: \
-sparse-color Barycentric '30,0 red 0,80 blue 99,99 lime' \
\( -size 100x100 xc:black -fill white \
-draw 'polygon 30,5 5,80 95,95' \) \
+matte -compose CopyOpacity -composite \
-fill white -stroke black \
-draw 'circle 30,5 30,7 circle 5,80 5,82 circle 95,95 95,97' \
sparse_bary_triangle.png
FUTURE: when a "Triangular Mesh" method is added in the future then you will get this type of result for the 'mesh' of points given.
Hello Rick,rmabry wrote:From Anthony's world of magick (http://www.imagemagick.org/Usage/canvas ... nt_distort):
Regarding the last statement, does this mean that this future option will produce only the color within the triangle, as in the example?However be warned that the gradient does not just 'stop' but continues to change beyond those points. Traditionally a barycentric gradient will be limited to within the enveloping triangle of points used to generate it.
For example..
convert -size 100x100 xc: \
-sparse-color Barycentric '30,0 red 0,80 blue 99,99 lime' \
\( -size 100x100 xc:black -fill white \
-draw 'polygon 30,5 5,80 95,95' \) \
+matte -compose CopyOpacity -composite \
-fill white -stroke black \
-draw 'circle 30,5 30,7 circle 5,80 5,82 circle 95,95 95,97' \
sparse_bary_triangle.png
FUTURE: when a "Triangular Mesh" method is added in the future then you will get this type of result for the 'mesh' of points given.
That will be great, if so. I'm using this on a huge image with thousands of individual triangles, and it certainly adds to the cost to mask out the unwanted areas.
This is a fabulous addition to ImageMagick --- many thanks to all who developed it.
Rick
would be converted to list of floating point numbers'30,0 red 0,80 blue 99,99 lime'
with the colors showing the relationships.30, 0, 1, 0, 0, 0, 80, 0, 0, 1, 99, 99, 0,1,0
There are two aspects to this.fmw42 wrote:You may already have thought about this, but from our discussions of implementing other functions, your response, often, has been that IM cannot handle arguments that are mixes of strings and numerical values. With -distort you have a distort name (e.g. perspective) and then a quoted string of values. I have suggested other functions that need mixes of strings and numerical values within the quotes, but you have said that currently that is not feasible.