Yes, but some clarification of your question may be needed. It's very simple to do with a shell script; e.g., with Awk or Perl. But if your question is whether it can be done without any other tools, then I think the answer is no.
The script is very easy to write, however. You haven't listed all of your requirements, but it could be called with the same arguments as you've passed to convert, and it could simply parse the output of ls -al to get the difference between the uncompressed and compressed sizes.
You may wish to update your question by asking "How would I write a shell script to...", if I've guessed correctly about the intent of the question.
UPDATE The script:
#!/usr/bin/env bash
# script to log before-and-after sizes for imagemagick compression
INPUT_FILENAME="$1"
OUTPUT_FILENAME="$4"
ORIGINAL_SIZE=$(wc -c "${INPUT_FILENAME}" | cut -d ' ' -f1)
convert "$@"
COMPRESSED_SIZE=$(wc -c "${OUTPUT_FILENAME}" | cut -d ' ' -f1)
echo "${OUTPUT_FILENAME} | saved size: $(expr $ORIGINAL_SIZE - $COMPRESSED_SIZE)"
Put this in a script named, for example, convert_with_logging, make it executable with chmod +x convert_with_logging, and call it with the same arguments as you called convert; i.e.,
./convert_with_logging photo.jpg -quality 50% photo2.jpg