Generate Images from Pages

I want to create something like in the image, but with Code and not in Photoshop. I want to publish funny sentences about the life in the village. It should be searchable for google, but also shareable for the people. There is a overview page and a detailpage foreach sentence.

It is possible to share this page with his friends and social media (like in a normal blogpost). But when he / she clicks on a button called “Download or Share”, then the page will be transform to generated image and the user downloads this (not the page as code).

Do you have a solution for this?

Example Image:

Content Structure

/content/meindorfkindmoment/1-quote
    |-- dorfkindmoment.txt
    |-- image.jpg
/content/meindorfkindmoment/2-quote
    |-- dorfkindmoment.txt
    |-- image.jpg
/content/meindorfkindmoment/3-quote
    |-- dorfkindmoment.txt
    |-- image.jpg

dorfkindmoment.txt

Title: Das Stockbrot ist das Knoppers vom Dorf.

----

Category: Gemeinschaft

----

Tags: Lagerfeuer 

dorfkindmoment.php

<?= $page->title() ?>
<?= $page->image() ?>

Url:
/meindorfkindmoment/das-stockbrot-ist-das-knoppers-vom-dorf

Pretty sure this is possible, google “HTML to image” or “DOM to image” and I’m sure you’ll find some library to help you with this.