I created a script to compare the time speeds of both programs taking a simple full screenshot. (script listed at end of post)
Code: Select all
./timetrial.sh
Simple Capture Times
Magick Scrot
real 0m0.774s real 0m0.184s
real 0m0.863s real 0m0.107s
real 0m0.603s real 0m0.098s
real 0m0.688s real 0m0.102s
real 0m0.840s real 0m0.112s
real 0m0.850s real 0m0.098s
real 0m0.873s real 0m0.097s
real 0m0.860s real 0m0.099s
real 0m0.849s real 0m0.105s
real 0m0.564s real 0m0.098s
In other testing with capture and resize, there appears to be almost no performance boost for running imagemagick in a single command verses 2 commands. (Which makes scrot faster, even if we need to resize later with image magick)
Code: Select all
import -window root -resize 75% test.jpg
Code: Select all
import -window root test.jpg&& convert test.jpg -resize 75% test.jpg
Imagemagick and scrot are both written in C, so perhaps some middle ground could be met? If the time issue is based on cross platform compatibility, perhaps a .config file could be created once imagemagick knows what type of system it's on??
This was the script used to compare times:
Code: Select all
#!/usr/bin/env bash
# timetrial.sh
function capturemagick {
import -window root test.jpg
}
function capturescrot {
scrot test.jpg
}
LOOP=10
SCROTTIME=""
MAGICKTIME=""
echo "Simple Capture Times"
echo "Magick Scrot"
for i in $(seq $LOOP)
do
MAGICKTIME=$((time (capturemagick) 2>&1) | grep "real")
SCROTTIME=$((time (capturescrot) 2>&1) | grep "real")
echo "$MAGICKTIME $SCROTTIME"
done