Giter Site home page Giter Site logo

moldify's Introduction

Moldify

A single python script to make your images look moldy!

Before Moldify After Moldify
venti.png venti_mold.jpg
./examples/venti.png ./examples/venti_mold.jpg

SETUP

Install Python and install the following dependencies via pip:

  • Pillow
  • numpy

There is a 'requrements.txt' file, so you can just run:

pip install -r requirements.txt

Once installed, open a terminal and run the script:

python /path/to/script/moldify.py

There is also a 'moldify-advanced.py' file which has more user prompts

HOW IT WORKS

It doesnt take a genius to figure out that this script was poorly written in just about a few hours. But I figured someone might want to make use of it so here you go!

To put it simply, this script has two main for loops inside each other.

The main loop iterates 5 times, takes an image input and applies the following modifications every iteration:

  • resizes it by the resolution specified by the user (every loop iteration the resolution is increased by 50 pixels)
  • converts the image to YCbCr and splits the channels
  • applies gaussian blur to the Cb and Cr channels with the value of 1.85 (In 'moldify-advanced.py' this it user specified)
  • merges the three channels back together and applies sharpness to the image
  • saves the image in a jpeg format with low quality and applies slight gaussian blur to the final render

The second loop repeats the above mentioned loop three more times (Iteration is user specified in 'moldify-advanced.py') and applies slight color saturation

ADDITIONAL INFO

When you run the script you will need to specify the file path to where the image is located, including the file extension - .jpg .png . You will also need to do this for the file output. I recommend just putting the images in the same folder where the script is located just to make life easier.

moldify's People

Contributors

lukacafuka avatar

Stargazers

Urufusan avatar  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.