Giter Site home page Giter Site logo

picfixpy's Introduction

picfixPy

A DSCI-524 collaborative software development project

Build Status codecov

Project Overview

Image enhancement is typically done with a full-scale editing software such as Adobe Photoshop or GIMP, but what if we just want to quickly touch up an image during prototyping in a programming environment?

picfixPy allows users to quickly enhance images in an integrated development environment (IDE) (e.g. Jupyter notebook, PyCharm) without powering up an image editing software. Users can quickly adjust the sharpness, contrast, and vibrance of .png images, by simply calling the corresponding functions. This package currently offers three essential image enhancement functions, and we hope to implement additional features in the near future.

To install

pip install git+https://github.com/UBC-MDS/picfixPy.git

To upgrade

pip install --upgrade git+https://github.com/UBC-MDS/picfixPy.git

To use

sharpen(): enhance the sharpness of your image

from picfixPy.sharpen import sharpen
sharpen('input.png', 4, False, 'sharpen_output.png')

Arguments:

  • input_img: path to an input image
  • intensity: level of sharpness enhancement, between 0 and 10, defaults to 5.
  • display: print image to console if True, defaults to False.
  • output_img: path to save the output image

contrast(): enhance the contrast of your image

from picfixPy.contrast import contrast
contrast('input.png', 4, False, 'contrast_output.png')

Arguments:

  • input_img: path to an input image
  • intensity: level of contrast enhancement, between 0 and 10, defaults to 5.
  • display: print image to console if True, defaults to False.
  • output_img: path to save the output image

vibrance(): enhance the colour vibrance of your image

from picfixPy.vibrance import vibrance
vibrance('input.png', 4, False, 'vibrance_output.png')

Arguments:

  • input_img: path to an input image
  • intensity: level of vibrance enhancement, between -10 and 10, defaults to 5.
  • display: print image to console if True, defaults to False.
  • output_img: path to save the output image

Supported image types

  • .jpg
  • .png
  • .tiff

Dependencies

  • numpy
  • matplotlib
  • scikit-image

Tests and test coverage

test_coverage

Fitting into the Python ecosystem

OpenCV provides Python with an immersive package for complex image processing. However, even for basic image enhancements, users typically still have to dig into a substantial amount of documentation and implementation details. This project offers a simple alternative, allowing users to have the ability to enhance images quickly during prototyping without the overhead of heavy library resources.

Team Members

Name Github handle
Miliban Keyim mkeyim
George J. J. Wu GeorgeJJW
Mani Kohli ksm45

picfixpy's People

Contributors

georgejjw avatar mani-kohli avatar mkeyim avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

picfixpy's Issues

Add exception handling

  • Add exception handling to functions if applicable.
  • Perform integration tests if applicable.

Optional:

  • Added code coverage badge to README.md.

Catching your local branch up to speed

We are starting to implement and merging more and more features into the remote master on github.

Here is a quick reference on how to update your local branch (such as the sharpen branch on your computer) such that your local work is not falling too far behind.

[at the root of your local clone of this repo]

  1. Not a bad idea to always check the local branch that you are currently in.
    git branch

  2. If you are in your local feature branch, such as contrast or sharpen, great! Now you can switch to your local master, and catch your local master up to speed with the remote master.
    git checkout master
    git pull

  3. You can now switch back to your local feature branch (sharpen or vibrance, etc), and incorporate changes from the local master to your local feature branch.
    git checkout sharpen or git checkout vibrance
    git merge master

  4. Resolve any merge conflicts locally, and your local branch should now be all up-to-date with the remote master!

  5. Continue working on your function and test in your local branch (use git branch when in doubt!), and make commits as usual. When you are ready, push your work from your local feature branch to your remote feature branch by simply using:
    git push
    (We are allowed to do this now because the first time you pushed to your remote feature branch you should be using git push -u origin vibrance or git push -u origin sharpen, so now you can simply use git push to do the same.)

  6. Make a pull request to merge your remote feature branch to the remote master on github.

A summary of the above commands:

git checkout master
git pull
git checkout sharpen (or vibrance)
git merge master
[continue working on your function and tests]
git push
[issue a pull request on github when ready]

There are faster and more hacky ways of doing this, but I think it will be nice for us to practice what git is actually doing ๐Ÿ˜€ .

Milestone2 integration

  • Update README.md with instructions to install the package (move from bottom of the page to the top); add example images for each function; adjust description of each function accordingly.

  • Proofread and adjust documentation of all three functions and test suites as necessary. Adding back image types we know that this package can correctly handle, (addressing #19) .

  • Explore any outstanding package dependency issues when users install this package (numpy, skimage, etc).

  • Install package and take it out for a spin!

Measure code coverage of tests

  • Measure and document code coverage of our tests.
  • Add test cases as necessary.
  • Add test results and coverage screenshots to README.md.
  • Issue PR and awaits feedback.

Limiting image inputs and outputs

We should not limit our functions in python to just .png in the documentation, when our function works for many other formats (jpg, jpeg, pdf, png, both input and output wise - it can save pdfs! Ive tried!), this is doing our package a disservice in Python.
We can limit in R because of R's limitations, but I really do not think we should limit in python as python is a language that's USED for its flexibility and ease. Thoughts?

Implement vibrance function

  • Clone this master repo to your local machine, and navigate to this repo.

  • Create a branch using the terminal command git checkout -b vibrance.

  • Implement vibrance function in python, write some code, and when you are happy, commit the changes as usual!

  • Refine test cases for this function as necessary.

  • Refine documentations for this function as necessary.

  • Once you are happy with your work, feel free to push your local work to github by using git push -u origin vibrance. Note that this will update the vibrance branch of the master repo.

  • Issue a pull request on github to merge the vibrance branch into master.

  • Awaits feedback and code reviews from other teammates, then you are done!

Milestone 02 feedback

Hello,

  • The package setup and tests run without any problems
  • I see that you are on track and did most of the required tasks in Milestone 02.
  • You have efficiently used github workflow efficiently including issue tracker, commits..., but I see you didn't create branches and pull requests.
  • Your function documentation is complete for both README and functions.

Thanks!

Implement sharpen function

  • Clone this master repo to your local machine, and navigate to this repo.

  • Create a branch using the terminal command git checkout -b sharpen.

  • Implement sharpen function in python, write some code, and when you are happy, commit the changes as usual!

  • Refine test cases for this function as necessary.

  • Refine documentations for this function as necessary.

  • Once you are happy with your work, feel free to push your local work to github by using git push -u origin sharpen. Note that this will update the sharpen branch of the master repo.

  • Issue a pull request on github to merge the sharpen branch into master.

  • Awaits feedback and code reviews from other teammates, then you are done!

Implement contrast function

  • Clone this master repo to your local machine, and navigate to this repo.

  • Create a branch using the terminal command git checkout -b contrast.

  • Implement contrast function in python, write some code, and when you are happy, commit the changes as usual!

  • Refine test cases for this function as necessary.

  • Refine documentations for this function as necessary.

  • Once you are happy with your work, feel free to push your local work to github by using git push -u origin contrast. Note that this will update the contrast branch of the master repo.

  • Issue a pull request on github to merge the contrast branch into master.

  • Awaits feedback and code reviews from other teammates, then you are done!

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.