Problems using "-draw" on a TIFF file.
Posted: 2006-12-14T04:15:22-07:00
I'm SLOWLY getting to grips with ImageMagick.
Version: ImageMagick 6.3.1 12/09/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
On Windows XP.
I need to add a banner to a fax file.
An original fax is available at http://rquadling.php1h.com/92CUP6.tif.
I have also included a BATCH file with comments about what I am trying to do to the fax http://rquadling.php1h.com/AddBanner.bat. The file contains, but this form wraps the lines so it is harder to read.
I have managed to increase the size of the image by using
I can save this as a valid Group4 tiff using .
My problem is that drawing anything breaks the image completely.
I want to draw white text on a black background for the date and time in the top left (and the rotated bottom right) corners and the page number in in the top right (and the rotated bottom left) corners with the filename (not the extension) in the top centre (and the rotated bottom centre).
I am really stuck. I am sure I am nearly there.
Using -draw or -annotate both screw up the file.
The tiffinfo program used is part of Cygwin. I also have Paint Shop Pro and that cannot open the broken new file with. If only the border command is used, then I can open it in PSP and the Windows Preview work fine!
Please help!!!
Richard Quadling.
Version: ImageMagick 6.3.1 12/09/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
On Windows XP.
I need to add a banner to a fax file.
An original fax is available at http://rquadling.php1h.com/92CUP6.tif.
I have also included a BATCH file with comments about what I am trying to do to the fax http://rquadling.php1h.com/AddBanner.bat. The file contains
Code: Select all
@ECHO OFF
CLS
ECHO Create new image
REM Draw boxes with appropriate text in them.
SET DRW=-draw " fill white stroke black stroke-width 1 rectangle 0,0 1727,99 fill black rectangle 0,0 339,99 rectangle 1419,0 1727,99 fill black font Consolas font-size 60 stroke white stroke-width 4 text 5,44 '2006/12/14' text 88,94 '09:44' font-size 140 text 1422,94 'Page 1234' fill white font-size 110 stroke black text 610,76 '92CUP6'"
REM Try to draw a simple rectangle.
SET DRW=-draw " rectangle 10,10 20,20"
REM Try to draw a coloured rectangle.
SET DRW=-draw " fill white stroke white rectangle 10,10 20,20"
REM Try to draw some text.
SET DRW=-draw "text 10,10 'RAQ'"
REM Draw nothing.
SET DRW=
REM Take original image.
REM Add a border to the top and the bottom.
REM Add the text to the top of the image.
REM Rotate 180 degrees.
REM Add the text to the top (was the bottom) of the image.
REM Rotate 180 degrees to put the image the same way up.
REM Save it with a new name as a CITT4 fax.
CONVERT 92CUP6.tif -monochrome -units PixelsPerInch -density 204x196 -compress group4 -bordercolor black -fill black -border 0x100 %DRW% -rotate 180 %DRW% -rotate 180 92CUP6-new.tif
ECHO.
ECHO Info about new image
TIFFINFO 92CUP6-new.tif
ECHO.
ECHO Info about original image
TIFFINFO 92CUP6.tif
REM Show the image sizes - should be neglible difference.
DIR *.tif
REM Launch the default viewer (In my case the Windows Picture and Fax Viewer)
REM Must work as this is used by the users to add annotations.
start 92CUP6-new.tif
I have managed to increase the size of the image by using
Code: Select all
-bordercolor black -fill black -border 0x100
Code: Select all
-type bilevel -units PixelsPerInch -density 204x196 -compress group4
My problem is that drawing anything breaks the image completely.
I want to draw white text on a black background for the date and time in the top left (and the rotated bottom right) corners and the page number in in the top right (and the rotated bottom left) corners with the filename (not the extension) in the top centre (and the rotated bottom centre).
I am really stuck. I am sure I am nearly there.
Using -draw or -annotate both screw up the file.
The tiffinfo program used is part of Cygwin. I also have Paint Shop Pro and that cannot open the broken new file with. If only the border command is used, then I can open it in PSP and the Windows Preview work fine!
Please help!!!
Richard Quadling.