Image processing method, device, electronic device and storage medium

By performing color level and color adjustment processing on the image, the problem of time-consuming and poor effect adjustment of the game screen in the prior art is solved, and rapid and efficient image adjustment and display effect improvement are achieved.

CN113018856BActive Publication Date: 2024-11-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110342472.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-30
Publication Date
2024-11-08
Estimated Expiration
2041-03-30

AI Technical Summary

Technical Problem

When adjusting the game screen in the prior art, the static light baking method takes a long time and has poor effect, and the dynamic light method is prone to jagging, which affects the display effect.

Method used

By obtaining the image to be processed and its brightness and color parameters, performing color level adjustment and color adjustment processing, generating the target image, shortening the adjustment time and improving the display effect.

Benefits of technology

It realizes rapid adjustment of images according to user-defined parameters, improving the display effect and efficiency of game screens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113018856B_ABST
    Figure CN113018856B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image processing method, device, electronic device and storage medium, which obtains an image to be processed and the brightness adjustment parameters and color parameters corresponding to the image to be processed; then, according to the brightness adjustment parameters, the image to be processed is adjusted in color scale to obtain a first adjusted image; the first adjusted image includes at least a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; finally, according to the color parameters, the first area is color-adjusted to obtain a second adjusted image. The embodiment of the present application can readjust the image according to the user-defined color parameters, which can shorten the time of regenerating the image according to the customized color parameters, improve the efficiency of adjusting the image, and improve the display effect of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of computer communication technology, the widespread application of terminals such as smart phones, tablets and laptops, terminals are developing in a diversified and personalized direction, and are becoming an indispensable terminal in people's life and work. In order to meet people's pursuit of spiritual life, entertainment games that can be operated on terminals have emerged. For example, multiplayer online tactical competitive games (Multiplayer Online Battle Arena, MOBA) and massively multiplayer online games (Massive Multiplayer Online, MMO) developed based on client or server architecture are deeply loved by users due to their high fluency, good operation feel, real-time combat and other characteristics. With the vigorous development of online games, people have higher and higher requirements for the realism of game scenes.

[0003] In computer animation production, environment-based lighting rendering is an important part of achieving realism, and the shadow effect of light on objects is a very important part of the entire game screen or game scene. In the process of game development, the game screen usually uses baking to draw the shadow information representing the dark part of the screen into the light map, relying on static light baking, dynamic light to produce shadows on objects, or a combination of the two to generate the game screen. However, in the prior art, if the static light baking method is used to readjust the game screen that has been generated, it is necessary to adjust the corresponding parameters and bake again, and the time required to regenerate the game screen is long and the effect is slow; if the dynamic light method is used to readjust the game screen that has been generated, jagged edges are likely to appear at the boundary between the bright and dark parts of the game screen, resulting in poor display effects of the game screen. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which can readjust the image according to the color parameters customized by the user, shorten the time of regenerating the image according to the customized parameters, improve the efficiency of adjusting the image, and improve the display effect of the image.

[0005] The present application provides an image processing method, which includes:

[0006] Acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed;

[0007] According to the brightness adjustment parameter, the to-be-processed image is subjected to a color scale adjustment to obtain a first adjusted image; the first adjusted image comprises at least a first region and a second region, wherein a brightness value of the first region is smaller than a brightness value of the second region;

[0008] According to the color parameter, the first area is subjected to color adjustment processing to obtain a second adjusted image.

[0009] Optionally, obtaining an image to be processed includes:

[0010] The designated image is subjected to inversion processing to obtain an inversion-processed image as the image to be processed.

[0011] Optionally, after obtaining the first adjusted image, the method further includes:

[0012] The first area and the second area are determined according to brightness values ​​of pixels in the first adjusted image.

[0013] Optionally, the brightness adjustment parameter includes a maximum brightness value and a minimum brightness value;

[0014] The step of adjusting the color scale of the image to be processed includes:

[0015] Obtaining a first difference between the maximum brightness value and the minimum brightness value;

[0016] Acquire a second difference between the grayscale value of the image to be processed and the minimum brightness value;

[0017] A color scale adjustment parameter is determined according to a ratio of the second difference value to the first difference value, and a color scale adjustment is performed on the image to be processed based on the color scale adjustment parameter.

[0018] Optionally, after performing color adjustment processing on the first area according to the color parameter to obtain a second adjusted image, the method further includes:

[0019] The second adjusted image is superimposed with the gray constant value image to obtain a third adjusted image, wherein the gray constant value image is obtained by setting the gray value of the image to be processed to a preset constant.

[0020] Optionally, the superimposing the second adjusted image with the gray constant value image to obtain a third adjusted image includes:

[0021] Obtaining a first product of a pixel value of a pixel in the first adjusted image and a pixel value of a pixel in the second adjusted image;

[0022] Performing inversion processing on the first adjusted image, and obtaining a second product of a pixel value of the inverted first adjusted image and a grayscale value of the grayscale constant value image;

[0023] A superposition processing parameter is determined according to the first product and the second product, and the image to be processed is adjusted based on the superposition processing parameter to obtain a third adjusted image.

[0024] Optionally, after the second adjusted image is superimposed with the gray constant value image to obtain the third adjusted image, the method further includes:

[0025] Based on the preset weight parameters, the third adjusted image and the image to be processed, a multiply process is performed to obtain a fourth adjusted image.

[0026] Optionally, after the second adjusted image is superimposed with the gray constant value image to obtain the third adjusted image, the method further includes:

[0027] A color filtering process is performed according to the third adjusted image and the image to be processed to obtain a fifth adjusted image.

[0028] Optionally, performing color filtering processing according to the third adjusted image and the image to be processed to obtain a fifth adjusted image includes:

[0029] Performing inversion processing on the image to be processed;

[0030] performing inversion processing on the third adjusted image;

[0031] Acquire a third product of the pixel value of the inverted image to be processed and the pixel value of the inverted third adjusted image;

[0032] Obtaining a third difference between a specified constant and the third product;

[0033] A color filtering processing parameter is determined according to the third difference, and the image to be processed is adjusted based on the color filtering processing parameter to obtain a fifth adjusted image.

[0034] Optionally, also include:

[0035] The fourth adjusted image and the fifth adjusted image are mixed based on a preset constant to obtain a target image.

[0036] Optionally, the mixing the fourth adjusted image and the fifth adjusted image to obtain a target image includes:

[0037] The image to be processed is compared with the preset constant, and the pixel values ​​of the fourth adjusted image and the pixel values ​​of the fifth adjusted image are respectively taken to replace the pixel values ​​of the image to be processed.

[0038] Optionally, comparing the image to be processed with the preset constant, and respectively taking the pixel value of the fourth adjusted image and the pixel value of the fifth adjusted image to replace the pixel value of the image to be processed, includes:

[0039] Determine the magnitude relationship between the pixel value of the image to be processed and the preset constant;

[0040] Determine a first pixel set and a second pixel set from the image to be processed based on the size relationship, wherein pixel values ​​of pixels in the first pixel set are all smaller than a preset threshold, and pixel values ​​of pixels in the second pixel set are all larger than the preset threshold;

[0041] Replacing the pixel values ​​of the pixels of the to-be-processed image that are in the first pixel set with the pixel values ​​of the pixels in the fourth adjusted image;

[0042] The pixel values ​​of the pixels of the to-be-processed image located in the second pixel set are replaced with the pixel values ​​of the pixels in the fifth adjusted image.

[0043] Accordingly, an embodiment of the present application further provides an image processing device, the device comprising:

[0044] An acquisition unit, used for acquiring an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed;

[0045] An adjustment unit, configured to perform a color scale adjustment on the image to be processed according to the brightness adjustment parameter to obtain a first adjusted image; the first adjusted image at least includes a first area and a second area, wherein a brightness value of the first area is less than a brightness value of the second area;

[0046] A processing unit is used to perform color adjustment on the first area according to the color parameter to obtain a second adjusted image.

[0047] Optionally, the image processing device further includes a processing unit, wherein the processing unit is configured to:

[0048] The first area and the second area are determined according to brightness values ​​of pixels in the first adjusted image.

[0049] Optionally, the acquisition unit is further used to:

[0050] Obtaining a first difference between the maximum brightness value and the minimum brightness value;

[0051] Acquire a second difference between the grayscale value of the image to be processed and the minimum brightness value;

[0052] A color scale adjustment parameter is determined according to a ratio of the second difference value to the first difference value, and a color scale adjustment is performed on the image to be processed based on the color scale adjustment parameter.

[0053] Optionally, the processing unit is further configured to:

[0054] The second adjusted image is superimposed with the gray constant value image to obtain a third adjusted image, wherein the gray constant value image is obtained by setting the gray value of the image to be processed to a preset constant.

[0055] Optionally, the acquisition unit is further used to:

[0056] Obtaining a first product of a pixel value of a pixel in the first adjusted image and a pixel value of a pixel in the second adjusted image;

[0057] Performing inversion processing on the first adjusted image, and obtaining a second product of a pixel value of the inverted first adjusted image and a grayscale value of the grayscale constant value image;

[0058] A superposition processing parameter is determined according to the first product and the second product, and the image to be processed is adjusted based on the superposition processing parameter to obtain a third adjusted image.

[0059] Optionally, the processing unit is further configured to:

[0060] Based on the preset weight parameters, the third adjusted image and the image to be processed, a multiply process is performed to obtain a fourth adjusted image.

[0061] Optionally, the processing unit is further used to: perform color filtering processing according to the third adjusted image and the image to be processed to obtain a fifth adjusted image.

[0062] Optionally, the processing unit is further configured to:

[0063] Performing inversion processing on the image to be processed;

[0064] performing inversion processing on the third adjusted image;

[0065] Acquire a third product of the pixel value of the inverted image to be processed and the pixel value of the inverted third adjusted image;

[0066] Obtaining a third difference between a specified constant and the third product;

[0067] A color filtering processing parameter is determined according to the third difference, and the image to be processed is adjusted based on the color filtering processing parameter to obtain a fifth adjusted image.

[0068] Optionally, the processing unit is further configured to:

[0069] The fourth adjusted image and the fifth adjusted image are mixed based on a preset constant to obtain a target image.

[0070] Optionally, the processing unit is further configured to:

[0071] The image to be processed is compared with the preset constant, and the pixel values ​​of the fourth adjusted image and the pixel values ​​of the fifth adjusted image are respectively taken to replace the pixel values ​​of the image to be processed.

[0072] Optionally, the processing unit is further configured to:

[0073] Determine the magnitude relationship between the pixel value of the image to be processed and the preset constant;

[0074] Determine a first pixel set and a second pixel set from the image to be processed based on the size relationship, wherein pixel values ​​of pixels in the first pixel set are all smaller than a preset threshold, and pixel values ​​of pixels in the second pixel set are all larger than the preset threshold;

[0075] Replacing the pixel values ​​of the pixels of the to-be-processed image that are in the first pixel set with the pixel values ​​of the pixels in the fourth adjusted image;

[0076] The pixel values ​​of the pixels of the to-be-processed image located in the second pixel set are replaced with the pixel values ​​of the pixels in the fifth adjusted image.

[0077] Correspondingly, an embodiment of the present application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of any one of the image processing methods described above are implemented.

[0078] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the image processing methods described above are implemented.

[0079] The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which obtains an image to be processed and the brightness adjustment parameters and color parameters corresponding to the image to be processed; then, according to the brightness adjustment parameters, the image to be processed is adjusted in color scale to obtain a first adjusted image; the first adjusted image includes at least a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; finally, according to the color parameters, the first area is color-adjusted to obtain a second adjusted image. The embodiments of the present application can readjust the image (or game screen) according to the color parameters defined by the user, which can shorten the time of regenerating the image according to the customized color parameters, improve the efficiency of adjusting the image, and improve the display effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0081] Figure 1 is a system schematic diagram of an image processing device provided in an embodiment of the present application.

[0082] Figure 2 It is a flowchart of the image processing method provided in an embodiment of the present application.

[0083] Figure 3 This is another flowchart of the image processing method provided in the embodiment of the present application.

[0084] Figure 4a This is a schematic diagram of a first application scenario of the image processing device provided in an embodiment of the present application.

[0085] Figure 4b This is a schematic diagram of a second application scenario of the image processing device provided in an embodiment of the present application.

[0086] Figure 4c This is a schematic diagram of a third application scenario of the image processing device provided in an embodiment of the present application.

[0087] Figure 4d This is a schematic diagram of a fourth application scenario of the image processing device provided in an embodiment of the present application.

[0088] Figure 5a It is a schematic diagram of the first preprocessed image provided in an embodiment of the present application.

[0089] Figure 5bThis is a schematic diagram of the first application scenario of the image processing method provided in the embodiment of the present application.

[0090] Figure 5c This is a schematic diagram of a second application scenario of the image processing method provided in an embodiment of the present application.

[0091] Figure 5d This is a schematic diagram of a third application scenario of the image processing method provided in an embodiment of the present application.

[0092] Figure 5e This is a schematic diagram of a fourth application scenario of the image processing method provided in an embodiment of the present application.

[0093] Figure 5f It is a schematic diagram of a target image provided in an embodiment of the present application.

[0094] Figure 6 It is a structural schematic diagram of the image processing device provided in an embodiment of the present application.

[0095] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0096] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0097] The embodiment of the present application provides an image processing method, device, electronic device and storage medium, which displays a user interface on the electronic device, and when a trigger operation of a user on an image processing control is detected, an image processing sub-interface is displayed on the user interface according to the user's trigger operation; then, a brightness adjustment parameter and a color parameter of a specified color value input by the user through the image processing sub-interface are received, wherein the brightness adjustment parameter includes a maximum brightness value and a minimum brightness value, and an image processing instruction is generated based on the maximum brightness value, the minimum brightness value and the color parameter of the specified color value; then, in response to the image processing instruction, grayscale processing and inversion processing are performed on the image to be processed in sequence, and based on the maximum brightness value and the minimum brightness value, an image processing instruction is generated based on the color parameter of the specified color value. The color value of the pixel in the image after the minimum brightness value adjustment and grayscale processing and inversion processing is obtained to obtain the first adjustment image; then, the first adjustment image is adjusted according to the color parameters to obtain the second adjustment image; then, the second color parameter based on the specified color value, the first adjustment image and the second adjustment image are mixed to obtain the third adjustment image; then, the third adjustment image and the image to be processed are respectively subjected to positive film overlay processing and color filter processing to obtain the fourth adjustment image and the fifth adjustment image; finally, based on the size relationship between the color value of each pixel in the image to be processed and the preset color threshold, the fourth adjustment image and the fifth adjustment image are generated to generate the target image, and the target image is displayed on the user interface. The embodiment of the present application can readjust the game screen (i.e., image) according to the color parameters customized by the user, which can shorten the time of regenerating the game screen according to the customized color parameters, improve the efficiency of adjusting the game screen, and improve the display effect of the game screen. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0098] Specifically, the image processing method of the embodiment of the present application can be performed by an electronic device, wherein the electronic device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc. The server can be an independent physical server, a game engine, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0099] See also Figure 1 , Figure 1A system diagram of an image processing device provided in an embodiment of the present application. The system may include at least one electronic device, and a user may perform the image processing method provided in an embodiment of the present application through an electronic device held by the user. An electronic device is any device having computing hardware, such as a terminal, which can support and execute a software product corresponding to a game. In addition, the electronic device has one or more multi-touch screens for sensing and obtaining input of a user through a touch or sliding operation performed at multiple points on one or more touch-sensitive display screens. Different electronic devices may also use their own Bluetooth network or hotspot network to connect to other terminals or to a server, etc. The network may be a wireless network or a wired network, such as a wireless network such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc.

[0100] The image processing method in this application is introduced below through specific embodiments. Please refer to Figure 2 , Figure 2 A schematic diagram of a flow chart of an image processing method provided in an embodiment of the present application is provided, and the method is applied to a terminal as an example for explanation. The specific flow of the image processing method may be as follows:

[0101] Step 101: Obtain an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed.

[0102] In one embodiment, in order to highlight the dark areas in the image and make the darker areas of the image appear brighter, the terminal can perform inversion processing on the specified image to obtain the inverted image as the image to be processed. Specifically, the user can specify an image, and the terminal calculates the pixel value of each pixel in the specified image based on the image specified by the user by using the inversion formula to obtain the inverted value corresponding to the pixel value of each pixel, thereby generating the image to be processed according to the inverted value. Among them, the image to be processed is obtained by performing inversion processing on the specified image. The inversion formula used for the inversion processing can be as follows:

[0103] R2=1-H1

[0104] G2=1-H2

[0105] B2=1-H3

[0106] Wherein, R2, G2 and B2 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the image after the inversion processing. R2 is the R (Red) value of each pixel in the image after the inversion processing, G2 is the G (Green) value of each pixel in the image after the inversion processing, and B2 is the B (Blue) value of each pixel in the image after the inversion processing. Wherein, the values ​​of R2, G2 and B2 in the embodiment of the present application are in the interval [0,1]. In addition, H1, H2, and H3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the image to be processed. H1 is the R (Red) value of each pixel in the image to be processed, H2 is the G (Green) value of each pixel in the image to be processed, and H3 is the B (Blue) value of each pixel in the image to be processed.

[0107] Step 102, adjusting the color scale of the image to be processed according to the brightness adjustment parameter to obtain a first adjusted image; the first adjusted image at least includes a first area and a second area, wherein the brightness value of the first area is smaller than the brightness value of the second area.

[0108] In one embodiment, in order to adjust the brightness of the preprocessed image, a color scale adjustment method can be used to adjust the image to be processed. The purpose is to make the gray area in the image to be processed grayer and the bright area brighter, so as to separate the bright and dark parts of the image. The terminal can determine the first area and the second area according to the brightness value of the pixel in the first adjustment image. Specifically, the brightness adjustment parameter includes the maximum brightness and the minimum brightness. The terminal obtains the first difference between the maximum brightness and the minimum brightness, and then obtains the second difference between the gray value and the minimum brightness of the image to be processed. Finally, the color scale adjustment parameter is determined according to the ratio of the second difference to the first difference, and the color scale adjustment is performed on the image to be processed based on the color scale adjustment parameter.

[0109] For example, the pixel value of each pixel in the image to be processed can be calculated by a color scale adjustment formula to obtain the color value of each pixel in the image to be processed after the color scale adjustment, and a first adjusted image is generated according to the color value of each pixel in the image to be processed after the color scale adjustment. The first adjusted image is obtained by performing a color scale adjustment process on the image to be processed. The color scale adjustment formula used for the color scale adjustment can be as follows:

[0110] R3=(R2-Z2) / (Z1-Z2)

[0111] G3=(G2-Z2) / (Z1-Z2)

[0112] B3=(B2-Z2) / (Z1-Z2)

[0113] Wherein, R3, G3 and B3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the first adjustment image. R3 is the R (Red) value of each pixel in the first adjustment image, G3 is the G (Green) value of each pixel in the first adjustment image, and B3 is the B (Blue) value of each pixel in the first adjustment image. Wherein, the values ​​of R3, G3 and B3 in the embodiment of the present application are in the interval [0,1]. R2, G2 and B2 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the image after inversion processing. R2 is the R (Red) value of each pixel in the image after inversion processing, G2 is the G (Green) value of each pixel in the image after inversion processing, and B2 is the B (Blue) value of each pixel in the image after inversion processing. Z1 is the maximum brightness, that is, the brightest upper limit (LevelMax) of the image to be processed; Z2 is the minimum brightness, that is, the darkest lower limit (LevelMin) of the image to be processed. It should be noted that the maximum brightness value is greater than the minimum brightness value, and the maximum brightness value and the minimum brightness value can be in the interval [0,1]. Users can select the specified maximum brightness value and minimum brightness value in the interval [0,1] according to their needs.

[0114] Step 103: performing color adjustment processing on the first area according to the color parameter to obtain a second adjusted image.

[0115] Among them, in order to adjust the image details of the image to be processed, such as the cold and warm tendency, contrast, brightness, etc. of the image, the embodiment of the present application uses a color adjustment formula and color parameters combined with the pixel values ​​of each pixel in the first adjustment image to calculate, obtain the color value of each pixel in the first adjustment image after color adjustment, and generate a second adjustment image according to the color value of each pixel in the first adjustment image after color adjustment. For example, first, obtain the first product of the first pixel value of the pixel in the first adjustment image and the first pixel value in the color parameter, obtain the second product of the second pixel value of the pixel in the first adjustment image and the second pixel value in the color parameter, and obtain the third product of the third pixel value of the pixel in the first adjustment image and the third pixel value in the color parameter; then, determine the second target color parameter according to the first product, the second product and the third product, and determine the second adjustment image based on the second target color parameter.

[0116] Optionally, the terminal may perform superposition processing on the second adjusted image and the gray constant value image to obtain a third adjusted image, wherein the gray constant value image is to set the gray value of the image to be processed to a preset constant. For example, the terminal obtains the first product of the pixel value of the pixel in the first adjusted image and the pixel value of the pixel in the second adjusted image, then inverts the first adjusted image, and obtains the second product of the pixel value of the inverted first adjusted image and the gray value of the gray constant value image, and finally, determines the superposition processing parameters according to the first product and the second product, and adjusts the image to be processed based on the superposition processing parameters to obtain the third adjusted image.

[0117] In one embodiment, after the second adjusted image is superimposed with the gray constant image to obtain the third adjusted image, a positive film overlay process can be performed based on preset weight parameters, the third adjusted image and the image to be processed to obtain a fourth adjusted image.

[0118] In one embodiment, the terminal performs color filtering processing according to the third adjusted image and the image to be processed to obtain a fifth adjusted image.

[0119] The terminal performs an inversion process on the image to be processed and an inversion process on the third adjusted image. Then, a third product of the pixel value of the inverted image to be processed and the pixel value of the inverted third adjusted image is obtained; and a third difference between the specified constant and the third product is obtained. Finally, a color filter processing parameter is determined according to the third difference, and the image to be processed is adjusted based on the color filter processing parameter to obtain a fifth adjusted image.

[0120] Further, the terminal may perform a mixing process on the fourth adjusted image and the fifth adjusted image based on a preset constant to obtain a target image.

[0121] For example, the terminal compares the image to be processed with the preset constant, and respectively takes the pixel values ​​of the fourth adjusted image and the pixel values ​​of the fifth adjusted image to replace the pixel values ​​of the image to be processed.

[0122] The terminal determines the size relationship between the pixel value of the image to be processed and the preset constant. Then, based on the size relationship, a first pixel set and a second pixel set are determined from the image to be processed, wherein the pixel values ​​of the pixels in the first pixel set are all less than the preset threshold, and the pixel values ​​of the pixels in the second pixel set are all greater than the preset threshold. Finally, the pixel values ​​of the pixels of the image to be processed located in the first pixel set are replaced with the pixel values ​​of the pixels in the fourth adjustment image; and the pixel values ​​of the pixels of the image to be processed located in the second pixel set are replaced with the pixel values ​​of the pixels in the fifth adjustment image.

[0123] The image processing method in this application is introduced below through specific embodiments. Please refer to Figure 3 , Figure 3 Another flow chart of the image processing method provided in the embodiment of the present application is described by taking the method applied to a terminal as an example. The specific flow of the image processing method may be as follows:

[0124] Step 201: display a user interface, where the user interface displays an image to be processed and an image processing sub-interface.

[0125] The image processing method provided in the embodiment of the present application is described by taking execution by a terminal as an example. The terminal includes a touch screen and a processor, and the touch screen is used to present a user interface and display an image to be processed and an image processing sub-interface in the user interface. When a user operates the user interface in the touch screen in a triggering manner, the terminal can control the local content of the terminal by responding to the received operation instructions, and can also control the content of the opposite server by responding to the received operation instructions. For example, the operation instructions generated by the user acting on the trigger operation include instructions for triggering image processing. In addition, the touch screen can be a multi-touch sensitive screen that can sense touch or sliding operations performed simultaneously on multiple points on the screen. Figure 4a As shown, Figure 4a This is a schematic diagram of the first application scenario of the image processing device provided by the embodiment of the present application. A user interface can be rendered on the touch screen of the terminal, and the user interface includes an image to be processed and an image processing sub-interface. The user can trigger the image processing instruction by triggering and display the image processing sub-interface in the user interface. Among them, the display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0126] Specifically, there are multiple ways to trigger the user interface to display the image to be processed and the image processing sub-interface. The user interface can be triggered to display the image to be processed and the image processing sub-interface by triggering the image processing control, or the user interface can be triggered to display the image to be processed and the image processing sub-interface by the terminal recognizing a custom gesture, or the user interface can be triggered to display the image to be processed and the image processing sub-interface by the terminal recognizing a voice command, and so on.

[0127] In one embodiment, the user can use a finger to perform a touch operation on the user interface. When the user interface detects that the user performs a touch operation on the image processing control, an image processing sub-interface is displayed on the user interface. The image processing sub-interface may include multiple numerical input boxes and a color preview image processing sub-interface. Different numerical input boxes are used to receive color parameters of the maximum brightness, minimum brightness, and specified color values ​​input by the user. The color preview image processing sub-interface can be used to preview the color corresponding to the color parameter based on the specified color value input by the user. Among them, the image processing sub-interface and the image to be processed can be at different levels. For example, the display level of the image processing sub-interface is higher than the display level of the image to be processed. For example, if Figure 4b As shown, Figure 4b This is a schematic diagram of a second application scenario of the image processing device provided in an embodiment of the present application. A user interface can be rendered on a touch screen of a terminal, and the user interface includes an image to be processed and an image processing control. A user can click the image processing control to trigger an image processing instruction and display an image processing sub-interface in the user interface. Then, according to the image processing instruction, an image processing operation is performed on the image to be processed to generate a target image. The display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0128] In one embodiment, a touch operation can be performed on the user interface by the terminal recognizing a custom gesture. The user can pre-set a custom gesture as a trigger gesture. When the terminal detects that the user's current gesture meets the pre-set custom gesture, the image to be processed and an image processing sub-interface are displayed on the user interface. The image processing sub-interface may include multiple numerical input boxes and a color preview image processing sub-interface. Different numerical input boxes are used to receive the maximum brightness, minimum brightness and color parameters of the specified color value input by the user. The color preview image processing sub-interface can be used to preview the color corresponding to the color parameter based on the specified color value input by the user. Among them, the image processing sub-interface and the image to be processed can be at different levels. For example, the display level of the image processing sub-interface is higher than the display level of the image to be processed. Specifically, when obtaining the user's air gesture operation, the air gesture can be obtained through the sensor device built into the terminal. For example, the user's air gesture operation can be acquired through the terminal's built-in shooting element or infrared sensor element, and the air gesture operation includes but is not limited to air waving up, air waving down, air moving left, air moving right, air pressing down, air grabbing, air fisting, air making numbers, V-shaped or heart-shaped gestures, etc. In addition, the air gesture can also be acquired through the terminal's built-in ultrasonic element. For example, Figure 4c As shown, Figure 4c This is a schematic diagram of the third application scenario of the image processing device provided by the embodiment of the present application. A user interface can be rendered on the touch screen of the terminal, and the user interface includes a display of an image to be processed. When the terminal detects that the user's current gesture meets the preset gesture (for example, the preset gesture is to make a fist in the air), the image processing instruction is triggered according to the current gesture and the image processing sub-interface is displayed in the user interface. Then, according to the image processing instruction, the image processing operation is performed on the image to be processed to generate a target image. Among them, the display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0129] In one embodiment, the touch operation can be performed on the user interface by the terminal recognizing the voice command. When the terminal detects the voice command issued by the user, the image to be processed and an image processing sub-interface are displayed on the user interface. The image processing sub-interface may include multiple numerical input boxes and a color preview image processing sub-interface. Different numerical input boxes are used to receive the maximum brightness, minimum brightness and color parameters of the specified color value input by the user. The color preview image processing sub-interface can be used to preview the color corresponding to the color parameter based on the specified color value input by the user. Among them, the image processing sub-interface and the image to be processed can be at different levels. For example, Figure 4d As shown, Figure 4d This is a schematic diagram of the fourth application scenario of the image processing device provided by the embodiment of the present application. A user interface can be rendered on the touch screen of the terminal, and the user interface includes a display of an image to be processed. When the terminal detects a voice command from the user, an image processing instruction is triggered according to the voice command and an image processing sub-interface is displayed in the user interface. Then, an image processing operation is performed on the image to be processed according to the image processing instruction to generate a target image. Among them, the display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0130] The maximum brightness value can be the brightest upper limit (LevelMax) of the image to be processed; the minimum brightness value can be the darkest lower limit (LevelMin) of the image to be processed. It should be noted that the maximum brightness value is greater than the minimum brightness value, and the maximum brightness value and the minimum brightness value can be in the interval [0,1]. Users can select the specified maximum brightness value and minimum brightness value in the interval [0,1] according to their needs.

[0131] In one embodiment, when a user operates the user interface in the touch display screen in a triggering manner, the terminal can control the local content of the terminal by responding to the received operation instructions, and can first display an image to be processed on the user interface, and then display an image processing sub-interface on the user interface, wherein the image to be processed can be determined by the user from an image display list, and the display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0132] In one embodiment, when a user operates the user interface in the touch display screen in a triggering manner, the terminal can control the local content of the terminal by responding to the received operation instructions, and can first display an image processing sub-interface on the user interface, and then display an image to be processed on the user interface, wherein the image to be processed can be determined by the user from an image display list, and the display level of the image processing sub-interface is higher than the display level of the image to be processed.

[0133] Step 202, obtaining color parameters of the maximum brightness, minimum brightness and specified color value through the image processing sub-interface, and generating an image processing instruction based on the color parameters of the maximum brightness, minimum brightness and specified color value, wherein the maximum brightness is greater than the minimum brightness.

[0134] Specifically, the terminal may receive color parameters of maximum brightness, minimum brightness and designated color value input by the user through the image processing sub-interface, and generate an image processing instruction based on the color parameters of maximum brightness, minimum brightness and designated color value.

[0135] The image processing sub-interface includes at least a numerical input box corresponding to a color parameter of a specified color value, a color preview image processing sub-interface, a numerical input box corresponding to a maximum brightness value, and a numerical input box corresponding to a minimum brightness value. For example, a user can enter custom numerical parameters in different numerical input boxes in the image processing sub-interface according to needs. The specified color can be determined based on the color parameter of the specified color value entered in the corresponding numerical input box, and the specified color can be displayed in the color preview image processing sub-interface.

[0136] Step 203 , preprocessing the image to be processed in response to the image processing instruction, and adjusting the pixel values ​​of pixels in the preprocessed image based on the maximum brightness value and the minimum brightness value to obtain a first adjusted image.

[0137] In order to avoid the problem of image distortion in the subsequent image processing process, the image to be processed can be grayed in advance, that is, the pixel values ​​of the pixels in the image to be processed are converted into gray values ​​that only represent the degree of brightness. For example, the grayscale formula can be used to grayscale the image to be processed. First, the grayscale value of each pixel of the image to be processed is calculated. Then, the pixel value corresponding to each pixel in the image to be processed is replaced with the calculated grayscale value corresponding to each pixel, thereby obtaining a first preprocessed image. Figure 5a As shown, Figure 5a is a schematic diagram of a first preprocessed image provided by an embodiment of the present application, and the figure shows a first preprocessed image a. For example, when performing grayscale processing in an embodiment of the present application, the grayscale formula used in the grayscale processing can be as follows:

[0138] Gray value H = R1*0.299+G1*0.587+B1*0.114

[0139] Wherein, R1, G1 and B1 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the image to be processed. R1 is the R (Red) value of each pixel of the image to be processed, G1 is the G (Green) value of each pixel of the image to be processed, and B1 is the B (Blue) value of each pixel of the image to be processed. Wherein, the values ​​of R1, G1 and B1 in the embodiment of the present application are in the interval [0,1]. The pixel values ​​in the first preprocessed image include H1, H2, and H3, and H1, H2, and H3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel of the first preprocessed image. H1 is the R (Red) value of each pixel of the first preprocessed image, H2 is the G (Green) value of each pixel of the first preprocessed image, and H3 is the B (Blue) value of each pixel of the first preprocessed image.

[0140] In one embodiment, in order to highlight the dark areas in the image and make the darker areas of the image appear brighter, the first pre-processed image may be inverted. Specifically, the pixel values ​​of each pixel in the first pre-processed image are calculated using an inversion formula to obtain the inverted values ​​corresponding to the pixel values ​​of each pixel, thereby generating the second pre-processed image according to the inverted values. Figure 5b As shown, Figure 5b A schematic diagram of a first application scenario of the image processing method provided in an embodiment of the present application, wherein the second preprocessed image b is obtained by inverting the first preprocessed image a. The inversion formula used in the inversion processing can be as follows:

[0141] R2=1-H1

[0142] G2=1-H2

[0143] B2=1-H3

[0144] Wherein, R2, G2 and B2 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the second preprocessed image. R2 is the R (Red) value of each pixel of the second preprocessed image, G2 is the G (Green) value of each pixel of the second preprocessed image, and B2 is the B (Blue) value of each pixel of the second preprocessed image. Wherein, the values ​​of R2, G2 and B2 in the embodiment of the present application are in the interval [0,1]. In addition, H1, H2, and H3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel of the first preprocessed image. H1 is the R (Red) value of each pixel of the first preprocessed image, H2 is the G (Green) value of each pixel of the first preprocessed image, and H3 is the B (Blue) value of each pixel of the first preprocessed image.

[0145] In one embodiment, in order to adjust the brightness of the preprocessed image, the preprocessed image (i.e., the second preprocessed image) may be adjusted by a color scale adjustment method. The purpose is to make the gray area in the preprocessed image grayer and the bright area brighter, so as to separate the bright and dark parts of the image. For example, the pixel value of each pixel in the preprocessed image may be calculated by a color scale adjustment formula to obtain the pixel value of each pixel in the preprocessed image after color scale adjustment, and generate a first adjusted image based on the pixel value of each pixel in the preprocessed image after color scale adjustment. Figure 5c As shown, Figure 5c A schematic diagram of a second application scenario of the image processing method provided in an embodiment of the present application, wherein the first adjusted image c is obtained by performing a color scale adjustment process on the second pre-processed image b. The color scale adjustment formula used for the color scale adjustment can be as follows:

[0146] R3=(R2-Z2) / (Z1-Z2)

[0147] G3=(G2-Z2) / (Z1-Z2)

[0148] B3=(B2-Z2) / (Z1-Z2)

[0149] Among them, R3, G3 and B3 are the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the first adjustment image, respectively. R3 is the R (Red) value of each pixel in the first adjustment image, G3 is the G (Green) value of each pixel in the first adjustment image, and B3 is the B (Blue) value of each pixel in the first adjustment image. Among them, the values ​​of R3, G3 and B3 in the embodiment of the present application are in the interval [0,1]. Z1 is the maximum brightness, that is, the brightest upper limit (LevelMax) of the image to be processed; Z2 is the minimum brightness, that is, the darkest lower limit (LevelMin) of the image to be processed. It should be noted that the maximum brightness is greater than the minimum brightness, and the maximum brightness and the minimum brightness can take values ​​in the interval [0,1]. Users can select the specified maximum brightness and minimum brightness in the interval [0,1] according to their needs.

[0150] For example, the embodiment of the present application obtains a first difference between the maximum brightness and the minimum brightness, then obtains a second difference between the first pixel value of the pixel in the preprocessed image and the minimum brightness, and obtains a first ratio of the second difference to the first difference; at the same time, obtains a third difference between the second pixel value of the pixel in the preprocessed image and the minimum brightness, and obtains a second ratio of the third difference to the first difference, and obtains a fourth difference between the third pixel value of the pixel in the preprocessed image and the minimum brightness, and obtains a third ratio of the fourth difference to the first difference; then, determines a first target color parameter according to the first ratio, the second ratio and the third ratio, and determines a first adjusted image based on the first target color parameter; wherein the maximum brightness is greater than the minimum brightness, the maximum brightness and the minimum brightness can take values ​​in the interval [0,1], and the user can select a specified maximum brightness and minimum brightness in the interval [0,1] as required.

[0151] Step 204: adjusting the pixel values ​​of the pixels in the first adjusted image according to the color parameters to obtain a second adjusted image.

[0152] Among them, in order to adjust the image details of the image to be processed, such as the cold and warm tendency, contrast, brightness, etc. of the image, the embodiment of the present application uses the color adjustment formula and color parameters combined with the pixel value of each pixel in the first adjustment image to calculate, obtain the pixel value of each pixel in the first adjustment image after color adjustment, and generate the second adjustment image according to the pixel value of each pixel in the first adjustment image after color adjustment. Figure 5d As shown, Figure 5d This is a schematic diagram of a third application scenario of the image processing method provided in an embodiment of the present application, wherein the second adjusted image d is obtained by performing color adjustment processing on the first adjusted image c. The color adjustment formula used for the color adjustment can be as follows:

[0153] R4=(R3-Y1)

[0154] G4=(G3-Y2)

[0155] B4=(B3-Y3)

[0156] Wherein, R4, G4 and B4 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the second adjustment image. R4 is the R (Red) value of each pixel in the second adjustment image, G4 is the G (Green) value of each pixel in the second adjustment image, and B4 is the B (Blue) value of each pixel in the second adjustment image. Wherein, the values ​​of R4, G4 and B4 in the embodiment of the present application are in the interval [0,1]. Y1, Y2 and Y3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the color parameter. Y1 is the R (Red) value of each pixel in the color parameter, Y2 is the G (Green) value of each pixel in the color parameter, and Y3 is the B (Blue) value of each pixel in the color parameter. Wherein, R3, G3 and B3 can take values ​​in the interval [0,1], and the user can select the specified R value, G value and B value in the interval [0,1] according to the needs.

[0157] For example, calculation is performed according to the color adjustment formula: first, a first product of a first pixel value of a pixel in the first adjustment image and a first pixel value in the color parameter is obtained; a second product of a second pixel value of a pixel in the first adjustment image and a second pixel value in the color parameter is obtained, and a third product of a third pixel value of a pixel in the first adjustment image and a third pixel value in the color parameter is obtained; then, a second target color parameter is determined according to the first product, the second product and the third product, and a second adjustment image is determined based on the second target color parameter.

[0158] Step 205 , generating a target image based on the second color parameter of the designated color value, the first adjusted image, the second adjusted image, and the image to be processed, and displaying the target image on a user interface.

[0159] In one embodiment, the third adjusted image may be generated based on the second color parameter, the first adjusted image, and the second adjusted image. Specifically, the pixel values ​​of each pixel after mixing may be calculated using a mixing formula based on the second color parameter, the first adjusted image, and the second adjusted image, and the third adjusted image may be generated based on the pixel values ​​of each pixel after mixing. Figure 5e As shown, Figure 5e This is a schematic diagram of a fourth application scenario of the image processing method provided in an embodiment of the present application, wherein a third adjusted image e is obtained by mixing the second adjusted image d. The color mixing formula used in the color mixing process can be as follows:

[0160] R5=(R3*R4)+(X1*R4)

[0161] G5=(G3*G4)+(X2*G4)

[0162] B5=(B3*B4)+(X3*B4)

[0163] Wherein, R5, G5 and B5 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the third adjustment image. R5 is the R (Red) value of each pixel in the third adjustment image, G5 is the G (Green) value of each pixel in the second adjustment image, and B5 is the B (Blue) value of each pixel in the third adjustment image. Wherein, the values ​​of R5, G5 and B5 are in the interval [0,1] in the embodiment of the present application. X1, X2 and X3 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the second color parameter. X1 is the R (Red) value of each pixel in the second color parameter, X2 is the G (Green) value of each pixel in the second color parameter, and X3 is the B (Blue) value of each pixel in the second color parameter. Among them, R3, G3 and B3 can take values ​​in the interval [0,1]. The user can select the specified R value, G value and B value in the interval [0,1] according to the needs. For example, the pixel value corresponding to the second color parameter is (0.5, 0.5, 0.5).

[0164] In one embodiment, the fourth adjusted image can be generated based on the third adjusted image and the image to be processed, that is, the third adjusted image is subjected to a multiplication process based on the image to be processed to obtain the fourth adjusted image. For example, the multiplication formula can be used to calculate the pixel value of each pixel after multiplication based on the third adjusted image and the image to be processed, and the fourth adjusted image is generated based on the pixel value of each pixel after multiplication. The multiplication formula used for multiplication processing can be as follows:

[0165] R6 = (R1*R5*preset weight parameter)

[0166] G6 = (G1*G5*preset weight parameter)

[0167] B6 = (B1 * B5 * preset weight parameter)

[0168] Wherein, R6, G6 and B6 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the fourth adjustment image. R6 is the R (Red) value of each pixel in the fourth adjustment image, G6 is the G (Green) value of each pixel in the fourth adjustment image, and B6 is the B (Blue) value of each pixel in the fourth adjustment image. Wherein, the values ​​of R6, G6 and B6 in the embodiment of the present application are in the interval [0,1]; the preset weight parameter can be 2.

[0169] In one embodiment, the fifth adjusted image can be generated based on the third adjusted image and the image to be processed, that is, the third adjusted image is subjected to color filtering based on the image to be processed to obtain the fifth adjusted image. For example, the color filtering formula can be used to calculate the pixel value of each pixel after the color filtering based on the third adjusted image and the image to be processed, and the fifth adjusted image is generated based on the pixel value of each pixel after the color filtering. The color filtering formula used for the color filtering process can be as follows:

[0170] R7=1-(1-R1)*(1-R5)

[0171] G7=1-(1-G1)*(1-G5)

[0172] B7=1-(1-B1)*(1-B5)

[0173] Wherein, R7, G7 and B7 are respectively the first pixel value, the second pixel value and the third pixel value corresponding to each pixel in the fifth adjustment image. R7 is the R (Red) value of each pixel in the fifth adjustment image, G7 is the G (Green) value of each pixel in the fifth adjustment image, and B7 is the B (Blue) value of each pixel in the fifth adjustment image. Wherein, the values ​​of R7, G7 and B7 in the embodiment of the present application are in the interval [0,1].

[0174] In one embodiment, the size relationship between the pixel value of each pixel in the image to be processed and the preset color threshold can be determined, and the pixel value of each pixel in the image to be processed is adjusted based on the size relationship, the pixel value of each pixel in the fourth adjustment image, and the pixel value of each pixel in the fifth adjustment image. For example, when the pixel value of a pixel in the image to be processed is less than the preset threshold, the pixel value of the pixel in the image to be processed is replaced with the pixel value corresponding to the pixel in the fourth adjustment image; when the pixel value of a pixel in the image to be processed is greater than the preset threshold, the pixel value of the pixel in the image to be processed is replaced with the pixel value corresponding to the pixel in the fifth adjustment image. A target image is generated based on the pixel value corresponding to the pixel in the replaced fourth adjustment image and the pixel value corresponding to the pixel in the replaced fifth adjustment image; for example, the preset threshold in the embodiment of the present application may be 0.5. Figure 5f As shown, Figure 5f is a schematic diagram of a target image provided in an embodiment of the present application. The target image g is as follows: Figure 5f shown.

[0175] In one embodiment, in order to reduce the steps of image processing and improve the efficiency of image processing, the size relationship between the pixel value of each pixel in the image to be processed and the preset color threshold can be determined first, and then the pixel value of each pixel in the image to be processed can be adjusted based on the size relationship, the third adjusted image and the image to be processed. That is, first determine the first pixel set and the second pixel set from the third adjusted image based on the size relationship, wherein the pixel values ​​of the pixels in the first pixel set are all less than the preset threshold, and the pixel values ​​of the pixels in the second pixel set are all greater than the preset threshold. The preset threshold in the embodiment of the present application can be 0.5. Then, perform a positive film overlay process on each pixel in the first pixel set to obtain a processed first pixel set; perform a color filter process on each pixel in the second pixel set to obtain a processed second pixel set. Finally, generate a target image based on the processed first pixel set and the processed second pixel set.

[0176] In summary, the embodiment of the present application provides an image processing method, by obtaining an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; then, according to the brightness adjustment parameters, the image to be processed is adjusted in color scale to obtain a first adjusted image; the first adjusted image at least includes a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; finally, according to the color parameters, the first area is color-adjusted to obtain a second adjusted image. The embodiment of the present application can readjust the image (or game screen) according to the user-defined color parameters, which can shorten the time of regenerating the image according to the customized color parameters, improve the efficiency of adjusting the image, and improve the display effect of the image.

[0177] In order to better implement the above method, the embodiment of the present application may also provide an image processing device, which may be specifically integrated in a network device, and the network device may be a terminal or other device.

[0178] For example, Figure 6 As shown, the image processing device may include an acquisition unit 301, an adjustment unit 302, and a processing unit 303, as follows:

[0179] An acquisition unit 301 is used to acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed;

[0180] An adjustment unit 302 is used to perform a color scale adjustment on the image to be processed according to the brightness adjustment parameter to obtain a first adjusted image; the first adjusted image at least includes a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area;

[0181] The processing unit 303 is used to perform color adjustment processing on the first area according to the color parameter to obtain a second adjusted image.

[0182] Optionally, the image processing device further includes a processing unit, wherein the processing unit is configured to:

[0183] The first area and the second area are determined according to brightness values ​​of pixels in the first adjusted image.

[0184] Optionally, the acquiring unit 301 is further configured to:

[0185] Obtaining a first difference between the maximum brightness value and the minimum brightness value;

[0186] Acquire a second difference between the grayscale value of the image to be processed and the minimum brightness value;

[0187] A color scale adjustment parameter is determined according to a ratio of the second difference value to the first difference value, and a color scale adjustment is performed on the image to be processed based on the color scale adjustment parameter.

[0188] Optionally, the processing unit 303 is further configured to:

[0189] The second adjusted image is superimposed with the gray constant value image to obtain a third adjusted image, wherein the gray constant value image is obtained by setting the gray value of the image to be processed to a preset constant.

[0190] Optionally, the acquiring unit 301 is further configured to:

[0191] Obtaining a first product of a pixel value of a pixel in the first adjusted image and a pixel value of a pixel in the second adjusted image;

[0192] Performing inversion processing on the first adjusted image, and obtaining a second product of a pixel value of the inverted first adjusted image and a grayscale value of the grayscale constant value image;

[0193] A superposition processing parameter is determined according to the first product and the second product, and the image to be processed is adjusted based on the superposition processing parameter to obtain a third adjusted image.

[0194] Optionally, the processing unit 303 is further configured to:

[0195] Based on the preset weight parameters, the third adjusted image and the image to be processed, a multiply process is performed to obtain a fourth adjusted image.

[0196] Optionally, the processing unit 303 is further configured to: perform color filtering processing according to the third adjusted image and the image to be processed to obtain a fifth adjusted image.

[0197] Optionally, the processing unit 303 is further configured to:

[0198] Performing inversion processing on the image to be processed;

[0199] performing inversion processing on the third adjusted image;

[0200] Acquire a third product of the pixel value of the inverted image to be processed and the pixel value of the inverted third adjusted image;

[0201] Obtaining a third difference between a specified constant and the third product;

[0202] A color filtering processing parameter is determined according to the third difference, and the image to be processed is adjusted based on the color filtering processing parameter to obtain a fifth adjusted image.

[0203] Optionally, the processing unit 303 is further configured to:

[0204] The fourth adjusted image and the fifth adjusted image are mixed based on a preset constant to obtain a target image.

[0205] Optionally, the processing unit 303 is further configured to:

[0206] The image to be processed is compared with the preset constant, and the pixel values ​​of the fourth adjusted image and the pixel values ​​of the fifth adjusted image are respectively taken to replace the pixel values ​​of the image to be processed.

[0207] Optionally, the processing unit 303 is further configured to:

[0208] Determine the magnitude relationship between the pixel value of the image to be processed and the preset constant;

[0209] Determine a first pixel set and a second pixel set from the image to be processed based on the size relationship, wherein pixel values ​​of pixels in the first pixel set are all smaller than a preset threshold, and pixel values ​​of pixels in the second pixel set are all larger than the preset threshold;

[0210] Replacing the pixel values ​​of the pixels of the to-be-processed image that are in the first pixel set with the pixel values ​​of the pixels in the fourth adjusted image;

[0211] The pixel values ​​of the pixels of the to-be-processed image located in the first pixel set are replaced with the pixel values ​​of the pixels in the fifth adjusted image.

[0212] The embodiment of the present application discloses an image processing device, which includes: an acquisition unit 301, used to acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; an adjustment unit 302, used to adjust the color scale of the image to be processed according to the brightness adjustment parameters to obtain a first adjusted image; the first adjusted image includes at least a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; a processing unit 303, used to perform color adjustment processing on the first area according to the color parameters to obtain a second adjusted image. The embodiment of the present application can readjust the game screen (i.e., image) according to the user-defined color parameters, which can shorten the time of regenerating the game screen according to the customized color parameters, improve the efficiency of adjusting the game screen, and improve the display effect of the game screen.

[0213] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal or a server, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. Figure 7 As shown, Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0214] The processor 401 is the control center of the computer device 400. It uses various interfaces and lines to connect the various parts of the entire computer device 400, executes various functions of the computer device 400 and processes data by running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, thereby monitoring the computer device 400 as a whole.

[0215] In the embodiment of the present application, the processor 401 in the computer device 400 will load instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 will run the application programs stored in the memory 402 to implement various functions:

[0216] Acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; perform color scale adjustment on the image to be processed according to the brightness adjustment parameters to obtain a first adjusted image; the first adjusted image includes at least a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; perform color adjustment on the first area according to the color parameters to obtain a second adjusted image.

[0217] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0218] Optional, such as Figure 7 As shown, the computer device 400 further includes: a touch screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art can understand that Figure 7 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0219] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 401, and can receive the command sent by the processor 401 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event, and then the processor 401 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 403 can also be used as a part of the input unit 406 to realize the input function.

[0220] In the embodiment of the present application, the processor 401 generates a user interface on the touch screen 403, and the user interface may include an image to be processed and an image processing control. The touch screen 403 is used to present the user interface and the image to be processed, the image processing control, and the image processing operation instructions generated by the triggering image processing control displayed in the user interface.

[0221] The radio frequency circuit 404 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.

[0222] The audio circuit 405 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 405 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405 and converted into audio data, and then the audio data is output to the processor 401 for processing, and then sent to another computer device through the radio frequency circuit 404, or the audio data is output to the memory 402 for further processing. The audio circuit 405 may also include an earphone jack to provide communication between an external headset and the computer device.

[0223] The input unit 406 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0224] The power supply 407 is used to supply power to various components of the computer device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 407 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0225] although Figure 7 Not shown, the computer device 400 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0226] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0227] From the above, it can be seen that the electronic device provided in this embodiment can readjust the game screen (i.e., image) according to the user-defined color parameters, which can shorten the time of regenerating the game screen according to the customized color parameters, improve the efficiency of adjusting the game screen, and improve the display effect of the game screen.

[0228] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0229] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any image processing method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0230] Acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; perform color scale adjustment on the image to be processed according to the brightness adjustment parameters to obtain a first adjusted image; the first adjusted image includes at least a first area and a second area, wherein the brightness value of the first area is less than the brightness value of the second area; perform color adjustment on the first area according to the color parameters to obtain a second adjusted image.

[0231] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0232] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0233] Since the computer program stored in the storage medium can execute the steps in any image processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0234] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0235] The above is a detailed introduction to an image processing method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solution and its core idea of ​​the present application. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: include: Acquire an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; According to the brightness adjustment parameter, the to-be-processed image is adjusted in color scale to obtain a first adjusted image; The first adjusted image at least includes a first area and a second area, wherein the brightness value of the first area is smaller than the brightness value of the second area; According to the color parameter, color adjustment is performed on the first area to obtain a second adjusted image; The second adjusted image is superimposed with a gray constant value image to obtain a third adjusted image, wherein the gray constant value image is obtained by setting the gray value of the image to be processed to a preset constant; Determine a magnitude relationship between a pixel value of each pixel in the image to be processed and a preset color threshold, and adjust the pixel value of each pixel in the image to be processed based on the magnitude relationship, the pixel value of each pixel in the fourth adjusted image, and the pixel value of each pixel in the fifth adjusted image; The fourth adjusted image is an image obtained by performing a positive film overlay process on the third adjusted image and the image to be processed, and the fifth adjusted image is an image obtained by performing a color filter process on the third adjusted image and the image to be processed.

2. The image processing method according to claim 1, characterized in that: The step of acquiring an image to be processed comprises: The designated image is subjected to inversion processing to obtain an inversion-processed image as the image to be processed.

3. The image processing method according to claim 1, characterized in that: After obtaining the first adjusted image, the method further includes: The first area and the second area are determined according to brightness values ​​of pixels in the first adjusted image.

4. The image processing method according to claim 3, characterized in that: The brightness adjustment parameters include a maximum brightness value and a minimum brightness value; The step of adjusting the color scale of the image to be processed includes: Obtaining a first difference between the maximum brightness value and the minimum brightness value; Acquire a second difference between the grayscale value of the image to be processed and the minimum brightness value; A color scale adjustment parameter is determined according to a ratio of the second difference value to the first difference value, and a color scale adjustment is performed on the image to be processed based on the color scale adjustment parameter.

5. The image processing method according to claim 1, characterized in that: The step of superimposing the second adjusted image with the gray constant value image to obtain a third adjusted image includes: Obtaining a first product of a pixel value of a pixel in the first adjusted image and a pixel value of a pixel in the second adjusted image; Performing inversion processing on the first adjusted image, and obtaining a second product of a pixel value of the inverted first adjusted image and a grayscale value of the grayscale constant value image; A superposition processing parameter is determined according to the first product and the second product, and the image to be processed is adjusted based on the superposition processing parameter to obtain a third adjusted image.

6. The image processing method according to claim 1, characterized in that: After the second adjusted image is superimposed with the gray constant value image to obtain a third adjusted image, the method further includes: Based on the preset weight parameters, the third adjusted image and the image to be processed, a multiply process is performed to obtain a fourth adjusted image.

7. The image processing method according to claim 1, characterized in that: The method further comprises: Performing inversion processing on the image to be processed; performing inversion processing on the third adjusted image; Obtaining a third product of the pixel value of the inverted image to be processed and the pixel value of the inverted third adjusted image; Obtaining a third difference between a specified constant and the third product; A color filtering processing parameter is determined according to the third difference, and the image to be processed is adjusted based on the color filtering processing parameter to obtain a fifth adjusted image.

8. The image processing method according to any one of claims 1 or 6, characterized in that: Also includes: The fourth adjusted image and the fifth adjusted image are mixed based on a preset constant to obtain a target image.

9. The image processing method according to claim 8, characterized in that: The mixing of the fourth adjusted image and the fifth adjusted image to obtain a target image includes: The image to be processed is compared with the preset constant, and the pixel values ​​of the fourth adjusted image and the pixel values ​​of the fifth adjusted image are respectively taken to replace the pixel values ​​of the image to be processed.

10. The image processing method according to claim 9, characterized in that: The step of comparing the image to be processed with the preset constant and respectively taking the pixel value of the fourth adjusted image and the pixel value of the fifth adjusted image to replace the pixel value of the image to be processed comprises: Determine the magnitude relationship between the pixel value of the image to be processed and the preset constant; Determine a first pixel set and a second pixel set from the image to be processed based on the size relationship, wherein pixel values ​​of pixels in the first pixel set are all smaller than a preset threshold, and pixel values ​​of pixels in the second pixel set are all larger than the preset threshold; Replacing the pixel values ​​of the pixels of the to-be-processed image that are in the first pixel set with the pixel values ​​of the pixels in the fourth adjusted image; The pixel values ​​of the pixels of the to-be-processed image located in the second pixel set are replaced with the pixel values ​​of the pixels in the fifth adjusted image.

11. An image processing device, characterized in that: The device comprises: An acquisition unit, used for acquiring an image to be processed and brightness adjustment parameters and color parameters corresponding to the image to be processed; An adjustment unit, configured to perform a color scale adjustment on the image to be processed according to the brightness adjustment parameter to obtain a first adjusted image; the first adjusted image at least includes a first area and a second area, wherein a brightness value of the first area is smaller than a brightness value of the second area; A processing unit, configured to perform color adjustment on the first area according to the color parameter to obtain a second adjusted image; A processing unit, configured to perform superposition processing on the second adjusted image and a gray constant value image to obtain a third adjusted image, wherein the gray constant value image is obtained by setting the gray value of the image to be processed to a preset constant; a processing unit, configured to determine a size relationship between a pixel value of each pixel in the image to be processed and a preset color threshold, and adjust the pixel value of each pixel in the image to be processed based on the size relationship, the pixel value of each pixel in the fourth adjusted image, and the pixel value of each pixel in the fifth adjusted image; The fourth adjusted image is an image obtained by performing a positive film overlay process on the third adjusted image and the image to be processed, and the fifth adjusted image is an image obtained by performing a color filter process on the third adjusted image and the image to be processed.

12. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the image processing method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 10 are implemented.