Page 2 of 2

Re: Make png image semi transparent

Posted: 2016-12-17T16:22:01-07:00
by fmw42
Artman wrote:with this example also i have a problem under windows

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
            -draw "fill black text 27,67 "Led Zeppelin" ^
                              text 25,68 "Led Zeppelin" ^
                              text 23,67 "Led Zeppelin" ^
                              text 22,65 "Led Zeppelin" ^
                              text 23,63 "Led Zeppelin" ^
                              text 25,62 "Led Zeppelin" ^
                              text 27,63 "Led Zeppelin" ^
                              text 28,65 "Led Zeppelin" ^
                   fill white text 25,65 "Led Zeppelin" " ^
			7.png
what wrong?
Use single quotes around your Led Zeppelin, not double quotes. Your double quotes for your text conflict with the double quotes around the draw command.

Use double quotes for the -draw "..." and single quotes for the actual text. I do not think you can do it the other way around.


So try:

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
            -draw "fill black text 27,67 'Led Zeppelin' ^
                              text 25,68 'Led Zeppelin' ^
                              text 23,67 'Led Zeppelin' ^
                              text 22,65 'Led Zeppelin' ^
                              text 23,63 'Led Zeppelin' ^
                              text 25,62 'Led Zeppelin' ^
                              text 27,63 'Led Zeppelin' ^
                              text 28,65 'Led Zeppelin' ^
                   fill white text 25,65 'Led Zeppelin' " ^
         7.png


This works fine for me in unix syntax:

Code: Select all

magick -size 320x100 xc:lightblue -font georgia -pointsize 72 \
-draw "fill black text 27,67 'Led Zeppelin' \
text 25,68 'Led Zeppelin' \
text 23,67 'Led Zeppelin' \
text 22,65 'Led Zeppelin' \
text 23,63 'Led Zeppelin' \
text 25,62 'Led Zeppelin' \
text 27,63 'Led Zeppelin' \
text 28,65 'Led Zeppelin' \
fill white text 25,65 'Led Zeppelin'" \
7.png
Except 320 is too short and so the text is cut off.

See examples at http://www.imagemagick.org/Usage/text/#draw

Re: Make png image semi transparent

Posted: 2016-12-18T07:09:45-07:00
by glennrp
Artman wrote:with this example also i have a problem under windows

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
            -draw "fill black text 27,67 "Led Zeppelin" ^
                              text 25,68 "Led Zeppelin" ^
                              text 23,67 "Led Zeppelin" ^
                              text 22,65 "Led Zeppelin" ^
                              text 23,63 "Led Zeppelin" ^
                              text 25,62 "Led Zeppelin" ^
                              text 27,63 "Led Zeppelin" ^
                              text 28,65 "Led Zeppelin" ^
                   fill white text 25,65 "Led Zeppelin" " ^
			7.png
what wrong?
You have quotes inside quotes. Either "escape" the inner quotes or use single quotes around the
entire draw option. The problem you are having is with Windows syntax, so I can't
help you with the details.

Re: Make png image semi transparent

Posted: 2016-12-18T10:02:02-07:00
by Artman
thanks guys for your replays. its work for me under windows but only as single line.
its question about that much easier work with formatted text.

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
            -draw "fill black text 27,67 'Led Zeppelin' text 25,68 'Led Zeppelin' text 23,67 'Led Zeppelin' text 22,65 'Led Zeppelin' text 23,63 'Led Zeppelin' text 25,62 'Led Zeppelin' text 27,63 'Led Zeppelin' text 28,65 'Led Zeppelin' fill white text 25,65 'Led Zeppelin' " ^
			LZ.png
thanks again.

Re: Make png image semi transparent

Posted: 2016-12-18T13:04:51-07:00
by fmw42
Does this work?

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
-draw "fill black text 27,67 'Led Zeppelin' ^
text 25,68 'Led Zeppelin' ^
text 23,67 'Led Zeppelin' ^
text 22,65 'Led Zeppelin' ^
text 23,63 'Led Zeppelin' ^
text 25,62 'Led Zeppelin' ^
text 27,63 'Led Zeppelin' ^
text 28,65 'Led Zeppelin' ^
fill white text 25,65 'Led Zeppelin' " ^
7.png
It is possible that copy and paste changes the spaces and line endings. Be sure you have no space after ^

It is also possible that using leading tabs in place of spaces is causing your issue.

Re: Make png image semi transparent

Posted: 2016-12-18T13:45:51-07:00
by Artman
fmw42 wrote:Does this work?

Code: Select all

.\bin\magick -size 320x100 xc:lightblue -font georgia -pointsize 72 ^
-draw "fill black text 27,67 'Led Zeppelin' ^
text 25,68 'Led Zeppelin' ^
text 23,67 'Led Zeppelin' ^
text 22,65 'Led Zeppelin' ^
text 23,63 'Led Zeppelin' ^
text 25,62 'Led Zeppelin' ^
text 27,63 'Led Zeppelin' ^
text 28,65 'Led Zeppelin' ^
fill white text 25,65 'Led Zeppelin' " ^
7.png
It is possible that copy and paste changes the spaces and line endings. Be sure you have no space after ^

It is also possible that using leading tabs in place of spaces is causing your issue.
its not work coz cli under windows have many specific rules.
but i consulted with one top pro in windows and him give me good solution:

Code: Select all

.\bin\magick -size 470x100 xc:lightblue ^
			-font georgia -pointsize 72 ^
			-fill black ^
			-draw "text 27,67 'Led Zeppelin'" ^
			-draw "text 25,68 'Led Zeppelin'" ^
			-draw "text 23,67 'Led Zeppelin'" ^
			-draw "text 22,65 'Led Zeppelin'" ^
			-draw "text 23,63 'Led Zeppelin'" ^
			-draw "text 25,62 'Led Zeppelin'" ^
			-draw "text 27,63 'Led Zeppelin'" ^
			-draw "text 28,65 'Led Zeppelin'" ^
			-fill white ^
			-draw "text 25,65 'Led Zeppelin'" ^
         LZ3.png

as you can see this code proper formated and easy to read and understand
and this code work like charm under windows.
all about put couple more draw to avoid escape characters that windows cli not so like.
i believe its best solution. thanks again for your time.

Re: Make png image semi transparent

Posted: 2016-12-18T14:39:30-07:00
by snibgo
The problem was that the command had a "quoted string" split between lines, with a caret ^ at the line ends. That works in bash but not Windows.

Re: Make png image semi transparent

Posted: 2016-12-19T23:54:31-07:00
by anthony
General... Masks as colored Shapes..
http://www.imagemagick.org/Usage/masking/#shapes

But in your case just using +level-colors Gold would convert teh black shape to a Gold Shape
http://www.imagemagick.org/Usage/color_ ... vel-colors

Or a more complex and older technique -fill Gold -colorize 100%
http://www.imagemagick.org/Usage/color_mods/#colorize

Strangely colorize is preserving the alpha chanel of the image. My Examples indicate that it should also tint the fully transparent areas!
Is this a bug?

Re: Make png image semi transparent

Posted: 2016-12-20T00:12:41-07:00
by fmw42
Strangely colorize is preserving the alpha chanel of the image. My Examples indicate that it should also tint the fully transparent areas!
Is this a bug?
Somewhere along the way, -colorize changed. You have to specify -channel rgba -fill "rgba(rr,gg,bb,aa)" -colorize yyy if you want to include the alpha channel.

Re: Make png image semi transparent

Posted: 2016-12-20T00:17:46-07:00
by anthony
So it has gone back to what it was before v6.7.9 where it pretty much ignored the alpha channel.
making it equivelent to +level-color {color}

Re: Make png image semi transparent

Posted: 2016-12-20T00:23:53-07:00
by fmw42
I do not recall when nor what the reason was. Sorry! Perhaps the changelog says.