Skip to content

Instantly share code, notes, and snippets.

@mohamad-supangat
Forked from stefanoschrs/add-frame.sh
Created March 21, 2023 04:59
Show Gist options
  • Save mohamad-supangat/70b7d62b82f8ce5d3e43a6b772fc53b2 to your computer and use it in GitHub Desktop.
Save mohamad-supangat/70b7d62b82f8ce5d3e43a6b772fc53b2 to your computer and use it in GitHub Desktop.
deviceframe iPhone X hack
outputDir=/tmp/screenshots/framed
mkdir -p ${outputDir}
##########
# iPhone #
##########
padPath=/tmp/iphone-pad.png
convert -size 1125x185 xc:#e65562 ${padPath}
for filePath in $(find /tmp/screenshots/ | grep iPhone | grep -v framed) ; do
outputPath=/tmp/iphone-screenshot.png
convert ${padPath} ${filePath} -append ${outputPath}
npx dframe ${outputPath} --frame "Apple iPhone X" --output ${outputDir}
mv ${outputDir}/iphone-screenshot* ${filePath/screenshots/screenshots\/framed}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment