Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ddf9df

Browse files
authored
Update imagemanipulation.py
1 parent 52afd22 commit 3ddf9df

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

imagemanipulation/imagemanipulation.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
#!/usr/bin/env python
2-
# coding: utf-8
3-
4-
# # Assignment 1: Building a Better Contact Sheet
5-
# In the lectures for this week you were shown how to make a contact sheet for digital photographers, and how you can take one image and create nine different variants based on the brightness of that image. In this assignment you are going to change the colors of the image, creating variations based on a single photo. There are many complex ways to change a photograph using variations, such as changing a black and white image to either "cool" variants, which have light purple and blues in them, or "warm" variants, which have touches of yellow and may look sepia toned. In this assignment, you'll be just changing the image one color channel at a time
6-
#
7-
# Your assignment is to learn how to take the stub code provided in the lecture (cleaned up below), and generate the following output image:
8-
#
9-
# ![](./readonly/assignment1.png "")
10-
#
11-
# From the image you can see there are two parameters which are being varied for each sub-image. First, the rows are changed by color channel, where the top is the red channel, the middle is the green channel, and the bottom is the blue channel. Wait, why don't the colors look more red, green, and blue, in that order? Because the change you to be making is the ratio, or intensity, or that channel, in relationship to the other channels. We're going to use three different intensities, 0.1 (reduce the channel a lot), 0.5 (reduce the channel in half), and 0.9 (reduce the channel only a little bit).
12-
#
13-
# For instance, a pixel represented as (200, 100, 50) is a sort of burnt orange color. So the top row of changes would create three alternative pixels, varying the first channel (red). one at (20, 100, 50), one at (100, 100, 50), and one at (180, 100, 50). The next row would vary the second channel (blue), and would create pixels of color values (200, 10, 50), (200, 50, 50) and (200, 90, 50).
14-
#
15-
# Note: A font is included for your usage if you would like! It's located in the file `readonly/fanwood-webfont.ttf`
16-
#
17-
# Need some hints? Use them sparingly, see how much you can get done on your own first! The sample code given in the class has been cleaned up below, you might want to start from that.
18-
19-
# In[31]:
20-
21-
221
import PIL
232
from PIL import Image, ImageDraw, ImageFont
243

0 commit comments

Comments
 (0)