Impossible to add text into a TIF file
Impossible to add text into a TIF file
HI,
I'm using this command to add a text in a tif file:
convert -font Arial -pointsize 72 -compress group4 -draw "text 100,100 'This is a text'" 116288.tif labeled.tif
The output tif file is created but NO NEW TEXT in it... (
Why?
The result of the identify command is:
116288.tif TIFF 6607x4670+0+0 DirectClass 1-bit 156.172kb 0,391u 0:01
Thanks in Advance.
Paolo
I'm using this command to add a text in a tif file:
convert -font Arial -pointsize 72 -compress group4 -draw "text 100,100 'This is a text'" 116288.tif labeled.tif
The output tif file is created but NO NEW TEXT in it... (
Why?
The result of the identify command is:
116288.tif TIFF 6607x4670+0+0 DirectClass 1-bit 156.172kb 0,391u 0:01
Thanks in Advance.
Paolo
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Impossible to add text into a TIF file
try reading in the image before attempting to draw on it!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Impossible to add text into a TIF file
Sorry... How cuould I do this?
how can I read the image?
Thanks again.
Bye
Paolo
how can I read the image?
Thanks again.
Bye
Paolo
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Impossible to add text into a TIF file
Code: Select all
convert 116288.tif -font Arial -pointsize 72 -annotate +100+100 'This is a text' -compress group4 labeled.tif
Read IM Exmaples BASICS
http://imagemagick.org/Usage/basics/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Impossible to add text into a TIF file
Sorry.. but your code doesn't work.
The annotation isn't added to the tif file and the output tif is corrupted (the drawing into it is cut).
Thanks in advance.
Paolo
The annotation isn't added to the tif file and the output tif is corrupted (the drawing into it is cut).
Thanks in advance.
Paolo
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Impossible to add text into a TIF file
I think we need a small example.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Impossible to add text into a TIF file
This is a few lines from my convert.log file which is a record of all the converts that a batch file I have has run.
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg"
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-18__Page-0002__IG2E3H.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:18' font-size 140 text 1422,94 '0002' fill white font-size 110 stroke black text 550,76 'I G 2 E 3 H'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:18' font-size 140 text 1422,94 '0002' fill white font-size 110 stroke black text 550,76 'I G 2 E 3 H'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-18__Page-0002__IG2E3H.jpg"
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-19__Page-0003__RBPF4C.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:19' font-size 140 text 1422,94 '0003' fill white font-size 110 stroke black text 550,76 'R B P F 4 C'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:19' font-size 140 text 1422,94 '0003' fill white font-size 110 stroke black text 550,76 'R B P F 4 C'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-19__Page-0003__RBPF4C.jpg"
This code has run well over 200,000 faxes with no problems.
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg"
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-18__Page-0002__IG2E3H.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:18' font-size 140 text 1422,94 '0002' fill white font-size 110 stroke black text 550,76 'I G 2 E 3 H'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:18' font-size 140 text 1422,94 '0002' fill white font-size 110 stroke black text 550,76 'I G 2 E 3 H'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-18__Page-0002__IG2E3H.jpg"
CONVERT "Y:\CCC\received\2007\11\30\2007-11-30__07-19__Page-0003__RBPF4C.jpg" -resize 1728 -bordercolor black -fill black -border 0x100 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:19' font-size 140 text 1422,94 '0003' fill white font-size 110 stroke black text 550,76 'R B P F 4 C'" -rotate 180 -draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:19' font-size 140 text 1422,94 '0003' fill white font-size 110 stroke black text 550,76 'R B P F 4 C'" -rotate 180 -units PixelsPerInch -density 204x196 -quality 0 -type Optimize "Y:\CCC\received\2007\11\30\2007-11-30__07-19__Page-0003__RBPF4C.jpg"
This code has run well over 200,000 faxes with no problems.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Impossible to add text into a TIF file
Sorry, that I am not going to wade through. I said a small example, as in a small image with the simplified command for testing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Impossible to add text into a TIF file
Ha ha. Anthony, that was just an example from my system to show that you CAN quite easily add text to TIF files. I'm not the person who asked for help.anthony wrote:Sorry, that I am not going to wade through. I said a small example, as in a small image with the simplified command for testing.
Ok, so it wasn't so simple. And getting all the settings to maintain a TIF file is quite hard as I didn't understand what the settings all meant myself.
Step by step breakdown of one of these beasts.
The command to execute
Code: Select all
CONVERT
Code: Select all
"Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg"
Code: Select all
-resize 1728
Code: Select all
-bordercolor black
Code: Select all
-fill black
Code: Select all
-border 0x100
It uses the Consolas font to help differentiate 1/I/l O/0.
Code: Select all
-draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'"
Code: Select all
-rotate 180
Code: Select all
-draw "fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1420,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2007/11/30' text 88,94 '07:16' font-size 140 text 1422,94 '0001' fill white font-size 110 stroke black text 550,76 '9 K F C 9 A'"
Code: Select all
-rotate 180
Code: Select all
-units PixelsPerInch
Code: Select all
-density 204x196
Code: Select all
-quality 0
Code: Select all
-type Optimize
Code: Select all
"Y:\CCC\received\2007\11\30\2007-11-30__07-16__Page-0001__9KFC9A.jpg"
I've just done a quick check and this year alone, this code has worked on over 23,000 faxes (TIFF) and scans (JPG with a slightly different script).