Image to pdf

convert 01.JPG -canny 0x1+10%+30% image_fuzzy_trim.jpg

convert tmp1.gif -trim out.jpg

convert .JPG -crop 1650x2100+400+0 image_.jpg

convert *.JPG mydoc.pdf

convert -density 300x300 -quality 100 *.JPG mydoc.pdf

infile=”01.JPG”
ww=250
hh=300
inname=convert "$infile" -format "%t" info:
convert “$infile” -canny 0x1+10%+30% tmp1.gif
coords=compare -metric rmse -subimage-search -dissimilarity-threshold 1 tmp1.gif \( -size ${ww}x${hh} xc:white \) null: 2>&1 | cut -d\ -f4
xoff=echo "$coords" | cut -d, -f1
yoff=echo "$coords" | cut -d, -f2
convert “$infile” -crop ${ww}x${hh}+${xoff}+${yoff} +repage ${inname}_crop.jpg

https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=32232

http://www.imagemagick.org/discourse-server/viewtopic.php?t=23613

https://github.com/ImageMagick/ImageMagick/issues/396

http://www.imagemagick.org/discourse-server/viewtopic.php?t=19123

https://www.imagemagick.org/discourse-server/viewtopic.php?t=25405