Abstract: A method and system for modifying digital images is provided. The method includes one or more inputs. The inputs include a grayscale image for modifying and at least two or more predefined colors. Further, the method includes fetching a value of a first gray pixel from the plurality of gray pixels. Furthermore, the method includes analyzing a color range corresponding to the value. The color range includes a combination of at least two of the predefined colors. The method also includes fetching a value of a next gray pixel subsequent to the first gray pixel and analyzing a color range corresponding to the value of the next gray pixel. Moreover, the method includes displaying a processed image to a user. The system includes a receiving unit for receiving one or more inputs, a processor and a display unit.
METHOD AND SYSTEM FOR MODIFYING DIGITAL IMAGES
FIELD
[0001] The present disclosure relates generally to the field of image processing. More particularly, the present disclosure relates to a method and a system for modifying digital images.
BACKGROUND
[0002] Often, digital images are analyzed and manipulated in an electronic device. Various algorithms exist to achieve the manipulation. A frequent manipulation imposed on the digital images involves altering an image by imparting a set of predefined colors. However, upon imparting, the image suffers from abrupt color transitions along the edges of the image.
[0003] One of the existing techniques for manipulation of digital images is Pop Art. Pop Art uses silkscreen techniques to calculate image threshold regions. Further, predefined colors are applied to different regions. The regions include a plurality of pixels. The resultant image depicts abrupt color transitions along the edges due to sudden color changes at the edges and the entire regions (consists of the range of input gray pixel values) are represented by only a single color value. The sudden color changes are due to variations of pixel values at the edges. Moreover, the Pop Art technique is limited to a small number of predefined colors. Further, the Pop art is based on human intuition which makes the technique tedious.
2/18
[0004] In light of the foregoing discussion there is a need for a method and system for modifying digital images.
SUMMARY
[0005] Embodiments of the present disclosure described herein provide a method and system for modifying digital images.
[0006] An example of a method for modifying digital images includes receiving one or more inputs. The inputs include a grayscale image for modifying and at least two or more predefined colors. The grayscale image includes a plurality of gray pixels. Further, the method includes fetching a value of a first gray pixel from the plurality of gray pixels. Furthermore, the method also includes analyzing a color range corresponding to the value of the first gray pixel. The color range includes a combination of at least two of the predefined colors. The processing is performed for all the remaining pixels of the image based on the method. Then the method displays the final processed image to a user.
[0007] An example of a system for modifying images includes a receiving unit for receiving one or more inputs, the inputs include a grayscale image for modifying and at least two or more predefined colors. Further, the system includes a processor operable to perform fetching a value of a first gray pixel from the plurality of gray pixels, analyzing a color range corresponding to the first gray pixel. The processing is performed for all the remaining pixels of the image based on the method. Furthermore, the system includes a display unit for displaying a modified image to the user.
3/18
BRIEF DESCRIPTION OF FIGURES
[0008] The accompanying figures, similar reference numerals may refer to identical or functionally similar elements. These reference numerals are used in the detailed description to illustrate various embodiments and to explain various aspects and advantages of the present disclosure.
[0009] FIG. 1 is a block diagram of an environment, in accordance with which various embodiments can be implemented;
[0010] FIG. 2 is a block diagram of an electronic device, in accordance with one embodiment;
[0011] FIG. 3 illustrates a method for modifying digital images, in accordance with one embodiment;
[0012] FIG. 4 is a graphical representation for calculating values of pixels in an image, in accordance with one embodiment; and
[0013] FIG. 5 is an exemplary representation of an image upon modifying, in accordance with one embodiment.
[0014] Persons skilled in the art will appreciate that elements in the figures are illustrated for simplicity and clarity and may have not been drawn to scale. For example, the dimensions of some of the elements in the figures may be exaggerated relative to other elements to help to improve understanding of various embodiments of the present disclosure.
4/18
DETAILED DESCRIPTION
[0015] It should be observed that method steps and system components have been represented by conventional symbols in the figures, showing only specific details that are relevant for an understanding of the present disclosure. Further, details that may be readily apparent to person ordinarily skilled in the art may not have been disclosed. In the present disclosure, relational terms such as first and second, and the like, may be used to distinguish one entity from another entity, without necessarily implying any actual relationship or order between such entities.
[0016] Embodiments of the present disclosure described herein provide a method and system for modifying digital images.
[0017] FIG. 1 is a block diagram of an environment 100, in accordance with which various embodiments can be implemented. The environment 100 includes electronic devices, for example an electronic device 105a and an electronic device 105n connected through a network 110. Examples of the electronic devices include, but are not limited to mobiles, smartphones, handheld computers, and personal digital assistants (PDAs). Examples of the network 110 include, but are not limited to, local area network (LAN), wide area network (WAN), wired network, metropolitan area network (MAN) , internet, and wireless networks.
[0018] The electronic device 105a is capable of manipulating digital images. The electronic device 105a receives one or more inputs from a user using the electronic device 105a. In some embodiments, the electronic device 105a can receive the inputs from the electronic device 105n. The inputs include a digital image for manipulation and a set of
5/18
predefined colors. In one embodiment, the set of predefined colors is selected by the electronic device 105a. Further, the predefined colors are applied to the digital image. The electronic device 105a manipulates the digital image with the set of predefined colors. Values associated to pixels of the digital image are calculated. Further, each value falls in color ranges of any two predefined colors. The color ranges are analyzed and the corresponding intensities of the two predefined colors are calculated. Upon adding the intensities, output pixels are generated. The output pixels are combined to form the modified image. The modified image is then displayed to the user.
[0019] It will be appreciated that the input can also be a video stream for manipulation.
[0020] The electronic device 105a includes one or more elements for modifying digital images. The electronic device 105a including the elements is explained in detail in conjunction with FIG. 2.
[0021] FIG. 2 is a block diagram of the electronic device 105a, in accordance with one embodiment. The electronic device 105a includes a bus 205 for communicating information, and a processor 210 coupled with the bus 205 for processing information. The electronic device 105a also includes a memory 215, for example a random access memory (RAM) coupled to the bus 205 for storing information required by the processor 210. The memory 215 can be used for storing temporary information required by the processor 210. The electronic device 105a further includes a read only memory (ROM) 220 coupled to the bus 205 for storing static information required by the processor 210. A storage unit 225, for example a magnetic disk, hard disk or optical disk, can be provided and coupled to bus 205 for storing information.
6/18
[0022] The electronic device 105a can be coupled via the bus 205 to a display 230, for example a cathode ray tube (CRT) or liquid crystal display (LCD), for displaying images. An input device 235, including various keys, is coupled to the bus 205 for communicating information to the processor 210. In some embodiments, cursor control 240, for example a mouse, a trackball, a joystick, or cursor direction keys for communicating information to the processor 210 and for controlling cursor movement on the display 230 can also be present.
[0023] In one embodiment, the steps of the present disclosure are performed by the electronic device 105a using the processor 210. The information can be read into the memory 215 from a machine-readable medium, for example the server storage unit 225. In alternative embodiments, hard-wired circuitry can be used in place of or in combination with software instructions to implement various embodiments.
[0024] The term machine-readable medium can be defined as a medium providing data to a machine to enable the machine to perform a specific function. The machine-readable medium can be a storage media. Storage media can include non-volatile media and volatile media. The storage unit 225 can be a non-volatile media. The memory 215 can be a volatile media. All such media must be tangible to enable the instructions carried by the media to be detected by a physical mechanism that reads the instructions into the machine.
[0025] Examples of the machine readable medium includes, but are not limited to, a floppy disk, a flexible disk, hard disk, magnetic tape, a CD-ROM, optical disk, punchcards, papertape, a RAM, a PROM, EPROM, and a FLASH-EPROM.
[0026] The machine readable medium can also include online links, download links, and installation links providing the information to the processor 210.
7/18
[0027] The electronic device 105a also includes a communication interface 245 coupled to the bus 205 for enabling data communication. Examples of the communication interface 245 include, but are not limited to, an integrated services digital network (ISDN) card, a modem, a local area network (LAN) card, an infrared port, a Bluetooth port, a zigbee port, and a wireless port.
[0028] The input device 235 receives an image for modification and a set of predefined colors. The predefined colors are used for modifying the image. Further, the image and the predefined colors are sent to the processor 210. The processor 210 converts the image into a grayscale image. The grayscale image includes a plurality of pixels referred to as gray pixels. The value of each of the gray pixels is calculated by the processor 210. A color range corresponding to the value is analyzed and the corresponding intensities of the two predefined colors are calculated. Upon adding the intensities, an output pixel is generated. Further, output pixels of each of the gray pixels are combined to form the modified image. The modified image is then displayed to the user by the display 230.
[0029] In some embodiments, the processor 210 can include one or more processing units for performing one or more functions of the processor 210. The processing units are hardware circuitry performing specified functions.
[0030] FIG. 3 illustrates a method for modifying digital images, in accordance with one embodiment.
[0031] The method starts at step 305.
8/18
[0032] At step 310, one or more inputs are received. The inputs are received from a user using an electronic device. The inputs include a grayscale image for modifying and at least two or more predefined colors. The grayscale image includes plurality of pixels referred to as gray pixels.
[0033] A pixel is defined as the smallest item of information in an image. Further, the pixel is associated with an intensity value.
[0034] The grayscale image is composed of a plurality of gray pixels having shades of gray. The darkest possible shade is black and the lightest possible shade is white. Any intermediate shades of gray are represented by equal brightness levels of the three primary colors (red, green and blue). The brightness levels of the primary colors in a gray pixel are represented as a number from decimal 0 to 255. In some embodiments, the gray pixels can also be represented as a binary number from 00000000 to 11111111. If the binary numbers are used for representation, the image is called as an 8-bit grayscale. At any instant of time, the value of a gray pixel is a single value, and possesses only intensity information. The intensity of a gray pixel is expressed within a range. In some embodiments, the grayscale image is also referred to as a black-and-white image.
[0035] The predefined colors can be of any color and is used to apply to the grayscale image.
[0036] In one embodiment, the predefined colors can be selected by an electronic device.
9/18
[0037] At step 315, a value of a first gray pixel from the plurality of gray pixels is fetched. The value refers to the intensity of the first gray pixel and falls within the range of integer values 0 to 255.
[0038] At step 320, a color range corresponding to the value of the first gray pixel is analyzed. Further, the resulting pixel value is written to output buffer. The color range includes a combination of at least two of the predefined colors. The color range defines the upper and lower bounds of any of the predefined colors. The value of the gray pixel is between 0 to 255, and can only be included in the range of a combination of only two colors. The two colors are the predefined colors.
[0039] Further, the intensity values for the combination of the two colors are calculated based on the range in which the value of the gray pixel falls. The intensity value is an integer value between 0 to 255 and represents the share of the predefined color in the output pixel.
1) If the value falls in the range of the first predefined color, the intensity of the first
predefined color is calculated by the following formula:
Intensity = ((upperRange - grayValue) x 255)/ upperRange
2) If the value falls in the range of the second predefined color, the intensity of the
second predefined color is calculated by the following formula:
midRange = (upperRange + lowerRange)/2 if (grayValue < midRange) then
Intensity = ((grayValue - lowerRange) x 2 x 255)/(upperRange –
10/18
lowerRange) Else
Intensity = ((upperRange - grayValue) x 2 x 255)/(upperRange – lowerRange)
3) If the value falls in the range of the third predefined color, the intensity of the third predefined color is calculated by the following formula:
Intensity = ((grayValue – lowerRange) x 255)/ (255 – lowerRange)
Here, N is number of colors in the input set. The range of color varies between lower and upper bounds of the input color set. Any value between 0 – 255 can only be contained in the range of only 2 colors. Further, the lowerRange refers to the lower range of the current input color, the uppperRange refers to the upper range of the current input color and the midRange refers to the middle value of the given range.
[0040] Upon calculating the intensity of the predefined colors, the RGB (Red, Green and Blue) values are calculated by multiplying the intensity of the predefined colors to each R, G and B values.
[0041] The RGB values are then added with a RGB value of a second gray pixel. The resulting value is the intensity of the output pixel.
[0042] At step 330, a check is performed to determine if the gray pixel fetched is a last pixel of the plurality of gray pixels. If it is determined that the next gray pixel is the last pixel in the grayscale image, step 335 is performed.
11 / 1 8
[0043] If it is determined that the next gray pixel is not the last pixel in the grayscale image, step 330 is performed.
[0044] At step 330, a value of a next gray pixel is fetched. The next gray pixel refers to a pixel subsequent to the first gray pixel. The color range corresponding to the value of the next gray pixel is analyzed as described in step 320.
[0045] The color range includes a combination of at least two of the predefined colors. The color range defines the upper and lower bounds of any of the predefined colors. The value of the gray pixel is between 0 to 255, and can only be included in the range of a combination of only two colors.
[0046] Further, the intensity values for the combination of the two colors are calculated similar to the step 320.
[0047] This results in the intensity of a next output pixel.
[0048] At step 335, a modified image is displayed to a user.
[0049] The processed image includes gray pixels of intensity value including only two of the predefined colors. Further, the processed image is converted from grayscale image to a color image. The color image appears with the predefined colors and with smooth edges along the image.
[0050] The method ends at step 340.
[0051] FIG. 4 is a graphical representation for calculating values of pixels in an image, in accordance with one embodiment.
12/18
[0052] Consider three predefined colors defined as 1st color, 2nd color and 3rd color. The X-axis defines the pixel values and the Y – axis defines the color values. Both the X – axis and Y – axis represents values from 0 to 255.
[0053] For any particular pixel value, the intensity of combinations of the predefined colors can be calculated.
[0054] For example, at 0x40 in the X – Axis, both 1st and 2nd colors have equal contribution (0x80/0x100 each) to a pixel. Contribution of the 3rd Color is zero.
[0055] At 0x80 in the X – Axis, 2nd Color has the entire contribution. Contribution from the 1st and 3rd colors is zero.
[0056] At 0xE0, 3rd Color has more contribution (0xC0/0x100). (0xC0/0x100) represents 0xC0 out of 0x100. Similarity, 2nd Color has less contribution (0x40/0x100), representing 0x40 out of 0x100. However, the 1st color has no contribution.
[0057] FIG. 5 is an exemplary representation of an image upon modification, in accordance with one embodiment.
[0058] The image is imparted with predefined colors. The edges of the image are smooth as a result of blending of the predefined colors.
[0059] Various embodiments provide smooth edge transitions. Further, dynamic color ranges can also be used.
[0060] In the preceding specification, the present disclosure and its advantages have been described with reference to specific embodiments. However, it will be apparent to a
13/18
person of ordinary skill in the art that various modifications and changes can be made, without departing from the scope of the present disclosure, as set forth in the claims below. Accordingly, the specification and figures are to be regarded as illustrative examples of the present disclosure, rather than in restrictive sense. All such possible modifications are intended to be included within the scope of the present disclosure.
14/18
I/We claim:
1. A method for modifying an image, the method comprising:
receiving one or more inputs, wherein the inputs include a grayscale image for modifying and at least two or more predefined colors, the grayscale image includes a plurality of gray pixels;
fetching a value of a first gray pixel from the plurality of gray pixels;
analyzing a color range corresponding to the value of the first gray pixel, wherein the color range includes a combination of at least two of the predefined colors; and
displaying a modified image to the user.
2. The method of claim 1 further comprising:
fetching a value of a next gray pixel subsequent to the first gray pixel; and analyzing a color range corresponding to the value of the next gray pixel.
3. The method of claim 1, wherein the receiving includes values associated to each of the plurality of gray pixels.
4. The method of claim 1 further comprising:
checking if the next gray pixel is a last pixel of the plurality of gray pixels.
5. The method of claim 1, wherein the analyzing comprises:
calculating intensity values of the combination, and
15/18
adding the intensity values of the combination.
6. The method of claim 5, wherein the adding comprises:
replacing the gray pixels in the image with the computed values as per specified method.
7. The method of claim 1, wherein the displaying comprises: converting the grayscale image into a modified image.
8. A system for modifying an image, the system comprising:
a receiving unit for receiving one or more inputs, wherein the inputs include a grayscale image for modifying and at least two or more predefined colors, the grayscale image includes a plurality of gray pixel;
a processor operable to perform:
fetching a value of a first gray pixel from the plurality of gray pixels, analyzing a color range corresponding to the value of the first gray pixel;
wherein the color range includes a combination of at least two of the predefined
colors;
fetching a value of a next gray pixel subsequent to the first gray pixel; and analyzing a color range corresponding to the value of the gray pixel; and
a display unit for displaying a modified image to the user.
9. The system of claim 8, further comprising:
16/18
a communication interface in electronic communication with a network.
10. A system for performing a method, the method as described herein and in accompanying figures.
| # | Name | Date |
|---|---|---|
| 1 | 1723-CHE-2009 POWER OF ATTORNEY 28-05-2010.pdf | 2010-05-28 |
| 1 | 1723-CHE-2009-AbandonedLetter.pdf | 2018-06-07 |
| 2 | 1723-CHE-2009-Changing Name-Nationality-Address For Service [14-02-2018(online)].pdf | 2018-02-14 |
| 2 | 1723-CHE-2009 OTHER PATENT DOCUMENT 28-05-2010.pdf | 2010-05-28 |
| 3 | 1723-CHE-2009-RELEVANT DOCUMENTS [14-02-2018(online)].pdf | 2018-02-14 |
| 3 | 1723-che-2009 form-1 28-05-2010.pdf | 2010-05-28 |
| 4 | 1723-CHE-2009-FER.pdf | 2017-11-29 |
| 4 | 1723-CHE-2009 POWER OF ATTORNEY 27-06-2011.pdf | 2011-06-27 |
| 5 | Drawings.pdf | 2011-09-03 |
| 5 | 1723-CHE-2009 FORM-18 27-06-2011.pdf | 2011-06-27 |
| 6 | Form-1.pdf | 2011-09-03 |
| 6 | 1723-CHE-2009 CORRESPONDENCE OTHERS 27-06-2011...pdf | 2011-06-27 |
| 7 | Power of Authority.pdf | 2011-09-03 |
| 7 | Form-3.pdf | 2011-09-03 |
| 8 | Form-5.pdf | 2011-09-03 |
| 9 | Power of Authority.pdf | 2011-09-03 |
| 9 | Form-3.pdf | 2011-09-03 |
| 10 | 1723-CHE-2009 CORRESPONDENCE OTHERS 27-06-2011...pdf | 2011-06-27 |
| 10 | Form-1.pdf | 2011-09-03 |
| 11 | Drawings.pdf | 2011-09-03 |
| 11 | 1723-CHE-2009 FORM-18 27-06-2011.pdf | 2011-06-27 |
| 12 | 1723-CHE-2009-FER.pdf | 2017-11-29 |
| 12 | 1723-CHE-2009 POWER OF ATTORNEY 27-06-2011.pdf | 2011-06-27 |
| 13 | 1723-CHE-2009-RELEVANT DOCUMENTS [14-02-2018(online)].pdf | 2018-02-14 |
| 13 | 1723-che-2009 form-1 28-05-2010.pdf | 2010-05-28 |
| 14 | 1723-CHE-2009-Changing Name-Nationality-Address For Service [14-02-2018(online)].pdf | 2018-02-14 |
| 14 | 1723-CHE-2009 OTHER PATENT DOCUMENT 28-05-2010.pdf | 2010-05-28 |
| 15 | 1723-CHE-2009-AbandonedLetter.pdf | 2018-06-07 |
| 15 | 1723-CHE-2009 POWER OF ATTORNEY 28-05-2010.pdf | 2010-05-28 |
| 1 | searchstrategy_06-10-2017.pdf |