Page 1 of 1

[HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T13:13:48-07:00
by thaysen13
Hi
I want to label my pictures.
I have found that with th command identify I know the date the picture was taken.
and with convert you can add labels to you image.
But how can you set the date on the left of a picture and the costum label in the middle.
I have already this as code https://imgur.com/gDXIACV
Please help

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T13:52:01-07:00
by Bonzo
What version of Imagemagick are you using - it would probably be simpler with V7?

Posting your code here is easier for somebody to try it rather than working from an image.

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T14:25:58-07:00
by fmw42
Create two images from your text with transparent backgrounds using label:. The composite them one at a time using -gravity and -geometry to place them where you want.

Alternately, write the text using -draw or two sets of -annnotate to put the text directly on your image.

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T14:47:39-07:00
by thaysen13
Can you post an example command how to do it please?

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T14:51:29-07:00
by Bonzo
You still did not say what version you are using. This will print the date and time on the image ( V7 only ) getting the data from the image:

Code: Select all

magick input.jpg -gravity northwest -annotate +0+0 "%[EXIF:DateTime]" output.jpg
With V6 you would need to read the datetime into a variable first.

Where are you getting your custom data from?

Never mind you did not answer my question or post your code here as requested.

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-26T14:53:48-07:00
by fmw42
Try this

Code: Select all

convert logo: -font Arial -pointsize 24 -fill black \
-gravity southwest -annotate +10+10 "Dec. 26, 2017" \
-gravity south -annotate -50+50 "Custom Text" \
logo_annotate.jpg

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T01:17:32-07:00
by thaysen13
Thanks guys i am using the imagemagick 6.2 i think

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T01:52:49-07:00
by thaysen13
I want to make somthing like this but with 2 labels.
http://www.imagemagick.org/Usage/annotating/#annotating (first example)
And all the picture I have are different sizes

Code: Select all

 convert foto3.jpeg -pointsize 12 -background Khaki -fill black -gravity southwest-annotate0 "date" \
 	-gravity south -annotate 0 "costum text" foto3.jpeg
The only thing that isn't working is the background

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T01:56:35-07:00
by thaysen13
fmw42 wrote: 2017-12-26T14:25:58-07:00 Create two images from your text with transparent backgrounds using label:. The composite them one at a time using -gravity and -geometry to place them where you want.

Alternately, write the text using -draw or two sets of -annnotate to put the text directly on your image.
Can you give me an example please?

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T05:38:05-07:00
by snibgo
thaysen13 wrote:The only thing that isn't working is the background
"-background" is relevant for "label:" (which creates a new image), but not for "-annotate" (which modifies an image that already exists).

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T05:39:10-07:00
by thaysen13
snibgo wrote: 2017-12-27T05:38:05-07:00
thaysen13 wrote:The only thing that isn't working is the background
"-background" is relevant for "label:" (which creates a new image), but not for "-annotate" (which modifies an image that already exists).
Thanks i am trying to do it with stroke

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T06:46:45-07:00
by thaysen13
This is what i got:

Code: Select all

convert fotog.jpeg -pointsize 15 -gravity south -background white \
-fill black label: lksdfjfdjsfs  \
 -gravity southwest label: datum -append foto35.jpeg
the result is:
https://imgur.com/Nt33j51

I tried this also

Code: Select all

convert fotog.jpeg -pointsize 15 -gravity south -background white \
-fill black label: lksdfjfdjsfs -append  \
 -gravity southwest label: datum -append foto35.jpeg
that result is this:
https://imgur.com/Hc8DBOY

I want the date left and the costum label in the middle but the problem is that they are not on the same line can anyone help with this?

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T07:04:38-07:00
by snibgo
After appending the first label, create the second label, but don't append it. Instead, composite it over the image, eg:

Code: Select all

convert toes.png label:Centre  -gravity South -append label:left -gravity southwest -composite out.png
Pease don't start new threads asking a question you have already asked. I've deleted your other threads.

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T07:33:47-07:00
by thaysen13
Thanks for the answer I got it know!

Re: [HOWTO]Labeling picture (date and costum label)

Posted: 2017-12-27T11:21:42-07:00
by fmw42
-annotate uses -undercolor, if you want to put a different color under the text. So you can go back to my original two -annotates, if you want.