Merging/Combining an image and text file side by side -


is there way combine 2 different files (text, image) side side? output image or pdf file etc...? have found methods similar image files , system automated using bash script. looking similar thing. have frames video file , respective sensors data in other text file. need combine image info along sensor data in 1 file. output image, pdf etc... image file having naming sequence 0001.png

with imagemagick installed on linux distros , available macos , windows:

start picture.jpg

enter image description here

and text file called description.txt

these funky cogs found on internet place.  newlines ok, , text gets smaller more add. 

then this:

# width , height of picture read w h < <(convert picture.jpg -format '%w %h' info:-)  # put text on grey background , append right of image convert -background lightgray -size ${w}x${h} -gravity center label:@description.txt picture.jpg +swap +append result.jpg 

enter image description here


there many other possibilities , techniques:

geom=$(convert -format %g picture.jpg info:) convert -background lightgray -size $geom -gravity center -fill blue label:'cogs!' picture.jpg +swap +append result.jpg 

enter image description here


convert -background darkgray -size $geom -gravity center -fill magenta  label:'cogs!' picture.jpg +append -bordercolor black -border 10 result.jpg 

enter image description here


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -