4

I routinely prepare screenshot graphs from my running activities from Strava for input and analysis by an AI on the free plan of ChatGPT. There are substantial limitations for image upload and analysis with ChatGPT, currently allowing only 3 images for detailed analysis per 24 hour period of a quite small size.

Currently I stitch the 3 required images together, convert them to a single image with Gimp, resize the image and then export them. Cumbersome...

How can I semi-automate this process with the Ubuntu command line, producing a small but clear image that can be easily analyzed by an AI? An example of 3 typical images / graphs is here, labelled on my system splits.png, power.png and HR.png:

enter image description hereenter image description hereenter image description here

I usually organize the image 'Power' to the side and the remaining images stacked up to the side...

7
  • 2
    If you log out of ChatGPT and clear your cookies every time you hit the image limit, it will forget you ever uploaded images. Commented yesterday
  • Aside - what kind of info do you get out of this, that you can't get from strava already ? And did you know that bicycles.stackexchange.com exists ? Commented 22 hours ago
  • @Criggie The AI provides analysis, comparison and discussion of results as well as training direction and links to further discussion papers etc. I did not know that a bicycle group existed but I guess I don't cycle 🙂. Commented 20 hours ago
  • 1
    @Criggie I suspect that the 'Power' graph might have mislead you as well :). More common for cyclists but runners are increasingly using this metric these days... Commented 18 hours ago
  • 2
    @Criggie Not bad for an old boy :) Commented 18 hours ago

1 Answer 1

5

This can be accomplished quite neatly using the utility imagemagick under Ubuntu:

sudo apt install imagemagick

Using the screen captures you have extracted from Strava:

  • HR.png Graph showing heart rate during a training run.

  • splits.png Graph showing the kilometre splits for a training run

  • power.png Graph showing power estimates for a training run

The full command line to stitch the images together, resize the completed image and then export as a suitable sized, clear image is as follows:

convert HR.png splits.png -append intermediate.png && \
convert power.png intermediate.png +append composite.png && \
convert composite.png -resize 800x -quality 70 final.jpg && \
rm intermediate.png composite.png
  • Line 1: Create the file intermediate.png with HR.png and splits.png vertically stacked.

  • Line 2: Add the power.png and the intermediate.png to composite.png with horizontal stacking.

  • Line 3: Convert the file composite.png to a lower quality jpg file and resize to save file size while retaining clarity.

  • Line 4: Remove the intermediate files.

And the resulting file is perfect for AI analysis while remaining small enough to not suck up too much of the size allowance:

enter image description here

There may be an issue with longer runs. For Marathon efforts it will be necessary to alter some of the command line as follows, this demonstrates how to change the fields:

convert HR.png power.png -append intermediate.png && \
convert splits.png intermediate.png +append composite.png && \
convert composite.png -resize 800x -quality 70 final.jpg && \
rm intermediate.png composite.png

And this produces the following:

enter image description here

And you see now that the longer field now neatly balances out the 2 smaller fields...

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.