0% found this document useful (0 votes)
44 views3 pages

Image Editing and Transformation System

The document describes an image editing system that allows manipulating images through various operations like size alteration, color change, blurring, contrast change, brightening, and cropping. It defines an Image interface with methods for these operations and an ImageEditor class that implements this interface. The ImageEditor class maintains image data in a 2D integer array and applies the editing operations to this array based on parameters like color values, radius, percentages etc. It then allows retrieving the current edited image through the getCurrentImage method.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views3 pages

Image Editing and Transformation System

The document describes an image editing system that allows manipulating images through various operations like size alteration, color change, blurring, contrast change, brightening, and cropping. It defines an Image interface with methods for these operations and an ImageEditor class that implements this interface. The ImageEditor class maintains image data in a 2D integer array and applies the editing operations to this array based on parameters like color values, radius, percentages etc. It then allows retrieving the current edited image through the getCurrentImage method.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Image Editing and Transformation System

Image editing encompasses the processes of altering images by manipulating, enhancing, and
transforming images. In this project, given the image in RGB format as a pixel map structure or
a as a standard file format (like *.bmp), you have to perform following operations:
(a) image size alteration
(b) selective color change 
(c) blurring of images 
(d) contrast change
(e) brightening 
(f) slicing and cropping of image. 

This problem uses a Class: ImageEditor which implements the Interface Image. The


interface Image contains several methods which do different kinds of alterations over the
images are explained below 

The prototype of the function(s) is

1. alterSize(int size) : used for altering the image size. The function gets the int variable
size as input which contains the percentage of the size to be altered in the image.

2. changeColor(int selectedColor, int newColor) : used to change the color present in


the image. The selectedColor and newColor are given as the
input, the selectedColor is the variable which identifies the color in the image needs to
be modified with the new color. 

3. blurImage(int radius) : used to blur the image for the specified radius in the image. For
example if the radius 1, then imgData[3][3] in the output image would be average of
following 9 points in the source image ( imgData[2][2], imgData [2][3], data [2][4] , data
[3][2], data [3][3], data [3][4], data[4][2], data [4][3], data [4][4] ). Similarly, for radius 2,
you would taking average of up to 25 points for each pixel 

4. alterContrast(int contrast_min, int contrast_max) : used to modify the contrast of the


image. The function accepts contrast_min and contrast_max as input. 

5. alterBrightness(int brightIntensity) : used to brighten the image. The function accepts


an integer to denote % intensity to increase.

6. cropImage(int crop) : used to crop the image. The function accepts int crop which
contains the percentage of image cropping needs to be done. 

7. getCurrentImage() : used to return the current image. 

Constraints

 All the data of the each pixel present in the image is maintained using the two dimension
integer array int [ ] [ ] imgData
 Input image is in RGB Format (integer value up to 0xFFFFFF). If any pixel is more than
this, do nothing on the image.
 0 <= size <= 100, else do nothing on the image.
 The radius used in the blurImage function has to be less than both rows and columns in
the source image, otherwise do nothing on the image.
 0 <= brightIntensity <= 100, else do nothing on the image.
 Whenever the getCurrentImage() function is called, it has to return the current image
value using the two dimensional integer array.

Example 1
Input

int[][] imageInfo = {{0xFF0000, 0x00FF00, 0x0000FF},


            {0xFF00FF, 0xFFFF00, 0x00FFFF}, 
            {0xFFFFFF, 0xFFFFFF, 0x000000} }; 

ImageEditor image = new ImageEditor(imageInfo);


image.changeColor(0xFF0000, 0xFFFFFF); 

Output

To get the current image, the method getCurrentImage() is called which will return an two dimensional int
array that contains{{0xFFFFFF, 0x00FF00, 0x0000FF}, {0xFF00FF, 0xFFFF00, 0x00FFFF}, {0xFFFFFF,
0xFFFFFF, 0x000000} } . 

Explanation:

 In the output, the first element of the current image value has be changed from 0xFF0000 to
0xFFFFFF

Example 2
Input

int[][] imageInfo = { { 0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038 }, 


             { 0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038 },
             { 0x5a0060, 0x6a0050, 0x6a0050, 0x6a0050, 0x7f0038 } }

ImageEditor image = new ImageEditor(imageInfo);


image.blurImage(radius); 

Output

To get the current image, the method getCurrentImage() is called which will return an two dimensional int
array that contains 
imgData = { { 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 }, 
             { 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 }, 
             { 0x620058, 0x640055, 0x6a0050, 0x710048, 0x740044 } }; 

For Java solutions


   
Package Name  : imageeditor
File Name : Image.java
Interface Name : Image
Function Name   : void alterSize(int size);
Function Name   : void changeColor(int selectedColor, int newColor);
Function Name   : void alterContrast(int contrast_min, int contrast_max);
Function Name   : void blurImage(int radius);
Function Name   : void alterBrightness(int brightIntensity);
Function Name   : void cropImage(int crop);
Function Name   : int[][] getCurrentImage();
Package Name  : imageeditor
File Name : ImageEditor.java
Class Name : Image
Above ImageEditor class implements the interface Image
General Instructions

The package names, class names, method signatures to be used are mentioned in the problem
     statement. Do not use your own names or change the method signatures and fields. You can add any
number of additional methods.

You might also like