Giter VIP home page Giter VIP logo

frameapp's Introduction

FrameApp

This Python application is designed to add a frame and blur the background of an image. It uses OpenCV and Matplotlib libraries to process images.

Example

How to Use

Clone this repository to your local machine. Install the required Python libraries. You can do this by running pip install -r requirements.txt in your terminal. Run the src.py script. You can do this by running python src.py in your terminal.

Functionality

The main function in this application is add_frame_and_blur_background_opencv(). This function takes four arguments:

image_path: The path to the original image.

  • output_path: The path where the output image will be saved.
  • logo_path: The path to the logo image that will be added to the original image.
  • screen: The dimensions of the screen.

The function works as follows:

  1. It loads the original image and calculates its aspect ratio.
  2. It resizes the image to fit within a 16:9 frame, maintaining the original aspect ratio.
  3. It creates a new image with a white background and a 16:9 aspect ratio.
  4. It pastes the resized image onto the center of the background.
  5. It loads and resizes the logo, then pastes it onto the image.
  6. It creates a blurred background image from the original image.
  7. It pastes the original image onto the blurred background.
  8. It saves the result to the specified output path.

Example To use this application with your own images, you can modify the original_image_path, output_image_path, and logo_path variables at the bottom of the src.py script.

For example:

original_image_path = r'path_to_your_image.jpg'
output_image_path = r'path_to_save_your_output.jpg'
logo_path = r'path_to_your_logo.png'
add_frame_and_blur_background_opencv(original_image_path, output_image_path, logo_path)

This will process your image and save the result to the specified output path.

frameapp's People

Contributors

williamlambertcn avatar

Watchers

 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.