Rose Color Glasses
-
Description
-
Code
<
>
This algorithm increments the color red for each pixel in the picture. The pink is achieved by adding a blend of 40% of the current red into the pixel, and weighting different values for blue and green for human perception. The blend gives an eerie, nostalgic and dated look to the image as if it was color faded.
Shrink
-
Description
-
Code
<
>
This algorithm reduces the size of an image by half. This is accomplished by creating a blank image that is half the size of the original, and then taking only every other pixel from the original image. Because of the process, information is lost, which can be seen in the degradation of the shrunk image.
Collage
-
Description
-
Code
<
>
This algorithm takes a number of pictures, and produces a collage of all the images. The effects showcased here are:
Green Screen
-
Description
-
Code
<
>
The Green Screen algorithm takes two images one of which has a green screen. The second image is then superimposed over each green pixel replacing them thus merging both images together where the "green screen" is. For this example, a tolerance of 170 was used to eliminate almost all green traces from the green screen.
Homemade Thanksgiving Card
-
Description
-
Code
<
>
The Homemade Thanksgiving Card combines a variety of techniques. There are 3 images involved:
The first step is to run the `autummFilter` on the card which increases the contrast and temperature to make the image feel more like fall. After that, we take the frame pattern, and repeated along all the borders of the image using a 90 degree rotation for the left border, 180 for the bottom border and 270 for the right border. We're also using `pyCopyChroma` to key on the green of the border to produce a clean overlap on the main image. Finally, the banner is centered on the image using `pyCopyChroma` and the text on the banner is written taking into account the offset of the main area so the text is centered and legible.
- Main image: which is the center of the card.
- Pattern frame: An image which is repeated on each border a number of times.
- Banner: The image on which the text "Happy Thanksgiving!" is written on.
The first step is to run the `autummFilter` on the card which increases the contrast and temperature to make the image feel more like fall. After that, we take the frame pattern, and repeated along all the borders of the image using a 90 degree rotation for the left border, 180 for the bottom border and 270 for the right border. We're also using `pyCopyChroma` to key on the green of the border to produce a clean overlap on the main image. Finally, the banner is centered on the image using `pyCopyChroma` and the text on the banner is written taking into account the offset of the main area so the text is centered and legible.
Outline Image
-
Description
-
Code
<
>
This technique looks to create an outline of the image we're processing. The idea is that we get the "edges" of each element in the image where the contrast between pixels changes. Thus creating the outline.
The first step is to turn each pixel into its grey scale equivalent using the luminance formula. Then, we compare that pixel to the pixels to the right and below based on some tolerance. If the difference is greater than the tolerance, we turn the current pixel black, otherwise, we turn it white.
This technique is most successful when used in images that have a high contrast between black and white, thus providing a good clean edge. Images with low contrast or with lots of detail can be difficult to process as either there is not enough difference between the edge of each element, or the elements themselves have noise inside them making for images that look dirty.
The main function takes a picture and a tolerance to allow for fast iteration and to provide flexibility on what is ideal for each individual image. There is additionally a `getLuminance` helper function to abstract that processing since it is performed 3 times per loop cycle.
My main concerned was optimizing for time since we're getting a single pixel up to three times which over large images can be costly. However, after timing the functions, and attempting memoization techniques to reduce calculations, the timing was not significant enough to warrant the memory overhead of storing each pixel calculation or the logic to support it.
This image was processed with a tolerance of 10 which provides a good ratio on the contrast to maintain hard lines for the buildings, and minimize the noise on the water and concrete. The choice on this tolerance centered around maintaining the building outline integrity by having hard continuous lines, with white inside.
The first step is to turn each pixel into its grey scale equivalent using the luminance formula. Then, we compare that pixel to the pixels to the right and below based on some tolerance. If the difference is greater than the tolerance, we turn the current pixel black, otherwise, we turn it white.
This technique is most successful when used in images that have a high contrast between black and white, thus providing a good clean edge. Images with low contrast or with lots of detail can be difficult to process as either there is not enough difference between the edge of each element, or the elements themselves have noise inside them making for images that look dirty.
The main function takes a picture and a tolerance to allow for fast iteration and to provide flexibility on what is ideal for each individual image. There is additionally a `getLuminance` helper function to abstract that processing since it is performed 3 times per loop cycle.
My main concerned was optimizing for time since we're getting a single pixel up to three times which over large images can be costly. However, after timing the functions, and attempting memoization techniques to reduce calculations, the timing was not significant enough to warrant the memory overhead of storing each pixel calculation or the logic to support it.
This image was processed with a tolerance of 10 which provides a good ratio on the contrast to maintain hard lines for the buildings, and minimize the noise on the water and concrete. The choice on this tolerance centered around maintaining the building outline integrity by having hard continuous lines, with white inside.