Code Monkey home page Code Monkey logo

add-device-frames's Introduction

View code

Add device frames to mobile screenshots

Prerequisites

  1. You need imagemagick
brew install imagemagick
  1. Download device images for example from Apple:
curl https://devimages-cdn.apple.com/design/resources/download/Bezel-iPhone-14.dmg
  1. Unpack the .dmg, find the file you want to use and set the name/path in the script

Usage

Grab screenshots

Grab a screenshot with iOS Simulator and drag/copy the image to the same folder as the script. The script will work for as many screenshots as you have in this folder.

Grab a screenshot with iOS Simulator

Run the script

Create a transparent PNG

bash add-device-frames.sh png 0 0

Create a JPG with 1600/100 px x/y offset and a lightgrey background

bash add-device-frames.sh jpg 1600 100 lightgrey

Options

Arguments avaliable:

  • $1: file type - jpg or png
  • $2: offset width - ex 60
  • $3: offset height - ex 60
  • $4: background color - ex white

Demo

View the example.html file to se an example

open example.html

Example images

JPG with an offset and a lightgrey background color.

Transparent PNG

Notes

  • The script will batch all screenshots in the current folder, adjust the filename glob in L33 to your needs and options L20-23.
  • This example has been tested with an iPhone device frame at the moment, more adjustments could be needed/added for it to work on more devices.

add-device-frames's People

Contributors

urre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.