Class 37 April 18
Image manipulation
I need a haiku — I cannot find one I like — Can you help me please
Always look both ways
Form please
- Help improve CS 1112
Module gamma.py
- Defines three functions in support of gamma correction, where a gamma correction supports the lightening and darkening of an image.
Consider
- Gamma resource
Function correction( i, gf )
- Returns the gamma correction for gamma factor
gf
for value intensityi
; that is, it returns the integeri_prime
equal to
int( 255 ( i / 255 )
1/gf
)
Function pixel( p, gf )
- Returns a new pixel whose RGB values are gamma corrections for gamma factor
gf
of the RGB values of pixelp
. That is, if pixelp
RGB values are(r, g, b)
, then new pixel has RGB values(correction(r, gf), correction(g, gf), correction(b,
gf))
Function create( original, gf )
- Returns a new image whose dimensions match that of
original
, where a pixel in the new image is a gamma factorgf
correction of the corresponding pixel inoriginal
.
To do
- Review artifacts
- Homework 26 — a bottom-up assignment
Imaging effects — gamma
Original | Gamma = 2.0 | Gamma = 0.25 |
Homework motivation
Warning: fopen(/l/cs1112/public_html/defs/htm/181-trailer): Failed to open stream: No such file or directory in /l/cs1112/public_html/defs/php/read.php on line 5
Unable to open file!