playing-with-colors

Design work in the Java programming language, where we learned how to analyze an image and edit it according to the requirement. we used StdIn, StdOut, StdDraw

The function ​Color[][] read(String filename)​ receives the name of a PPM file and returns an array containing the image data.

The function ​Color[][] flippedHorizontally(Color[][] image)​ returns a new image which is a horizontal flip of the given image: In each row of the new image, the order of the pixels is reversed (within each pixel though, nothing changes).

The function ​Color[][] flippedVertically(Color[][] image)​ returns a new image which is a vertical flip of the given image: In each column of the new image, the order of the pixels is reversed.

function ​Color[][] greyScale(Color[][] image)​. This function returns the greyscaled version of the given image.

Screen Shot 2022-08-02 at 18 31 41

function ​Color[][] scale(Color[][] image, int width, int height).​ The function returns a new image which is a version of the original image, scaled to be of the given width and height

Screen Shot 2022-08-02 at 18 32 43

The function ​Color[][] blend (Color[][] image1, Color[][] image2, double alpha)​ returns the alpha-blending of the two given images. The function computes each new pixel using the ​blend​ function

Screen Shot 2022-08-02 at 18 33 36