0% found this document useful (0 votes)
15 views2 pages

Computer Vision Assignment

Uploaded by

ranahassan7674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Computer Vision Assignment

Uploaded by

ranahassan7674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment: Tonal Adjustment on Images Using PIL Library

Objective:

In this assignment, you will perform tonal adjustments on a series of images in a


folder using Python's Pillow (PIL) library. The goal is to enhance the images by
adjusting their brightness, contrast, color saturation, and sharpness. You will write a
Python script that processes all images in a specified folder and saves the adjusted
images with meaningful filenames.

Instructions:

1. Load Images from a Folder: Load all images from the specified folder using
the Pillow library.
2. Apply Tonal Adjustments: Write functions to perform various tonal
adjustments on each image. You must apply at least brightness, contrast,
color saturation, and sharpness adjustments.
3. Save Adjusted Images: Save each adjusted image in a new folder with
filenames that clearly indicate the applied adjustment.

Requirements:

1. Functions to Implement: Use the following functions to perform specific


tonal adjustments. These functions will use Pillow’s ImageEnhance module
to modify each image.

1. adjust_brightness(image, factor): Increases or decreases the brightness


of an image.
2. adjust_contrast(image, factor): Adjusts the contrast level of an image.
3. adjust_saturation(image, factor): Changes the color intensity
(saturation) of an image.
4. adjust_sharpness(image, factor): Enhances or reduces the sharpness of
an image.

2. Factor Range:

For each function, the factor parameter will control the level of
adjustment:

1. factor = 1.0 will keep the original value (no adjustment).


2. factor < 1.0 will reduce the effect (e.g., make the image darker,
less contrasty, or less sharp).
3. factor > 1.0 will increase the effect (e.g., make the image
brighter, more contrasty, or sharper).

Submission:

 Python Script: Submit your completed Python script, ensuring all functions
are implemented and images are processed as required.
 Example Outputs: Provide a few sample images before and after adjustments
to demonstrate your results.

Evaluation:

You will be graded based on:

 Correct implementation of tonal adjustment functions.


 Application of adjustments to all images in the folder.
 Proper saving and naming of adjusted images.

You might also like