Image processing method and device, equipment and storage medium
By using a display processor to perform layer overlay and color inversion processing, the high power consumption problem when overlaying layers with similar colors is solved, resulting in a clear display effect.
Patent Information
- Application Number
- CN202510984265.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-11-07
AI Technical Summary
In image processing, when layers with similar colors are overlaid, existing technologies require a large amount of resources from the terminal device, resulting in high power consumption and unclear display.
The display processor is used for layer overlay and color inversion. The target pixel is identified by the marker layer and the color is inverted. The hardware structure is used to reduce the consumption of software resources.
It reduces the power consumption of terminal devices and ensures that the superimposed display content is clearly visible.
Smart Images

Figure CN120909688A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to layer superimposition technology, and relate to but are not limited to an image processing method and device, equipment, and a storage medium. BACKGROUND
[0002] In the process of processing an image, it is usually necessary to superimpose multiple layers.
[0003] In the process of superimposing multiple layers, there may be superimposition between layers with similar colors. In order to avoid the situation that multiple layers cannot be distinguished after superimposition of layers with similar colors, anti-color processing is needed. Anti-color processing refers to rendering and inverting the color of an upper layer in two layers that need to be superimposed, so that the color of the upper layer and the color of the lower layer are obviously different. However, the process of anti-color processing consumes a large number of resources of a terminal device, resulting in high power consumption of the terminal device. SUMMARY
[0004] Therefore, the image processing method and device, equipment, and storage medium provided by embodiments of the present application can reduce the power consumption of a terminal device in the process of layer anti-color processing. The image processing method and device, equipment, and storage medium provided by embodiments of the present application are implemented as follows:
[0005] In an aspect of embodiments of the present application, an image processing method is provided, applied to a terminal device, the terminal device comprising a display processor and a display screen, the output end of the display processor being connected to the display screen. The method comprises the following steps:
[0006] In response to a trigger operation of displaying an initial image, a plurality of layers of the initial image are acquired, the plurality of layers comprising an identification layer and a plurality of background layers, the identification layer being used to identify target pixel points in the initial image that need to be inverted in color;
[0007] The display processor is used to perform color inversion processing on the target pixel points based on the identification layer and the plurality of background layers, and the display screen is used to display a target image, the target image being an image in which the target pixel points in the initial image have been subjected to color inversion processing.
[0008] In another aspect of embodiments of the present application, an image processing device is also provided, applied to a terminal device, the terminal device comprising a display processor and a display screen, the output end of the display processor being connected to the display screen. The device comprises an acquisition module and a processing module.
[0009] The acquisition module is used to acquire, in response to a trigger operation of displaying an initial image, a plurality of layers of the initial image, the plurality of layers comprising an identification layer and a plurality of background layers, the identification layer being used to identify target pixel points in the initial image that need to be inverted in color;
[0010] The processing module is configured to perform color inversion processing on the target pixel point based on the identification layer and the plurality of background layers by using a display processor, and display a target image on a display screen, the target image being an image obtained by performing color inversion processing on the target pixel point in the initial image.
[0011] The computer device provided in the embodiments of the present application includes a memory and a processor. The memory stores a computer program that can run on the processor. The processor implements the method of the embodiments of the present application when executing the program.
[0012] The computer readable storage medium provided in the embodiments of the present application stores a computer program. The computer program is executed by a processor to implement the method provided in the embodiments of the present application.
[0013] In the image processing method and device, the equipment and the storage medium provided in the embodiments of the present application, in response to a trigger operation of displaying an initial image, a plurality of layers of the initial image are acquired, the plurality of layers include an identification layer and a plurality of background layers, and the identification layer is used to identify a target pixel point in the initial image that needs to be inverted in color. Color inversion processing is performed on the target pixel point based on the identification layer and the plurality of background layers by using a display processor, and a target image is displayed on a display screen, the target image being an image obtained by performing color inversion processing on the target pixel point in the initial image. The position that needs to be inverted in color can be determined by using the identification layer. In addition, the display processor is a hardware processor, and the color inversion processing based on the display processor can reduce the consumption of software resources in the process of performing color inversion processing. Therefore, the color inversion processing based on the display processor can also reduce the power consumption of a terminal device. In addition, the color inversion processing on the background layers can also distinguish colors in the process of layer superposition, so that the superimposed display content is clear and visible. BRIEF DESCRIPTION OF DRAWINGS
[0014] To make the technical solutions in the embodiments of the present application clearer, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0015] Figure 1 The figure is a hardware structure diagram of the terminal device provided in the embodiments of the present application.
[0016] Figure 2 The figure is a flow diagram of the image processing method provided in the embodiments of the present application.
[0017] Figure 3 The figure is a relationship diagram of layer superposition and color inversion processing provided in the embodiments of the present application.
[0018] Figure 4 A flowchart of color inversion processing provided in an embodiment of the present application is shown in FIG. 4.
[0019] Figure 5 A schematic diagram of determining a target pixel point is shown in FIG. 5.
[0020] Figure 6 A flowchart of performing color inversion processing on a target pixel point is shown in FIG. 6.
[0021] Figure 7 A schematic diagram of a target mapping relationship is shown in FIG. 7.
[0022] Figure 8 A schematic diagram of determining attribute information after color inversion based on a target mapping relationship is shown in FIG. 8.
[0023] Figure 9 Another schematic diagram of determining attribute information after color inversion based on a target mapping relationship is shown in FIG. 9.
[0024] Figure 10 Still another schematic diagram of determining attribute information after color inversion based on a target mapping relationship is shown in FIG. 10.
[0025] Figure 11 A structural schematic diagram of a display processor is shown in FIG. 11.
[0026] Figure 12 A schematic diagram of an interface after color inversion superposition processing is shown in FIG. 12.
[0027] Figure 13 A structural schematic diagram of an image processing apparatus is shown in FIG. 13.
[0028] Figure 14 A structural schematic diagram of a computer device is shown in FIG. 14. DETAILED DESCRIPTION
[0029] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the present application with reference to the accompanying drawings of the embodiments of the present application. The following embodiments are used to explain the present application, but not to limit the scope of the present application.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the present application only and not intended to limit the present application.
[0031] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets as each other and as other embodiments described herein, and that references to "some embodiments" are made for clarity and are not to be construed as limiting in any way.
[0032] It should be noted that the terms "first", "second", "third" involved in the embodiments of the present application are used to distinguish similar or different objects, and do not represent a specific order of the objects. Understandably, "first", "second", "third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0033] In the process of image processing by a terminal device, such as screenshot, recording, etc., it usually involves the process of superimposing multiple layers, wherein the superimposition of layers refers to superimposing multiple layers into one image.
[0034] In related technologies, when superimposing layers, the alpha blending superimposition method is used. For any two upper and lower layers, when the upper layer is superimposed on the lower layer, each pixel of the upper layer has an alpha value representing the transparency. When alpha = 1, the pixel of the upper layer is opaque, when alpha = 0, the pixel of the upper layer is completely transparent, and when alpha is between 0 and 1, the pixel is translucent. The superimposition formula is as follows:
[0035] C_r = A_r * alpha + B_r * (1-alpha);
[0036] C_g = A_g * alpha + B_g * (1-alpha);
[0037] C_b = A_b * alpha + B_b * (1-alpha);
[0038] Wherein, A is the upper layer, B is the lower layer, alpha is the alpha value of the pixel point of the upper layer, r, g, b respectively correspond to the red channel, the green channel and the blue channel. The alpha values of the red, green and blue channels after superimposition can be calculated by the above formula, and C is the superimposed image.
[0039] In a process of layer superimposition in the related art, if the color of an upper layer is similar to that of a lower layer, for example, the lower layer is a white background and the upper layer is white text, the white text on the white background cannot be clearly displayed no matter how the alpha value is adjusted. Therefore, background recognition based on a graphics processor is needed, and then different layers are rendered in color, for example, the upper layer is rendered so that the color of the upper layer is obviously different from that of the lower layer, and then layer superimposition is performed.
[0040] However, background recognition based on a graphics processor and layer rendering increase the latency and power consumption of a terminal device. To solve the above problems in the related art, an image processing method is provided in an embodiment of the present application.
[0041] The hardware structure of a terminal device for executing the image processing method provided in the embodiment of the present application is explained below.
[0042] Figure 1 For the hardware structure of the terminal device provided in the embodiment of the present application, please refer to Figure 1 The terminal device includes a display processor 110 and a display screen 120. The output end of the display processor 110 is connected to the display screen 120.
[0043] The terminal device provided in the embodiment of the present application can include but is not limited to a mobile phone, a wearable device (such as a smart watch, a smart bracelet, smart glasses, etc.), a tablet computer, a notebook computer, a vehicle-mounted terminal, a PC (Personal Computer), etc. The functions implemented by the method can be realized by calling program code by a processor in the terminal device. Of course, the program code can be saved in a computer storage medium. Therefore, the terminal device at least includes a processor and a storage medium.
[0044] The multiple layers to be superimposed can be input to the display processor 110. The display processor 110 performs superimposition processing on the layers, and the obtained result can be output to the display screen 120.
[0045] It should be noted that the display processor 110 can be a hardware processor specially used for processing display-related tasks. The display processor 110 can perform various processing on input image data, for example, image scaling, rotation, clipping, color space conversion, etc.
[0046] In the embodiment of the present application, the display processor 110 can be a display processor with a specific hardware structure, for example, having the ability of image recognition and the ability of color inversion processing, etc.
[0047] In an embodiment, the display screen 120 can be a screen for displaying content, such as a screen of a mobile phone, a display of a computer, etc., which is not specifically limited herein.
[0048] It should be noted that, in the working process of the terminal device, the plurality of layers of the initial image can be input into the display processor 110, and the display processor 110 can perform layer superposition, color inversion processing, etc., to obtain a target image, and after obtaining the target image, the target image can be output to the display screen 120, and the display screen 120 can display the target image.
[0049] It should be noted that, in the working process of the terminal device, the plurality of layers of the initial image can be input into the display processor 110, and the display processor 110 can perform layer superposition, color inversion processing, etc., to obtain a target image, and after obtaining the target image, the target image can be output to the display screen 120, and the display screen 120 can display the target image.
[0050] The following explains one of the possible implementation processes of the image processing method provided in the embodiments of the present application.
[0051] Figure 2 For the flowchart of the image processing method provided in the embodiments of the present application, please refer to Figure 2 The method comprises the following steps.
[0052] S210: In response to a trigger operation of displaying an initial image, a plurality of layers of the initial image are obtained.
[0053] The plurality of layers include an identification layer and a plurality of background layers, and the identification layer is used to identify target pixel points in the initial image that need to be inverted in color.
[0054] It should be noted that the execution subject of the method can be the terminal device described above, such as a mobile phone, a tablet computer, etc., which is not specifically limited herein.
[0055] The initial image can be an image of a certain region that can be displayed in the terminal device, such as an image displayed in the interface of a screenshot of the terminal device, or an image displayed in the interface of a recording of the terminal device, which is not specifically limited herein.
[0056] The trigger operation of displaying the initial image can be, for example, an image generation operation, a screenshot operation, a recording operation, an operation of viewing a superposition effect, etc., which is not specifically limited herein. The trigger operation can be an operation actively performed by a user, or an operation automatically triggered by the terminal device when a predetermined condition is met.
[0057] Optionally, the initial image can include multiple layers, which can include two different types of layers, wherein the background layer can be an RGB (red, green, and blue) format layer, and the identification layer can be a custom-defined format layer, which can be a pure transparent layer with corresponding identification information set at some pixel points, indicating that the corresponding position of the pixel points needs to be processed by color inversion.
[0058] It should be noted that the multiple layers of the initial image can include an identification layer and multiple background layers.
[0059] Optionally, the size of the identification layer and the background layer can not be the same, which is not limited here, for example: the identification layer can be the same size as any one of the background layers, or smaller than any one of the background layers; the size of each background layer in the multiple background layers can be the same or different, which is not limited here.
[0060] It should be noted that the background layer in the initial image can be a screenshot of the layer displayed in the current interface, or an image file, etc., which is not limited here; the identification layer in the initial image can be a layer generated by a graphics processor or a central processing unit or other devices, and the corresponding layer format after generation can be a custom-defined format.
[0061] S220: performing color inversion processing on the target pixel points based on the identification layer and the multiple background layers by the display processor, and displaying the target image on the display screen.
[0062] In one embodiment, after obtaining the multiple layers of the initial image, the layers can be input into the display processor of the terminal device.
[0063] It should be noted that the display processor can have multiple input ports, each of which can input a layer, and after the multiple layers are input into the display processor, the display processor can perform color inversion processing on the layers.
[0064] Optionally, during the color inversion processing, the display processor can first perform layer superposition processing on the multiple background layers to obtain the superimposed background layer.
[0065] Then, the position of the background layer that needs to be color-inverted can be determined according to the identification layer, for example: one or more pixel points in the superimposed background layer can be color-inverted to obtain the target image, which can be the target pixel points.
[0066] Optionally, the target image is the image after color inversion processing on the target pixel points.
[0067] In an embodiment, after the target image is obtained, the target image can be output to the display screen by the display processor, and the target image can be displayed by the display screen.
[0068] In the image processing method provided in the embodiments of the present application, the initial image can be displayed in response to a triggering operation, and a plurality of layers of the initial image can be obtained, the plurality of layers including an identification layer and a plurality of background layers, the identification layer being used to identify target pixel points in the initial image that need to be inverted in color; the display processor can be used to perform color inversion processing on the target pixel points based on the identification layer and the plurality of background layers, and the target image can be displayed by the display screen, the target image being an image in which the target pixel points in the initial image have been subjected to color inversion processing. The position that needs to be subjected to color inversion can be determined by the identification layer. In addition, the display processor is a hardware processor, and therefore, in the process of performing color inversion processing, the display processor does not need to consume a large amount of software resources, and therefore, the color inversion processing based on the display processor can reduce the power consumption of the terminal device. In addition, the color inversion processing on the background layers can also distinguish colors in the process of layer superposition, so that the superimposed display content is clear and visible.
[0069] The implementation process of performing layer superposition and color inversion processing by the display processor provided in the embodiments of the present application will be explained below.
[0070] Figure 3 For the relationship diagram of layer superposition and color inversion processing provided in the embodiments of the present application, please refer to Figure 3 The plurality of layers can be input to the display processor, and can include an identification layer and a plurality of background layers.
[0071] The plurality of layers can be input to the display processor, and can include an identification layer and a plurality of background layers.
[0072] In an embodiment, the plurality of layers can be input to the display processor sequentially or in parallel and synchronously, and the display processor can perform corresponding steps according to the types of different layers after the plurality of layers are input to the display processor. For example, the background layers can be processed by superposition processing, and the identification layer can be processed by color inversion processing after the superimposed background layers are obtained, without specific limitation.
[0073] The following explains one of the feasible implementation procedures of the color inversion processing implemented by the display processor in the image processing method provided by the embodiments of the present application.
[0074] Figure 4 For the flowchart of the color inversion processing provided by the embodiments of the present application, please refer to Figure 4 The color inversion processing on the target pixel point is implemented by the display processor based on the identification layer and the plurality of background layers, including:
[0075] S410: The display processor performs superposition processing on the plurality of background layers to obtain the superimposed background layer.
[0076] Optionally, after the plurality of layers are acquired, the display processor can perform superposition processing on the plurality of background layers, wherein the superposition processing can be the alpha channel superposition explained above.
[0077] For example, for any two layers, in the superposition process, if the alpha value of the upper layer is 0, it can be determined that the upper layer is completely transparent, and the superposition result is the lower layer; if the alpha value of the upper layer is 1, it can be determined that the upper layer is completely opaque, and the superposition result is the upper layer; if the alpha value of the upper layer is between 0 and 1, the superposition result can be determined by using the calculation formula of the red-green-blue three channels.
[0078] It should be noted that in the layer superposition process, the superposition can be performed by two layers, for example, if there are three layers to be superimposed, layer 1 and layer 2 can be superimposed first, and then layer 3 is superimposed based on the superimposed layer and layer 2, and so on. The superposition result obtained by superimposing each two layers is the superimposed background layer.
[0079] In an embodiment, the plurality of background layers can have a layer order, for example, the positions in the initial image are different from bottom to top, and the superposition can be performed in a certain order, for example, the superposition can be performed from bottom to top. Assuming that the background layers include six layers, the order from bottom to top is layer 1 to layer 6, layer 1 and layer 2 can be superimposed first, then layer 3 is superimposed based on the superimposed result, then layer 4 is superimposed based on the superimposed result, then layer 5 is superimposed based on the superimposed result, and finally layer 6 is superimposed based on the superimposed result. The superposition is performed in this order, which can avoid the problem of superposition error in the layer superposition process.
[0080] S420: Determine target pixel points in the superimposed background layer according to the marked pixel points in the identification layer, and perform color inversion processing on the target pixel points by the display processor.
[0081] Each marked pixel point in the identification layer corresponds to a target pixel point in the superimposed background layer.
[0082] It should be noted that the target pixel points in the superimposed background layer can be determined according to the identification layer.
[0083] The target pixel point can be a pixel point in the superimposed background layer that needs to be processed by color inversion.
[0084] The identification layer can also include a plurality of pixel points, wherein the marked pixel point can be a pixel point with identification information, and the marked pixel point can correspond to a target pixel point in the superimposed background layer.
[0085] The foregoing has explained that the identification layer can be a layer of a customized and customized format, and each pixel point in the layer can be set with corresponding identification information, and the pixel point that needs to be processed by color inversion can be determined by the corresponding identification information. For example: the identification pixel point and other pixel points can be distinguished by setting identification information and not setting identification information; or the identification pixel point and other pixel points can also be distinguished by setting different identification information, which is not limited here.
[0086] In an embodiment, after the identification layer is obtained, the pixel point that needs to be processed by color inversion can be determined according to the identification information in each pixel point in the identification layer.
[0087] It should be noted that each pixel point in the identification layer has a corresponding pixel point in the superimposed background layer, for example: if the identification layer and the superimposed background layer have the same size, the pixel points at the same position are the corresponding pixel points; if the size of the identification layer is smaller than the size of the superimposed background layer, there can be overlapping pixel points when the identification layer is superimposed on the superimposed background layer, wherein the overlapping pixel points are the corresponding pixel points.
[0088] After the target pixel points in the superimposed background layer are determined, the target pixel points can be processed by color inversion, so that the target image can be obtained.
[0089] In the image processing method provided in the embodiments of the present application, the display processor can perform superimposition processing on the plurality of background layers to obtain superimposed background layers; the display processor can determine target pixel points from the superimposed background layers according to the marked pixel points in the identification layer, and perform color inversion processing on the target pixel points. After superimposition processing on the background layers in the plurality of layers, color inversion processing can be performed on a single layer, and the target pixel points in the superimposed background layers that need to be processed by color inversion can be determined more quickly and accurately through the identification layer, so that the efficiency of color inversion processing can be improved.
[0090] The following will specifically explain one of the feasible implementation processes for determining the target pixel points based on the identification layer provided in the embodiments of the present application.
[0091] Figure 5 For the relationship diagram for determining the target pixel points provided in the embodiments of the present application, please refer to Figure 5 The identification layer includes at least one marked pixel point, each marked pixel point corresponds to an identification information, and each identification information is used to indicate color inversion of a target pixel point corresponding to the marked pixel point.
[0092] It should be noted that the identification layer can include one or more identification pixel points, each identification pixel point corresponds to an identification information, and each pixel point in the identification layer corresponds to a pixel point in the superimposed background layer, that is, one identification information can correspond to one pixel point in the superimposed background layer.
[0093] For example, if the identification layer includes 10 identification information, it can be determined that the identification layer includes 10 identification pixel points for indicating color inversion.
[0094] Figure 5 In the example shown in the above table, the identification layer and the superimposed background layer can be two layers with equal sizes, wherein the identification layer can include one pixel point indicated by identification A and one pixel point indicated by identification B, wherein the pixel point indicated by identification A corresponds to a target pixel point in the superimposed background layer, and the pixel point indicated by identification B also corresponds to a target pixel point in the superimposed background layer.
[0095] Figure 5 In the above table, two identification information are taken as an example for explanation, and in actual implementation, there can be multiple identification information, each of which can correspond to a pixel point in the superimposed background layer, that is, a target pixel point.
[0096] In an embodiment, the display processor determines the target pixel points from the superimposed background layer according to the marked pixels in the identification layer, including: the display processor determines the pixel points corresponding to each identification information from the superimposed background layer, and the pixel points corresponding to each identification information are the target pixel points.
[0097] It should be noted that the display processor can determine a plurality of target pixel points from the superimposed background layer according to the correspondence of the identification information, the target pixel points can be the pixel points corresponding to each identification information, and the number of target pixel points can correspond to the number of identification information.
[0098] In the image processing method provided in the embodiments of the present application, the display processor can determine the pixel points corresponding to each identification information from the superimposed background layer, and the pixel points corresponding to each identification information are the target pixel points. Through the correspondence of the identification information, the target pixel points can be determined from the superimposed background layer more quickly and accurately, and the color inversion processing of the target pixel points can be performed more quickly.
[0099] The following explains one of the feasible implementation processes of the color inversion processing of the target pixel points provided in the embodiments of the present application.
[0100] Figure 6 For the flowchart of the color inversion processing of the target pixel points provided in the embodiments of the present application, please refer to Figure 6 The color inversion processing of the target pixel points includes:
[0101] S610: The display processor determines the attribute information of each target pixel point after color inversion according to the attribute information of each target pixel point before color inversion and the target mapping relationship.
[0102] It should be noted that after the plurality of target pixel points are determined, the color inversion processing can be performed on each target pixel point, and in the process of the color inversion processing, the attribute information of each target pixel point before the color inversion processing can be acquired first.
[0103] The attribute information includes at least one of color, brightness, and gray scale.
[0104] It should be noted that the color can be a specific value of a red-green-blue channel, the brightness can be a percentage brightness of 0-1, which is used to represent the brightness of the color in the image, i.e., the relative light and dark degree of the color; and the gray scale can be a percentage gray scale of 0-1, which is used to represent the color depth of the pixel points in the black-and-white image, and it reflects the light and dark information of the image.
[0105] The target mapping relationship is used to represent a corresponding relationship between attribute information before color inversion and attribute information after color inversion of a pixel point.
[0106] The corresponding relationship can be a corresponding relationship between one attribute information and one attribute information, or a corresponding relationship between one attribute information interval and one attribute information interval, which is not limited here.
[0107] The attribute information of each target pixel point after color inversion can be determined according to the attribute information of each target pixel point before color inversion and the target mapping relationship.
[0108] S620: Adjust the attribute information of the corresponding target pixel point according to the attribute information of each target pixel point after color inversion.
[0109] It should be noted that after the attribute information of the target pixel point after color inversion is determined, the attribute information of the target pixel point can be adjusted, for example, the attribute information of the target pixel point before color inversion can be adjusted to the attribute information after color inversion.
[0110] For example, if the attribute information of the target pixel point before color inversion is Q1 and the attribute information of the target pixel point after color inversion is Q2, the attribute information of the target pixel point can be adjusted from Q1 to Q2.
[0111] In the image processing method provided by the embodiment of the present application, the attribute information of each target pixel point after color inversion can be determined by the display processor according to the attribute information of each target pixel point before color inversion and the target mapping relationship, and the attribute information of the corresponding target pixel point can be adjusted according to the attribute information of each target pixel point after color inversion. The attribute information of the target pixel point after color inversion can be more accurately and quickly determined through the pre-set target mapping relationship, so that the adjustment of the attribute information of the target pixel point can be more quickly and accurately realized.
[0112] In order to more clearly explain the above target mapping relationship, the target mapping relationship representing the corresponding relationship between attribute information intervals is taken as an example to explain the target mapping relationship.
[0113] Figure 7 For the schematic diagram of the target mapping relationship provided in the embodiment of the present application, please refer to Figure 7 The target mapping relationship includes a corresponding relationship between an initial attribute information interval and a target attribute information interval.
[0114] The initial attribute interval in the target mapping relationship can be divided into interval 1-interval 4, and the target attribute interval can be divided into interval a-interval d.
[0115] In an embodiment, each sub-interval in the initial attribute interval can have a corresponding sub-interval in the target attribute interval.
[0116] The interval corresponding to interval 1 shown in the example, interval 2 can be corresponding to interval d, interval 3 can be corresponding to interval a, interval 4 can be corresponding to interval b. Figure 7 If the attribute information of the target pixel point before color inversion falls in interval 1, it can be determined that the attribute information of the target pixel point after color inversion falls in interval c; correspondingly, if the attribute information of the target pixel point before color inversion falls in interval 2, it can be determined that the attribute information of the target pixel point after color inversion falls in interval d; correspondingly, if the attribute information of the target pixel point before color inversion falls in interval 3, it can be determined that the attribute information of the target pixel point after color inversion falls in interval a; correspondingly, if the attribute information of the target pixel point before color inversion falls in interval 4, it can be determined that the attribute information of the target pixel point after color inversion falls in interval b.
[0117] In an embodiment, according to the attribute information of each target pixel point before color inversion and the target mapping relationship, the attribute information of each target pixel point after color inversion is determined, comprising: according to the initial attribute information interval to which the attribute information of each target pixel point before color inversion belongs and the target mapping relationship, the target attribute information interval of each target pixel point after color inversion is determined; according to the target attribute information interval of each target pixel point after color inversion, the attribute information of each target pixel point after color inversion is determined.
[0118] It should be noted that after obtaining the attribute information of each target pixel point before color inversion, the initial attribute information interval to which the attribute information belongs can be determined, that is, one of the above intervals 1-interval 4, and then the target attribute information interval corresponding to the initial attribute information interval can be determined according to the above target mapping relationship.
[0119] Optionally, after determining the target attribute information interval of each pixel point after color inversion, that is, determining one of the above intervals a-interval d, the attribute information of each target pixel point after color inversion can be determined from the corresponding target attribute information interval.
[0120] In an embodiment, the attribute information of each target pixel point after color inversion is located in the target attribute information interval of the corresponding target pixel point after color inversion.
[0121] In an embodiment, the attribute information of each target pixel point after color inversion is located in the target attribute information interval of the corresponding target pixel point after color inversion.
[0122] It should be noted that the mapping relationship between the initial attribute information interval and the target attribute information interval can be a wide mapping manner, which can avoid the attribute information of adjacent pixel points being too fragmented after mapping.
[0123] In the image processing method provided by the embodiments of the present application, the target attribute information interval of each target pixel point after color inversion can be determined according to the initial attribute information interval to which the attribute information of each target pixel point before color inversion belongs and the target mapping relationship; and the attribute information of each target pixel point after color inversion can be determined according to the target attribute information interval of each target pixel point after color inversion. The target attribute information interval of each target pixel point after color inversion can be quickly and accurately determined through the target mapping relationship and the initial attribute information interval to which the attribute information of each target pixel point before color inversion belongs, and then the attribute information of each target pixel point after color inversion can be determined in the target attribute information interval.
[0124] The following explains the multiple feasible implementation manners of determining the attribute information of each target pixel point after color inversion from the target attribute information interval provided in the embodiments of the present application.
[0125] Figure 8 For the relationship diagram provided in the embodiments of the present application for determining the attribute information after color inversion based on the target mapping relationship, please refer to the process of determining the attribute information of the target pixel point after color inversion shown in Figure 8 , Figure 8
[0126] In one embodiment, the attribute information of each target pixel point after color inversion is determined according to the target attribute information interval of each target pixel point after color inversion, including: for each target pixel point, determining any attribute information in the target attribute information interval of the corresponding target pixel point after color inversion as the attribute information of the corresponding target pixel point after color inversion.
[0127] It should be noted that any attribute information in the target attribute information interval can be used as the attribute information of the target pixel point after color inversion.
[0128] For example, the target attribute information interval of the target pixel point is interval c, and the attribute information interval corresponding to interval c is specifically 0.5-0.75. Any attribute information between 0.5-0.75 can be used as the attribute information of the target pixel point after color inversion, for example, 0.6.
[0129] It should be noted that the attribute information can be a luminance value or a gray value, or other information for representing color. Any one of the luminance value or the gray value can be used to represent the color of the target pixel point. For example, if the luminance value is used, the luminance value can be adjusted to 0.6, and if the gray value is used, the gray value can be adjusted to 0.6. The specific adjustment is not limited herein.
[0130] Figure 9 Another relationship diagram for determining the attribute information after color inversion based on the target mapping relationship provided in the embodiments of the present application is shown in Figure 9 , Figure 9 The process of determining the attribute information of the target pixel point after color inversion is shown in another embodiment.
[0131] In one embodiment, the attribute information of each target pixel point after color inversion is determined according to the target attribute information interval of each target pixel point after color inversion, comprising:
[0132] For each target pixel point, the attribute information of the adjacent pixel point corresponding to the target pixel point is obtained, and the attribute information of the target pixel point after color inversion is determined according to the attribute information of the adjacent pixel point and the target attribute information interval of the target pixel point after color inversion. The difference between the attribute information of the target pixel point after color inversion and the attribute information of the adjacent pixel point is less than or equal to a threshold value.
[0133] Optionally, the adjacent pixel point of the target pixel point can be any one of the left, right, top or bottom pixel point of the pixel point, and the specific limitation is not made herein.
[0134] The adjacent pixel point can also be one of the target pixel points, and the adjacent pixel point can be a target pixel point that has completed color inversion.
[0135] It should be noted that the attribute information of the adjacent pixel point can be obtained, and the difference between the attribute information of the adjacent pixel point and the attribute information of the target pixel point can be determined, and then the difference between the attribute information of the target pixel point after color inversion and the attribute information of the adjacent pixel point can be determined.
[0136] For example, the target attribute information interval of the target pixel point is interval c, and the attribute information interval corresponding to the interval c can be 0.5-0.75. The attribute information of the adjacent pixel point can be 0.7, and the threshold value can be 0.05. Any one of the attribute information between 0.65-0.75 can be used as the attribute information of the target pixel point after color inversion, for example, 0.75.
[0137] The threshold value can be determined based on the difference between the attribute information of the target pixel point before color inversion and the attribute information of the adjacent pixel point, for example, the attribute information of the target pixel point before color inversion is 0.12, and the attribute information of the adjacent pixel point is 0.17, and the difference between the two attribute information, 0.05, can be used as the threshold value.
[0138] Figure 10 For another relationship diagram provided in the embodiments of the present application for determining the attribute information after color inversion based on the target mapping relationship, please refer to Figure 10 , Figure 10 The process of determining the attribute information of the target pixel point after color inversion is shown in another embodiment.
[0139] In an embodiment, the attribute information of each target pixel point after color inversion is determined according to the target attribute information interval of each target pixel point after color inversion, comprising:
[0140] For each target pixel point, the attribute information of the corresponding target pixel point after color inversion is determined according to the difference between the attribute information of the target pixel point and the preset attribute information in the initial attribute information interval, and the preset attribute information in the target attribute information interval of the corresponding target pixel point after color inversion. The preset attribute information is the attribute information of the end point or the attribute information of the middle point in the attribute information interval.
[0141] Optionally, the attribute information of the end point can be the attribute information of the two end points of the attribute information interval, and the attribute information of the middle point can be the attribute information of the middle point of the attribute information interval.
[0142] For example, for the interval of 0.5-0.75, the attribute information of the end point can be 0.5 and 0.75, and the attribute information of the middle point can be 0.625.
[0143] It should be noted that the preset attribute information can be obtained in advance, for example, for the interval of 0.5-0.75, if the attribute information of the middle point is used as the preset attribute information, it can be 0.625. The attribute information of the corresponding target pixel point after color inversion can be determined according to the difference between the attribute information of the target pixel point and the preset attribute information in the initial attribute information interval, and the preset attribute information in the target attribute information interval of the corresponding target pixel point after color inversion.
[0144] For example, the target attribute information interval corresponding to the target pixel point is interval c, the attribute information interval corresponding to the interval c can be 0.5-0.75, the preset attribute information in the initial attribute information interval can be 0.125, the attribute information of the target pixel point before color inversion can be 0.1, the difference between the attribute information of the target pixel point and the preset attribute information in the initial attribute information interval can be 0.025, and if the preset attribute information in the target attribute information interval is 0.625, the attribute information of the target pixel point after color inversion can be 0.65.
[0145] In the image processing method provided by the embodiments of the present application, the attribute information of the target pixel point after color inversion can be determined in the above three different ways. The attribute information of the target pixel point after color inversion can be determined by the wide mapping of the initial attribute information interval and the target attribute information interval, which is more reasonable, and the wide mapping can also avoid the fragmentation of the attribute information, thereby ensuring the reasonableness of the attribute information after color inversion.
[0146] The following explains another possible hardware structure of the display processor provided by the embodiments of the present application.
[0147] Figure 11 For the structure diagram of the display processor provided by the embodiments of the present application, please refer to Figure 11 The display processor includes a plurality of input ends, and each input end is provided with an identification module 1100.
[0148] It should be noted that for the display processor, the identification module 1100 can be arranged at each input end, and each identification module 1100 can identify the layer type of the input layer.
[0149] In an embodiment, the plurality of layers of the initial image are obtained by the plurality of input ends, wherein the identification module of each input end is used to determine the layer type of the input layer, and the layer type includes an identification layer type or a background layer type.
[0150] Optionally, in the process of obtaining the plurality of layers of the initial image, the identification module can be used to identify the layer type of each input layer, so as to determine whether the layer is an identification layer type or a background layer type, thereby determining whether the layer is an identification layer or a background layer.
[0151] For the background layer, the layer can be superimposed with other background layers according to the corresponding superimposition order to obtain a superimposed background layer, and for the identification layer, the superimposed background layer can be subjected to color inversion processing after the superimposed background layer is obtained.
[0152] In the image processing method provided in the embodiments of the present application, the initial image of the plurality of layers can be acquired through a plurality of input ends, wherein the identification module of each input end is configured to determine the layer type of the input layer, and the layer type includes an identification layer type or a background layer type. The identification module can accurately identify the layer type of each layer, and then the processing steps of each layer can be determined based on the layer type, so as to realize the superimposition processing and color inversion processing of the plurality of layers.
[0153] The following explains a feasible superimposition result after the anti-color superimposition processing provided in the embodiments of the present application.
[0154] Figure 12 For the interface diagram after the anti-color superimposition processing provided in the embodiments of the present application, please refer to Figure 12 , Figure 12 The following explains a feasible superimposition result after the anti-color superimposition processing provided in the embodiments of the present application. Figure 12
[0155] Among them, Figure 12 The whole is a white interface, and the lower right corner is a black interface. The circular structure in the image can be a collection of a plurality of target pixel points subjected to the anti-color processing. For the region with a white background, the color of the target pixel point after the anti-color processing is black. For the region with a black background, the color of the target pixel point after the anti-color processing is white.
[0156] It should be noted that in the related art, in the anti-color process, the plurality of layers need to be determined by the graphics processor whether they need to be subjected to the anti-color processing, and then the layers subjected to the anti-color processing can be subjected to the rendering processing by the graphics processor, and then the anti-color result can be obtained after the layer superimposition. In the image processing method provided in the embodiments of the present application, the background layer can be superimposed by the display processor, and then the pixel points subjected to the anti-color processing can be determined based on the identification layer, and then the corresponding pixel points in the superimposed background layer can be subjected to the anti-color processing, thereby saving the power consumption of the work performed by the graphics processor. Moreover, since the display processor itself is a hardware structure processor, it does not need too many computing resources in the processing process, and therefore the power consumption can also be saved.
[0157] It should be understood that although each step in the above flowcharts is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise explicitly stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the above flowcharts can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0158] Based on the foregoing embodiments, the embodiments of the present application provide an image processing apparatus, which comprises the modules included therein and the units included in the modules, and can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0159] Figure 13 For the structural schematic diagram of the image processing apparatus provided in the embodiments of the present application, please refer to Figure 13 An image processing apparatus applied to a terminal device, the terminal device comprising a display processor and a display screen, the output end of the display processor being connected with the display screen, the apparatus comprising: an acquisition module 1310 and a processing module 1320.
[0160] The acquisition module 1310 is configured to acquire a plurality of layers of an initial image in response to a trigger operation of displaying the initial image, the plurality of layers comprising an identification layer and a plurality of background layers, the identification layer being used for identifying target pixel points in the initial image that need to be inverted in color.
[0161] The processing module 1320 is configured to perform color inversion processing on the target pixel points based on the identification layer and the plurality of background layers by the display processor, and display a target image on the display screen, the target image being an image obtained by performing color inversion processing on the target pixel points in the initial image.
[0162] In an embodiment, the processing module 1320 is specifically configured to perform superposition processing on the plurality of background layers by the display processor to obtain superimposed background layers; determine the target pixel points from the superimposed background layers according to the marked pixel points in the identification layer, and perform color inversion processing on the target pixel points, each marked pixel point in the identification layer corresponding to a target pixel point in the superimposed background layers.
[0163] In an embodiment, the identification layer includes at least one mark pixel point, each mark pixel point corresponds to an identification information, and each identification information is used to instruct color inversion of a target pixel point corresponding to the mark pixel point; the processing module 1320 is specifically configured to determine, by the display processor, a pixel point corresponding to each identification information from the superimposed background layer, and the pixel point corresponding to each identification information is the target pixel point.
[0164] In an embodiment, the processing module 1320 is specifically configured to determine, by the display processor, attribute information of each target pixel point after color inversion according to attribute information of each target pixel point before color inversion and a target mapping relationship, the target mapping relationship is used to represent a corresponding relationship between attribute information before color inversion and attribute information after color inversion of a pixel point, and the attribute information includes at least one of color, brightness, and grayscale; and adjust attribute information of the corresponding target pixel point according to the attribute information of each target pixel point after color inversion.
[0165] In an embodiment, the target mapping relationship includes a corresponding relationship between an initial attribute information interval and a target attribute information interval; the processing module 1320 is specifically configured to determine a target attribute information interval of each target pixel point after color inversion according to an initial attribute information interval to which attribute information of each target pixel point before color inversion belongs and the target mapping relationship; and determine attribute information of each target pixel point after color inversion according to the target attribute information interval of each target pixel point after color inversion, and the attribute information of each target pixel point after color inversion is located in the target attribute information interval of the corresponding target pixel point after color inversion.
[0166] In an embodiment, the processing module 1320 is specifically configured to, for each target pixel point, determine any attribute information in the target attribute information interval of the corresponding target pixel point after color inversion as attribute information of the corresponding target pixel point after color inversion.
[0167] In an embodiment, the processing module 1320 is specifically configured to, for each target pixel point, obtain attribute information of a neighboring pixel point of the corresponding target pixel point, and determine attribute information of the corresponding target pixel point after color inversion according to the attribute information of the neighboring pixel point and the target attribute information interval of the corresponding target pixel point after color inversion, and a difference between the attribute information of the corresponding target pixel point after color inversion and the attribute information of the neighboring pixel point is less than or equal to a threshold value.
[0168] In one embodiment, the processing module 1320 is specifically used to determine the attribute information of the target pixel after color inversion for each target pixel based on the difference between the attribute information of the target pixel and the preset attribute information in the initial attribute information interval, and the preset attribute information in the target attribute information interval after color inversion of the target pixel. The preset attribute information is the attribute information of the endpoints or the attribute information of the midpoint in the initial attribute information interval.
[0169] In one embodiment, the display processor includes multiple input terminals, each input terminal being provided with a recognition module; and an acquisition module, specifically used to acquire multiple layers of an initial image through the multiple input terminals, wherein the recognition module of each input terminal is used to determine the layer type of the input layer, and the layer type includes: an identifier layer type or a background layer type.
[0170] In the image processing apparatus provided in this application embodiment, in response to a trigger operation to display an initial image, multiple layers of the initial image are acquired. These multiple layers include an identifier layer and multiple background layers. The identifier layer is used to identify target pixels in the initial image that need to be inverted. A display processor performs color inversion processing on the target pixels based on the identifier layer and the multiple background layers, and displays the target image on a display screen. The target image is the image after color inversion processing of the target pixels. The identifier layer can determine the positions where color inversion is needed. Furthermore, since the display processor is a hardware-based processor, it does not require significant software resource consumption during color inversion processing. Therefore, color inversion processing implemented based on the display processor can reduce the power consumption of the terminal device. Moreover, by inverting the background layers, color differentiation can be achieved during layer overlay, making the overlaid display content clearly visible.
[0171] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0172] It should be noted that, in the embodiments of this application... Figure 13 The module division of the image processing apparatus shown is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical units, or be integrated into one unit with two or more units. The integrated units described above can be implemented in hardware, as software functional units, or in a combination of software and hardware.
[0173] It should be noted that, in the embodiments of the present application, if the above-mentioned method is implemented in the form of a software function module and is sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various program codes that can be stored in the medium. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0174] Figure 14 For the structural schematic diagram of the computer device provided in the embodiments of the present application, please refer to Figure 14 The embodiments of the present application provide a computer device, which can be the terminal device described above, and the internal structure diagram thereof can be as shown in Figure 14 The computer device includes a processor 1420, a memory and a network interface 1440 connected through a system bus 1410. The processor 1420 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium 1431 and an internal memory 1432. The non-volatile storage medium 1431 stores an operating system, a computer program and a database. The internal memory 1432 provides an environment for the running of the operating system and the computer program in the non-volatile storage medium 1431. The database of the computer device is used to store data. The network interface 1440 of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor 1420 to implement the above-mentioned method.
[0175] In the computer device provided in the embodiments of the present application, in the process of executing a corresponding program, a plurality of layers of an initial image can be acquired in response to a trigger operation of displaying the initial image, the plurality of layers including an identification layer and a plurality of background layers, the identification layer being used to identify target pixel points in the initial image that need to be reversed in color; the target pixel points are subjected to color inversion processing based on the identification layer and the plurality of background layers by a display processor, and a target image is displayed on a display screen, the target image being an image after the target pixel points are subjected to color inversion processing. The position that needs to be subjected to color inversion can be determined by the identification layer. In addition, the display processor is a hardware processor, and in the process of performing color reversal processing, a large amount of software resources need not be consumed, so that the color inversion processing based on the display processor can also reduce the power consumption of the terminal device, and the color reversal processing on the background layers can also distinguish colors in the process of layer superposition, so that the superimposed display content is clear and visible.
[0176] The embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps in the method provided in the above embodiments.
[0177] The embodiments of the present application provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform the steps in the method provided in the above method embodiments.
[0178] Those skilled in the art can understand that, Figure 14 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0179] In one embodiment, the image processing apparatus provided by the present application can be implemented in the form of a computer program, which can run on a computer device as shown in Figure 14 The memory of the computer device can store various program modules constituting the above apparatus. The computer program constituted by the various program modules causes the processor to execute the steps in the method of each embodiment of the present application described in the specification.
[0180] It should be noted that: the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For technical details not disclosed in the storage medium, storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0181] It should be understood that the term "one embodiment" or "an embodiment" or "some embodiments" as used herein means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrase "in one embodiment" or "in an embodiment" or "in some embodiments" in various places throughout the specification are not necessarily referring to the same embodiment. Further, the particular features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that the sequence of steps in the above-described processes is not meant to be limiting, and that the steps can be executed in any suitable order, as determined by the function and logic of the steps, and that the execution of the steps should not limit the implementation of the embodiments of the application. The sequence of the above-described embodiments of the application is merely for description, and does not represent the advantages or disadvantages of the embodiments. The above description of the various embodiments tends to emphasize differences between the various embodiments, and the same or similar parts can be mutually referred to, and are not described again for the sake of brevity.
[0182] The term "and / or", as used herein, merely describes association between associated objects, and can represent three conditions: A and / or B; both A and B exist together, A exists alone, and B exists alone.
[0183] It should be noted that the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0184] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The above-described embodiments are merely illustrative. For example, the division of the modules is merely a logical function division, and actual implementation can have another division manner. For example, multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0185] The modules described above as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; they can be located in one place or distributed on multiple network units; and some or all of the modules can be selected as needed to achieve the purposes of the embodiments.
[0186] In addition, the functional modules in the embodiments of the present application can be integrated in one processing unit, or each module can be a separate unit, or two or more modules can be integrated in one unit; the integrated modules can be realized in the form of hardware or in the form of hardware plus software functional units.
[0187] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program is executed to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes mobile storage devices, read only memory (ROM), magnetic discs or optical discs and various storage medium that can store program codes.
[0188] Alternatively, the integrated units of the present application, if implemented in the form of software functional modules and sold or used as independent products, can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a number of instructions to make an electronic device execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes mobile storage devices, ROM, magnetic discs or optical discs and various storage medium that can store program codes.
[0189] The methods disclosed in the several method embodiments of the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0190] The features disclosed in the several product embodiments of the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0191] The features disclosed in the several method or device embodiments of the present application can be combined arbitrarily without conflict to obtain new method or device embodiments.
[0192] The above merely provides the implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the change or replacement within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An image processing method, characterized by, The application is applied to a terminal device, the terminal device comprising a display processor and a display screen, an output of the display processor being connected with the display screen, and the method comprising: In response to a trigger operation of displaying an initial image, a plurality of layers of the initial image are acquired, the plurality of layers comprising an identification layer and a plurality of background layers, the identification layer being used for identifying target pixel points in the initial image that need to be reversed in color; Color reversal processing is performed on the target pixel points by the display processor based on the identification layer and the plurality of background layers, and a target image is displayed by the display screen, the target image being an image in which the target pixel points in the initial image have been subjected to color reversal processing.
2. The method of claim 1, wherein, The color reversal processing performed on the target pixel points by the display processor based on the identification layer and the plurality of background layers comprises: The plurality of background layers are subjected to superposition processing by the display processor to obtain superimposed background layers; The target pixel points are determined from the superimposed background layers by the display processor according to marked pixel points in the identification layer, and color reversal processing is performed on the target pixel points, each marked pixel point in the identification layer corresponding to a target pixel point in the superimposed background layers.
3. The method of claim 2, wherein, The identification layer comprises at least one marked pixel point, each marked pixel point corresponding to an identification information, and each identification information being used for indicating color reversal of a target pixel point corresponding to the marked pixel point; The target pixel points are determined from the superimposed background layers by the display processor according to marked pixel points in the identification layer, and color reversal processing is performed on the target pixel points, each marked pixel point in the identification layer corresponding to a target pixel point in the superimposed background layers. The color reversal processing performed on the target pixel points comprises:
4. The method of claim 2, wherein, The display processor determines attribute information of each target pixel point after color reversal according to attribute information of each target pixel point before color reversal and a target mapping relationship, the target mapping relationship being used for representing a corresponding relationship between attribute information before color reversal and attribute information after color reversal of a pixel point, the attribute information comprising at least one of color, brightness and grayscale; Attribute information of a corresponding target pixel point is adjusted according to the attribute information of each target pixel point after color reversal. The target mapping relationship comprises a corresponding relationship between an initial attribute information interval and a target attribute information interval; 5. The method of claim 4, wherein, The determination of the attribute information of each target pixel point after color reversal according to the attribute information of each target pixel point before color reversal and the target mapping relationship comprises: A target attribute information interval of each target pixel point after color reversal is determined according to an initial attribute information interval to which the attribute information of each target pixel point before color reversal belongs and the target mapping relationship; and According to the target attribute information interval of each target pixel point after color inversion, attribute information of each target pixel point after color inversion is determined, and the attribute information of each target pixel point after color inversion is located in the target attribute information interval of the corresponding target pixel point after color inversion.
6. The method of claim 5, wherein, The determining of the attribute information of each target pixel point after color inversion according to the target attribute information interval of each target pixel point after color inversion comprises: For each target pixel point, any attribute information in the target attribute information interval of the corresponding target pixel point after color inversion is determined as the attribute information of the corresponding target pixel point after color inversion.
7. The method of claim 5, wherein, The determining of the attribute information of each target pixel point after color inversion according to the target attribute information interval of each target pixel point after color inversion comprises: For each target pixel point, attribute information of a neighboring pixel point of the corresponding target pixel point is obtained, and the attribute information of the corresponding target pixel point after color inversion is determined according to the attribute information of the neighboring pixel point and the target attribute information interval of the corresponding target pixel point after color inversion, and a difference between the attribute information of the corresponding target pixel point after color inversion and the attribute information of the neighboring pixel point is less than or equal to a threshold value.
8. The method of claim 5, wherein, The determining of the attribute information of each target pixel point after color inversion according to the target attribute information interval of each target pixel point after color inversion comprises: For each target pixel point, the attribute information of the corresponding target pixel point after color inversion is determined according to a difference between the attribute information of the target pixel point and preset attribute information in the initial attribute information interval and the preset attribute information in the target attribute information interval of the corresponding target pixel point after color inversion, and the preset attribute information is attribute information of an endpoint or attribute information of a midpoint in the attribute information interval.
9. The method of claim 1, wherein, The display processor comprises a plurality of inputs, and each input is provided with an identification module; The obtaining of the plurality of layers of the initial image comprises: The plurality of layers of the initial image are obtained through the plurality of inputs, and the identification module of each input is configured to determine a layer type of an input layer, and the layer type comprises an identification layer type or a background layer type.
10. An image processing apparatus characterized by comprising: The terminal device comprises a display processor and a display screen, the output of the display processor is connected with the display screen, and the device comprises an acquisition module and a processing module. The acquisition module is configured to, in response to a trigger operation of displaying an initial image, acquire a plurality of layers of the initial image, and the plurality of layers comprise an identification layer and a plurality of background layers, and the identification layer is configured to identify target pixel points in the initial image that need to be color-inverted. The processing module is configured to, by the display processor, perform color inversion processing on the target pixel points based on the identification layer and the plurality of background layers, and display a target image on the display screen, and the target image is an image obtained by performing color inversion processing on the target pixel points in the initial image. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the computer device is characterized in that, The processor, when executing the program, implements the steps of the method of any one of claims 1 to 9.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1 to 9.