I have a JPG image, to which every few minutes I output narrow vertical stripes (2-3 pixels) from another JPG image. For some reason, small white squares appear on the resulting image.
When the stripes were wider (about 50 pixels), I did not notice such a problem.
Screenshot: https://prnt.sc/mel1tf
The image is formed in this way (bash script):
Code: Select all
SRC="images.jpg"
DST="result.jpg"
let NOW=`date +"%s"`-`date --date="00:00" +"%s"`
let MW=`identify -format "%w" "$DST"`
let MH=`identify -format "%h" "$DST"`
let MX0=`calc "int(${MW}*${NOW}/86400)"`
let MX1=`calc "int(${MW}*(${NOW}+${INT})/86400)-1"`
if [ $MX1 -ge $MW ]; then let MX1=$MW-1 ; fi
let MW1=$MX1-$MX0+1
let MX2=`calc "int(${MW}*(${NOW}+2*${INT})/86400)-1"`
if [ $MX2 -ge $MW ]; then let MX2=$MW-1 ; fi
let MW2=$MX2-$MX0+1
convert "$DST" -size ${MW2}x${MH} -fill black -draw "rectangle ${MX0},0 ${MX2},${MH}" "$DST"
convert "$SRC" -crop ${MW1}x${MH}+${MX0}+0 "/tmp/crop.jpg"
composite -geometry +${MX0}+0 "$TMP/crop.jpg" "$DST" "$DST"
rm -f "/tmp/crop.jpg"
Version: ImageMagick 6.7.7-10 2018-05-23 Q16 http://www.imagemagick.org
OS: Linux srv-svc03 3.2.0-6-amd64 #1 SMP Debian 3.2.102-1 x86_64 GNU/Linux