Skip to content

Instantly share code, notes, and snippets.

@SubOptimal
Last active September 22, 2024 14:58

Revisions

  1. SubOptimal revised this gist Feb 1, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    On Twitter, [Will McGuan](https://twitter.com/willmcgugan) posted a perspective [screenshot](https://twitter.com/willmcgugan/status/1488209960605564938?s=20&t=x-WTN_8tvUItGeoLtZWMIA).
    On Twitter, [Will McGuan](https://twitter.com/willmcgugan) posted a perspective [screenshot](https://twitter.com/willmcgugan/status/1488204827540742146?s=20&t=iFSfVzJpLZwSbq5GnCGo6g).

    This gist provides few basic steps, using [ImageMagick](https://imagemagick.org), to produce some similar looking.

  2. SubOptimal revised this gist Feb 1, 2022. 1 changed file with 0 additions and 8 deletions.
    8 changes: 0 additions & 8 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -6,14 +6,6 @@ Following steps were processed.

    - starting with a screenshot of the Rich CLI help in a terminal

    On Twitter, [Will McGuan](https://twitter.com/willmcgugan) posted a perspective [screenshot](https://twitter.com/willmcgugan/status/1488209960605564938?s=20&t=x-WTN_8tvUItGeoLtZWMIA).

    This gist provides few basic steps, using [ImageMagick](https://imagemagick.org), to produce some similar looking.

    Following steps were processed.

    - starting with a screenshot of the Rich CLI help in a terminal

    ![image](https://user-images.githubusercontent.com/653288/152007641-7c8612b1-4915-49d3-9618-da6ed1fe8c09.png)

    - create a perspective view of the screenshot
  3. SubOptimal revised this gist Feb 1, 2022. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions create.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/bash

    set -o errexit

    screenshot=rich-help-screenshot.png
    perspective=01-perspective.png
    shadow=02-shadow.png
    gradient=03-gradient.png
    final=04-final.png

    # create perspective view
    convert ${screenshot} -matte -virtual-pixel transparent -distort Perspective '0,0 0,0 987,0 987,70 987,810 987,720 0,810 0,810' ${perspective}

    # add shadow to the perspective view
    convert ${perspective} \( +clone -background black -shadow 80x10+5+10 \) +swap -background none -layers merge +repage ${shadow}

    # create a color gradient for the background
    convert -size 1027x850 -define gradient:direction=57 'gradient:rgb(54,200,150)-rgb(20,90,160)' ${gradient}

    # combine both images
    convert -page +0+0 ${gradient} -page +0+0 ${shadow} +page -alpha Set -virtual-pixel transparent -background None -flatten ${final}
  4. SubOptimal created this gist Feb 1, 2022.
    39 changes: 39 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    On Twitter, [Will McGuan](https://twitter.com/willmcgugan) posted a perspective [screenshot](https://twitter.com/willmcgugan/status/1488209960605564938?s=20&t=x-WTN_8tvUItGeoLtZWMIA).

    This gist provides few basic steps, using [ImageMagick](https://imagemagick.org), to produce some similar looking.

    Following steps were processed.

    - starting with a screenshot of the Rich CLI help in a terminal

    On Twitter, [Will McGuan](https://twitter.com/willmcgugan) posted a perspective [screenshot](https://twitter.com/willmcgugan/status/1488209960605564938?s=20&t=x-WTN_8tvUItGeoLtZWMIA).

    This gist provides few basic steps, using [ImageMagick](https://imagemagick.org), to produce some similar looking.

    Following steps were processed.

    - starting with a screenshot of the Rich CLI help in a terminal

    ![image](https://user-images.githubusercontent.com/653288/152007641-7c8612b1-4915-49d3-9618-da6ed1fe8c09.png)

    - create a perspective view of the screenshot

    ![image](https://user-images.githubusercontent.com/653288/152007748-a77445ba-d4b1-42ad-9f02-3b913ed599fe.png)

    - add shadow to the perspective

    ![image](https://user-images.githubusercontent.com/653288/152007912-9fc928a0-4a2f-4a25-890a-a9cf7708fa09.png)

    - create a gradient for the background

    ![image](https://user-images.githubusercontent.com/653288/152007958-32abbac8-dd48-4762-a0a5-6d6904e2e1f6.png)

    - combine both images

    ![image](https://user-images.githubusercontent.com/653288/152007996-78a6fa00-e427-4e5c-8f46-253c29667526.png)


    The script `create.sh` process all the mentioned steps.


    **note**: The aim was to provide the basic steps and not a fully optimized version of the workflow. Some imagemagick steps could be combined, but were not for clarity.