lab_intro
Ineluctable Introduction
|
Implementations of image manipulation functions. More...
Functions | |
PNG | grayscale (PNG image) |
Returns an image that has been transformed to grayscale. More... | |
PNG | createSpotlight (PNG image, int centerX, int centerY) |
Returns an image with a spotlight centered at (centerX , centerY ). More... | |
PNG | illinify (PNG image) |
Returns a image transformed to Illini colors. More... | |
PNG | watermark (PNG firstImage, PNG secondImage) |
Returns an immge that has been watermarked by another image. More... | |
Implementations of image manipulation functions.
Returns an image with a spotlight centered at (centerX
, centerY
).
A spotlight adjusts the luminance of a pixel based on the distance the pixel is away from the center by decreasing the luminance by 0.5% per 1 pixel euclidean distance away from the center.
For example, a pixel 3 pixels above and 4 pixels to the right of the center is a total of sqrt((3 * 3) + (4 * 4)) = sqrt(25) = 5
pixels away and its luminance is decreased by 2.5% (0.975x its original value). At a distance over 160 pixels away, the luminance will always decreased by 80%.
The modified PNG is then returned.
image | A PNG object which holds the image data to be modified. |
centerX | The center x coordinate of the crosshair which is to be drawn. |
centerY | The center y coordinate of the crosshair which is to be drawn. |
Returns an image that has been transformed to grayscale.
The saturation of every pixel is set to 0, removing any color.
This function is already written for you so you can see how to interact with our PNG class.
Returns a image transformed to Illini colors.
The hue of every pixel is set to the a hue value of either orange or blue, based on if the pixel's hue value is closer to orange than blue.
image | A PNG object which holds the image data to be modified. |
Returns an immge that has been watermarked by another image.
The luminance of every pixel of the second image is checked, if that pixel's luminance is 1 (100%), then the pixel at the same location on the first image has its luminance increased by 0.2.
firstImage | The first of the two PNGs to be averaged together. |
secondImage | The second of the two PNGs to be averaged together. |