PDFlabels-0227.txt Generating PDF labels. 1) Start with diffraction pattern diffpattern2s1.jpg Scale it to be 732x732 pixels: mogrify -scale 732x732 diffpattern2s1.jpg Use gimp to set it to 150 pixels/inch Use gimp to erase center hub space 2) (0,0) is UL corner. cp diffpattern2s1.jpg tests2.jpg mogrify -draw 'text 200,200 "starts at 200,200" ' tests2.jpg draws text starting in UL quadrant mogrify -pointsize 24 -font Arial.ttf \ -draw 'text 100,240 "Arial.ttf" ' tests2.jpg sets pointsize! 2.5) Build an image which must be annotated by text: a. create a 722x722 jpg with white background and big blue disc convert -size 722x722 xc:white -stroke lightblue -fill lightblue \ -draw 'circle 361,361 0,361' mask1.jpg b. create a slightly smaller black disc inside it, leaving a blue rim mogrify -fill black -draw 'circle 361,361 3,361' mask1.jpg c. Create a blue disc in the center, where the hub will be, with a slightly smaller white mask inside. mogrify -fill lightblue -draw 'circle 361,361 436,361' mask1.jpg mogrify -fill white -draw 'circle 361,361 431,361' mask1.jpg d. Combine the diffraction pattern or other image with the mask to make base1.jpg, the template to which we will add text composite -compose Plus dp2.jpg mask1.jpg base1.jpg 3) diffpat-masked.jpg is the image template to which we will add stuff perl script to use mogrify to add annotation file to image file usage: buildlabel1 annotation_file template.jpg annotated.jpg annotation file is in form: x,y^size^color^font^text x,y -- offset in pixels (150px/in) from UL size -- pointsize of font color -- eg, red, blue, plum, black font -- eg, Arial, Helvetica, Times, Candice, Ravie, Gecko (I don't know what else) Using command of the form: mogrify -pointsize 14 -fill blue -font Candace \ -draw 'text 50,360 "middle of disc"' tests2.jpg (font spec does not work in this form) 4) Add the fixed part of the label: ./buildlabel1 xray-label-fixed-01.ann base1.jpg test1.jpg 5) Add the variable part of the label ./buildlabel1 example1.ann test1.jpg ex1.jpg Re-apply the mask: composite -compose Plus test1.jpg mask1.jpg test1f.jpg Convert to PDF convert -density 150 -units PixelsPerInch test1f.jpg test1f.pdf 6) When sendinf test1f to elijah to be printed, use binary ode for the ftp transfer.