Skip to content

Allows the user of the program to enter an image and apply various filters to it and save it on the associated machine it was ran on.

Notifications You must be signed in to change notification settings

tonyf8321/filter_image_processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filter_image_processor

The main purpose of this program is to allow individuals to improve the quality of images. It also allows for experimenting with filters to cater to each individuals needs.

Made with Python version 3.9.1

Setup

Get the associated repository file and folder to a virtual envrionment folder and activate the environment accordingly.

Install dependencies.

As a reminder:

$ pip install -r requirements.txt

Usage:

Step 1:

Choose what FILT_OPT(this will dictate the filter applied to the image) is,

FILT_OPT = 'FIND_EDGES'

for example, the options that can be chosen are:

SHARPEN, EMBOSS, FIND_EDGES, EDGE_ENHANCE, EDGE_ENHANCE_MORE, DETAIL,CONTOUR,FIND_EDGES, BLUR, SMOOTH, SMOOTH_MORE

If any options were missed, checkout https://pillow.readthedocs.io/en/stable/reference/ImageFilter.html?highlight=imagefilter for a list of filters.

Step 2:

The filter that you have selected in FILT_OPT, copy and paste that filter name to filtered_img = img.filter(ImageFilter.),

def save_normal_option():
    ...
    filtered_img_inp = img.filter(ImageFilter.<filter_opt_typed_here>)
    ...

for example, following the previous FILT_OPT in step 1, we would set it to FIND_EDGES, giving:

filtered_img_inp = img.filter(ImageFilter.FIND_EDGES)

Step 3:

Images may be put into the imgsGathered directory.

If they are not in the directory that IMG_PATH = 'imgsGathered' specifies, the program will have issues if the following below is not carried out.

Images do not have to be put into imgsGathered directory. If this is the case, ensure the folder with images is in the same directory as imgProcess.py.

Next, change the value for IMG_PATH to the newly added directory that has the images:

IMG_PATH = '<directory_with_your_images>'

Step 4:

Enter the name of an image into the IMG_NAME value area:

IMG_NAME = '<image_name_only_here>'

For example, if we have an image, pineapple.jpg, what is enter would be:

IMG_NAME = 'pineapple'

Step 5:

Enter True or False for the CHECK_GREY value in code (default is False):

This option will convert the image to black and white, and nothing else further.

CHECK_GREY = <True_or_False>

Important: when this is set to True, the filter option will be negated.

With this in mind, setting to True than moving the image back to the IMG_PATH selected directory, it can be further filter while being grey if desired.

Step 6

Set the IMG_EXT value to match the extension on the selected image:

IMG_EXT = '.<file_extension_goes_here>'

So, if we have pie.jpg we get .jpg and set the code to look like:

IMG_EXT = '.jpg'

Step 7:

Set the FILT_IMG_FOLD directory name (default is filteredImages).

If the folder does not exists, one will be created and store the processed image.

This will save the processed images to this folder. Name as desired.

FILT_IMG_FOLD = '<processed_images_folder_name_here>'

Note: Images processed will be converted to .png format, and the name of the photo to be changed to <,,.png>.

Why

This project was made in order to improve image quality, ranging from family photos, to photos from games, to whatever else a person can think of, the uses for this are endless!

There are uses for this like having an extremely poor quality photo where a person may be trying to identify what a figure is in a photo. Through using certains filters on that photo, the person can quickly identify what the figure is. I have personally used it like this which help the identification of some nocturnal animal skulking around my front yard.

About

Allows the user of the program to enter an image and apply various filters to it and save it on the associated machine it was ran on.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages