Page 1 of 2

Command Produces Two FIles [ SOLVED ]

Posted: 2019-01-02T14:46:38-07:00
by lindylex
This command produces two files r2.png and -composite. What do I need to modify so it does not produce the "-composite"?

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png

Thanks

Re: Command Produces Two FIles

Posted: 2019-01-02T15:31:35-07:00
by snibgo
What you have shown isn't a valid IM command, unless you have an image file named "convert" (which would be a really bad idea).

I suspect you have somehow combined two commands into one.

I suggest you break your command into logical lines, to help anyone understand it.

Re: Command Produces Two FIles

Posted: 2019-01-02T16:10:57-07:00
by fmw42
One suggestion is to reformat to put each parenthesis step on a separate line and put \ at the end of each line. That way, we might be able to understand better what you are doing.

Another help would be to put a numbered comment line above your whole command for each line of the reformatted command. That way we can understand better what each parenthesis section is supposed to be doing.

Re: Command Produces Two FIles

Posted: 2019-01-02T18:01:38-07:00
by magick
It looks like your command is improperly copy/pasted. Tossing the first part of your command, we get a valid ImageMagick script:

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png
Does that work for you?

Re: Command Produces Two FIles

Posted: 2019-01-03T12:51:27-07:00
by lindylex
magick wrote:
2019-01-02T18:01:38-07:00
It looks like your command is improperly copy/pasted. Tossing the first part of your command, we get a valid ImageMagick script:

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png
Does that work for you?
Thanks it worked.

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png

I read this documentation

Code: Select all

http://www.imagemagick.org/Usage/basics/#parenthesis
It does not clearly explain how to use parenthesis for multiple command. Can you please explain some more or guide me to something more informative?

Re: Command Produces Two FIles

Posted: 2019-01-03T12:59:30-07:00
by lindylex
UPDATE I spoke to soon.

This command my original command, generates two files "r2.png" and "-composite".

Code: Select all

 convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232"> -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png 

Re: Command Produces Two FIles

Posted: 2019-01-03T13:17:55-07:00
by lindylex
Yes that was a mistake with the original post.
snibgo wrote:
2019-01-02T15:31:35-07:00
What you have shown isn't a valid IM command, unless you have an image file named "convert" (which would be a really bad idea).

I suspect you have somehow combined two commands into one.

I suggest you break your command into logical lines, to help anyone understand it.

Re: Command Produces Two FIles

Posted: 2019-01-03T13:18:27-07:00
by lindylex
Here it is broken out.

Code: Select all

convert bgPapaer.jpg \   << This is the background image

Code: Select all

( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)"  << This creates an image with a trasparent bg and uses the words from the text file temp.txt as the caption.

Code: Select all

\( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \)  << This layers the two images.

Code: Select all

-gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232">   << This creates a text caption and places it on the top left side of the image.

Code: Select all

-composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" << This creates a text caption and places it at the bottom of the image

Code: Select all

r2.png  << This is the final file name.
fmw42 wrote:
2019-01-02T16:10:57-07:00
One suggestion is to reformat to put each parenthesis step on a separate line and put \ at the end of each line. That way, we might be able to understand better what you are doing.

Another help would be to put a numbered comment line above your whole command for each line of the reformatted command. That way we can understand better what each parenthesis section is supposed to be doing.

Re: Command Produces Two FIles

Posted: 2019-01-03T15:46:53-07:00
by fmw42
That was not quite what I meant.

Write all the comments. Then write your commands in sections with line break \ at the end in short sections that fit on the page so that one does not have to scroll left right. You can break a parenthesis section into multiple parts with \ if needed.

#comment for line 1
#comment for line 2
#comment for line 3
...

Code: Select all

convert
\( parenthesis processing 1 \) \
\( parenthesis processing 2 \) \
other commands \
...
This would be more useful to me and how I do it. Other people write one setting or operator per line.

Re: Command Produces Two FIles

Posted: 2019-01-03T15:51:01-07:00
by snibgo
lindylex wrote:-annotate +30+0 "1/232">
What is that greater-than doing? Ending the command, and redirecting output to "-composite", I guess.

Re: Command Produces Two FIles

Posted: 2019-01-03T17:42:03-07:00
by lindylex
I do not want to pipe anything to -convert. I think that might not be correct.

I took it out and tried this.

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232" -composite -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, Joost Elffers" r2.png
I receive this error ERROR .

Code: Select all

convert-im6.q16: no images defined `r2.png' @ error/convert.c/ConvertImageCommand/3258.
snibgo wrote:
2019-01-03T15:51:01-07:00
lindylex wrote:-annotate +30+0 "1/232">
What is that greater-than doing? Ending the command, and redirecting output to "-composite", I guess.

Re: Command Produces Two FIles

Posted: 2019-01-03T17:58:39-07:00
by fmw42
You can do one of at least two simple things to fix your command line.

1) Separate it into multiple commands and show us the commands that work

2) If you cannot get separate commands to work, then put +write tmpX.png statements (X=1,2...N) after each operator and see if it is producing the right image at each stage.

Re: Command Produces Two FIles

Posted: 2019-01-03T18:08:59-07:00
by lindylex
The command generate the image I want. It has an extra image that I do not want. This is what I want to resolve.

How do I do this? "+write tmpX.png statements"?
fmw42 wrote:
2019-01-03T17:58:39-07:00
You can do one of at least two simple things to fix your command line.

1) Separate it into multiple commands and show us the commands that work

2) If you cannot get separate commands to work, then put +write tmpX.png statements (X=1,2...N) after each operator and see if it is producing the right image at each stage.

Re: Command Produces Two FIles

Posted: 2019-01-03T18:21:48-07:00
by lindylex

Code: Select all

convert bgPapaer.jpg \( -size 950x950 -background "rgba(0,0,0,0)" -font /home/lex/share/Mo_De_Studio/audio_blog/OpenSans/OpenSans-ExtraBold.ttf -fill "#000000" caption:"$(cat ./temp.txt)" \( +clone -shadow 0x0+0+0 \) +swap -background "rgba(0,0,0,0)" -layers merge +repage \) -gravity center -composite -gravity northwest -pointsize 50 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +30+0 "1/232" +write tmp1.png > -composite +write tmp2.png -gravity south -pointsize 40 -font /home/lex/share/python/ffmpegHelper/fonts/Typoster_ROCK_ON.otf -annotate +0+10 "Robert Greene, 
Joost Elffers" +write tmp3.png r2.png

This produces all the images along the way. All the command work. It produces this empty file still "-composite". I think it has to do with the > in the command here.

Code: Select all

-annotate +30+0 "1/232" +write tmp1.png > -composite 
If I take out the > it fails. Nothing about it looks right being there.
fmw42 wrote:
2019-01-03T17:58:39-07:00
You can do one of at least two simple things to fix your command line.

1) Separate it into multiple commands and show us the commands that work

2) If you cannot get separate commands to work, then put +write tmpX.png statements (X=1,2...N) after each operator and see if it is producing the right image at each stage.

Re: Command Produces Two FIles

Posted: 2019-01-03T19:33:14-07:00
by lindylex
If this helps here is the command and the assets I am using. http://mo-de.net/d/hlp.zip