Giter Club home page Giter Club logo

photoframer's Introduction

This little personal project helps frame photos into frames of mockup rooms (mockup rooms not provided except small sample). You can use any mockup you want, portrait, square or landscape, and frame any photo you want to the right frames. The program will help you calibrate your mockups (to map where the frame is in the mockup room) and then assemble photos to them - it will automatically frame all landscape photos into landscape frame mockups, portraits into portrait frame mockups and square into square frame mockups.

It's all automatic and simple! It's all automatic and simple if it's set right (easy).

Prerequisites

1. Set the mockup frame information

Take a mockup file with a frame in it. You need to know where the actual photo frame is in the mockup file. To do so, use the program kshhhtest.py.

It runs as such in a terminal:

./test.sh
	[-h] [-n] path/to/mockup framewidth [frameheight] framestartx framestarty
  • -h/--help: Print this message

  • -n/--no: Automatically say no to renaming the mockup file to the recommended name

  • framewidth: width of frame the image will fit in

  • frameheight: (optional if for square) height of frame the image will fit in

  • framestartx: x coordinates where the frame starts int the mockup image from the top left corner

  • framestarty: y coordinates where the frame starts int the mockup image from the top left corner

Where you started the command, check the file isItFramedOk.jpg. If the photo fits perfectly into the mockup frame, then rename your mockup file with the suggestion in the terminal. If not perfect, reiterate with different parameters. Bear in mind, DO NOT allow for white spaces inside the frame - in other words, make your photo stick to the frame as accurately as possible, you will have the possibility to enter a mode later that puts white spaces as passepartouts*.

2. Frame all your photos

Now that you have your mockups renamed okay, put all your mockups in the same directory. Put all your photos you want to incorporate into these mockups in another directory.

In a terminal, run:

./frame.sh
	[-h] [-d] [-r] [-y] [-p] [--passepartout[=%off_frame_size]]
	path/to/mockupdir path/to/photodir path/to/resultdir
  • -h/--help: Print this message
  • -d/--debug: Enable debug messages
  • -r/--resize: Allow resizing of original photo to fit the frame
  • -y/--yes: Will not ask any question
  • -p: Set passepartout* on frames to 95% of frame longest edge
  • --passepartout=off_frame_size: Set passepartout* on frames to off_frame_size% of frame longest edge

Bear in mind, passepartout* cannot be constant all around the photo if you don't enable the --resize option along with it.

Mandatory arguments are:

  • mockupdir: path to the directory containing the mockups - mockup files mush have the information on where the frame is in the following format: filename-<orientation>-s<framewidth>x<frameheight>c<coordinatesframestartx>x<coordinatesframestarty>.ext - orientation can be portrait, landscape or square
Example: blue-wall-basic-11-square-s1279x1279c862x273.jpg livingroom-square-s1279x1279c862x273.jpg
  • photodir: path to the directory containing the photos to frame
  • resultdir: existing path to the directory where the result images will be saved

All paths must exist, even the path/to/resultdir. All your framed photos will be available in path/to/resultdir.

/!\ Don't work with originals, work with copies! Original photos are never modified, BUT I'd advise to have a copy of them.

Enjoy! You like this? Be a sponsor at [https://github.com/Photography-Utils/photoframer].

Notes:

photoframer's People

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.