A rendering method, apparatus, electronic device and medium
By defining the colors of multiple designated areas in the human-computer interface and overlaying them onto the target color at the target location, the problem of inconsistent rendering results was solved, improving the rendering effect and the user's visual experience.
Patent Information
- Application Number
- CN202111101358.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2041-09-18
AI Technical Summary
Existing technologies, when improving the ambiance of human-computer interfaces, suffer from problems such as discordant rendering results due to incorrect primary color selection.
By determining the colors of multiple defined areas on the target object, a target color is determined based on these colors and superimposed onto the target location to achieve rendering.
It enhances the rendering effect, improves the user's visual experience, and achieves a harmonious transition between the target object and the background.
Smart Images

Figure CN115841528B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to a rendering method, apparatus, electronic device, and medium. Background Technology
[0002] Human-computer interaction (HCI), or human-computer interaction, is a discipline that studies the interactive relationship between a system and its users. Humans and computers can interact through a human-computer interface (HCI). The HCI, also known as a user interface or human-computer interface, is the medium and dialogue interface for transmitting and exchanging information between humans and computers, and is an important component of a computer system. It serves as the medium for interaction and information exchange between the system and the user, realizing the conversion between the internal form of information and a form that humans can understand. HCIs exist in all fields involving human-computer information exchange.
[0003] To enhance the human-computer interaction experience visually, the atmosphere of the displayed objects (such as images, software, and videos) within the interface can be improved. Currently, one method to enhance atmosphere is to select the color with the largest area of the object as the primary color and then extend that primary color to the background. However, this approach has a technical problem: if the primary color is selected incorrectly, the rendering result will be disharmonious. Summary of the Invention
[0004] This disclosure provides a rendering method, apparatus, electronic device, and medium that enhance rendering effects and improve the user's visual experience.
[0005] In a first aspect, embodiments of this disclosure provide a rendering method, including:
[0006] Determine the color of a set area on the target object, wherein the set area is at least a set number, and the set number is greater than 1;
[0007] Based on the color of each defined region, determine the target color to be superimposed on the target position;
[0008] The target color is overlaid at the target location to achieve rendering.
[0009] Secondly, embodiments of this disclosure also provide a rendering apparatus, including:
[0010] A determining module is used to determine the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1;
[0011] The target color determination module is used to determine the target color to be superimposed on the target position based on the color of each of the defined regions;
[0012] The target color overlay module is used to overlay the target color at the target location to achieve rendering.
[0013] Thirdly, embodiments of this disclosure also provide an electronic device, including:
[0014] One or more processing devices;
[0015] Storage device for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the rendering method provided in any embodiment of this disclosure.
[0017] Fourthly, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the rendering method provided in any embodiment of this disclosure.
[0018] This disclosure provides a rendering method, apparatus, electronic device, and medium. The method determines the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1; based on the color of each set area, a target color is determined to be superimposed on a target position; and the target color is superimposed at the target position to achieve rendering. Using this technical solution, the colors of multiple set areas of the target object are used to determine the target color superimposed on the target position to achieve rendering, enhancing the rendering effect and improving the user's visual experience. Attached Figure Description
[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 This is a flowchart illustrating a rendering method provided in Embodiment 1 of this disclosure;
[0021] Figure 1a This is a schematic diagram of an image display interface provided in Embodiment 1 of this disclosure;
[0022] Figure 1b This is a schematic diagram of another image display interface provided in Embodiment 1 of this disclosure;
[0023] Figure 2 This is a flowchart illustrating a rendering method provided in Embodiment 2 of this disclosure;
[0024] Figure 2a This is a schematic diagram illustrating the determination of a defined area of the image according to Embodiment 2 of this disclosure;
[0025] Figure 2bThis is a schematic diagram of a process for obtaining a first color, provided in Embodiment 2 of this disclosure;
[0026] Figure 2c This is a schematic diagram illustrating the determination of the target color superimposed on the target position according to Embodiment 2 of this disclosure;
[0027] Figure 2d This is a schematic diagram illustrating how a target color is superimposed onto a background, as provided in Embodiment 2 of this disclosure.
[0028] Figure 3 This is a schematic diagram of the structure of a rendering apparatus provided in Embodiment 3 of this disclosure;
[0029] Figure 4 This is a schematic diagram of the structure of a rendering device provided in Embodiment 4 of this disclosure. Detailed Implementation
[0030] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0031] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0032] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0034] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0035] The names of messages or information rendered between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0036] In the following embodiments, each embodiment provides optional features and examples. The various features described in the embodiments can be combined to form multiple optional solutions. Each numbered embodiment should not be regarded as only one technical solution. Furthermore, unless otherwise specified, the embodiments and features in the embodiments of this disclosure can be combined with each other.
[0037] Example 1
[0038] Figure 1 This is a flowchart illustrating a rendering method provided in Embodiment 1 of this disclosure. This method is applicable to situations where the atmosphere of a target object is enhanced. The method can be executed by a rendering device, which can be implemented by software and / or hardware and is generally integrated into an electronic device. In this embodiment, the electronic device includes, but is not limited to, devices such as mobile phones, personal digital assistants, and computers.
[0039] like Figure 1 As shown in Embodiment 1 of this disclosure, a rendering method includes the following steps:
[0040] S110. Determine the color of a set area on the target object, wherein the set area is at least a set number and the set number is greater than 1.
[0041] The target object can be considered any object displayed within the human-computer interface; there is no limitation on the target object here. Any target object that can create a sense of atmosphere is acceptable. For example, the target object can be an image, video, or software.
[0042] For example, this embodiment can extract the color of the target object and render it onto the background where the target object is located to enhance the atmosphere of the target object. It can also extract the color of the target object and render it onto the layer below the text area of the target object to improve the readability of the text.
[0043] The defined region can be understood as the area formed by defined pixels on the target object. The number of defined regions is at least a set number, which is greater than 1. The set number can be pre-configured by the user or automatically set by the system. The set number can be 4, 5, 6, etc.
[0044] For example, the selection of each set area can be taken from the area around the image (such as the edge), such as the endpoints around the target object or the midpoint of the edge.
[0045] This embodiment does not limit the set area; different rendering positions and different target object sizes can correspond to different set areas.
[0046] For example, when rendering the background of a target object, each defined region may include a number of pixels defined on the edge of the target object. Taking an image as an example, the defined region may include pixels at the four vertices of the image; the defined region may also be a square area at the four corners of the image, and each defined region may include multiple pixels; in addition, the defined region may also include one or more pixels at the midpoint of the long side of the image.
[0047] For example, when rendering a target object to improve the readability of text on it, the method for selecting the set area can be the same as the method used when rendering the background. Alternatively, the set area can be selected at the junction of text and image; the specific location of the set area is not limited here. The determination of text on the image is not limited here; it can be determined by performing semantic analysis on the text on the image to identify the text for which atmosphere adjustment is needed.
[0048] This step can determine the color of a specified area based on the number of pixels it contains. If the specified area contains only one pixel, the color of that pixel can be used as the color of the specified area. If the specified area contains multiple pixels, the color of each pixel can be analyzed and processed to determine the color of the specified area. There are no restrictions on how the color of the specified area is determined based on the colors of multiple pixels; for example, the dominant color among the colors can be selected as the color of the specified area, any color can be selected, or the color corresponding to the average of the RGB values of each color can be used as the color of the specified area.
[0049] The designated area for different targets can be located in different positions. In this embodiment, the designated area can be determined based on the size of the target, and then the color of the designated area can be determined.
[0050] The method of determining the size is not limited here. After determining the size, the desired selection area can be determined on the image based on the size. For example, when determining the location of the selection area based on the size of the target object, more selection areas can be selected in the direction where the target object occupies a larger proportion. Taking an image as the target object, the number of selection areas selected on the longer side of the image can be greater than the number of selection areas selected on the shorter side of the image.
[0051] S120. Determine the target color to be superimposed on the target position based on the color of each of the defined areas.
[0052] In this embodiment, the target location can be determined based on the content to be rendered, and there is no limitation on the target location. For example, if the background of the target object needs to be rendered, the target location can be the layer between the layer where the target object is located and the layer where the background of the target object is located. If the target object needs to be rendered, the target location can be the layer between the layer where the target object is located and the layer where the text on the image is located.
[0053] Taking an image as the target object, the target location can be considered as an additional layer added between the layer where the image is located and the layer where the background of the image is located. Alternatively, the target location can also be considered as an additional layer added between the layer where the image is located and the layer where the text on the image is located. The number of layers added can be one or two, and this embodiment of the invention does not limit this.
[0054] In one embodiment, the target object is an image, and the target location includes: a layer added between the layer where the image is located and the layer where the background of the image is located, and the defined area is the area on the image within the background; or, the target location is a layer added between the layer where the image is located and the layer where the text on the image is located. It should be noted that the image can be wholly or partially within the background. For example, a pop-up window or panel may be displayed in the background, with part of the image displayed within the background and part displayed within the panel. Figure 1a This is a schematic diagram of an image display interface provided in Embodiment 1 of this disclosure. See also... Figure 1a Image 1 is displayed entirely within background 2. Figure 1b See also the schematic diagram of another image display interface provided in Embodiment 1 of this disclosure. Figure 1b Image 3 is partially displayed within background 4 and partially within panel 5.
[0055] When all images are displayed within the background, the images within the background can be considered as the entire image.
[0056] When an image is partially displayed within a background, the image within the background can be considered as an image that is only displayed within the background and not on other controls, panels, or pop-ups on the background. Figure 1b The shaded area in image 3.
[0057] Specifically, determining the target color to be superimposed on the target position based on the color of each set area may include: superimposing the color of the set area onto white with a set opacity, then adjusting the saturation and brightness of the superimposed color in HSB mode to obtain the adjusted color, and finally using the adjusted color as the target color.
[0058] For example, as one implementation, determining the target color to be superimposed on the target position based on the color of each of the defined regions can be as follows: superimposing the colors of each of the defined regions on white with a first opacity to obtain a first color; adjusting the saturation of the first color to a saturation threshold range and the brightness to a brightness threshold range to obtain a first target color, wherein the target color includes the first target color.
[0059] The value of the first opacity is not limited. For example, the first opacity can be 20% or 30%. The first color can refer to the color obtained by superimposing the colors of each set area on white with the first opacity. The first target color can refer to the color obtained by adjusting the saturation of the first color to a set saturation threshold range and adjusting the brightness to a set brightness threshold range. The saturation threshold range can be considered as the critical value of saturation, and the brightness threshold range can be considered as the critical value of brightness. They can be pre-configured by relevant personnel or automatically set by the system. In this embodiment, the saturation threshold range and the brightness threshold range are not limited. Optionally, the saturation threshold range can be (20 ≤ 60 ≤ saturation threshold range). The brightness threshold range can be the saturation threshold range (30 ≤ 60 ≤ brightness threshold range).
[0060] As another implementation, determining the target color to be superimposed on the target position based on the color of each of the defined regions can also include, in addition to the first implementation, the following:
[0061] The colors of each of the defined regions are superimposed on white with a second opacity to obtain a second color; the saturation of the second color is adjusted to the saturation threshold range, and the brightness is adjusted to the brightness threshold range to obtain a second target color, wherein the target color includes the first target color and the second target color.
[0062] Wherein, the second opacity is greater than the first opacity, and the difference between the second opacity and the first opacity is a set value, and the second opacity is less than or equal to the first value, the first opacity is greater than or equal to the second value, and the first value is greater than the second value.
[0063] In this embodiment, the values of the first opacity and the second opacity are not limited. The second opacity can be 30%, the first opacity can be 20%, the first value can be 60%, and the second value can be 10%. The set value can be 10%.
[0064] The second color refers to the color obtained by superimposing the colors of each of the defined regions on white with a second opacity. The second target color refers to the color obtained by adjusting the saturation of the second color to a set saturation threshold range and adjusting the brightness to a set brightness threshold range.
[0065] It should be noted that the first opacity and the second opacity, the first value and the second value, the first color and the second color, the first target color and the second target color are only used to distinguish different objects and are not intended to limit them in practice.
[0066] After determining the first target color and the second target color, the first target color and the second target color can be superimposed on different layers of the target location respectively.
[0067] S130, The target color is superimposed at the target location to achieve rendering.
[0068] The target color at the target location can be obtained through the above steps. In this embodiment, the target color is superimposed on the target location with different transparency to achieve rendering.
[0069] Specifically, the layer at the target location can be divided into different areas, and the target color can be overlaid on different areas with different transparency to achieve rendering.
[0070] Specifically, the layer representing the target location can be divided into region 1, region 2, and region 3. The target color can then be overlaid on regions 1, 2, and 3 respectively using opacity levels 1, 2, and 3 to achieve rendering. Opacity 1, 2, and 3 can represent different opacities. The opacity within a region can be unique or varied; for example, the opacity within a region can be variable, and the method of variation is not limited here.
[0071] For example, when the target location is a layer added between the layer where the image is located and the layer where the background of the image is located, the added layer can be two layers, and the target color includes a first target color and a second target color. First, each layer is divided into regions, including: a first region from the top of the background to the top of the image (e.g., region 1), a second region from the top of the image to the central axis of the image (e.g., region 2), and a third region from the central axis of the image to the bottom of the image (e.g., region 3).
[0072] Then, the target color is overlaid on different areas of each layer with varying transparency. The specific overlay steps are as follows:
[0073] In the two layers, the bottom layer overlays the second target color at a third opacity in the corresponding first and second areas; it also overlays the second target color in the corresponding third area. The opacity of the second target color within the corresponding third area gradually changes from a fourth opacity to the third opacity from the bottom of the image to the central axis of the image. The fourth opacity is less than the third opacity. Here, the third and fourth opacities are only used to distinguish different objects and are not practically limited. The gradient from the fourth opacity to the third opacity can start from the fourth opacity and gradually increase to the third opacity with a fixed opacity increment, or it can start from the fourth opacity and gradually increase to the third opacity with progressively increasing increments.
[0074] For example, if the fourth opacity is 0% and the third opacity is 75%, the opacity in the third area gradually increases from 0% to 75%. The increment is not limited here; it can be fixed, such as 1%, or it can be incremented sequentially, such as 1%, 2%, 3%, etc. The increment is not limited.
[0075] In the two-layer model, the top layer overlays a first target color with a gradient from fifth to sixth opacity from the top of the background to the top of the image in the corresponding first area. The fifth opacity is greater than the sixth opacity. The sixth opacity of the first target color is then overlaid in the corresponding second and third areas. The third and fourth opacities are only used to distinguish different objects and are not practically limited. The fifth opacity can be 75%, and the sixth opacity can be 0%, without limitation.
[0076] For example, when the target location is a layer added between the layer containing the image and the layer containing the text on the image, the added layer can be one layer. The target color includes a first target color. First, the layer is divided into regions, which can include: dividing it into a fifth region from the bottom to the top of the text (or from the top of the text to the bottom of the image) and a fourth region within the image excluding the fifth region; then, the target color is superimposed on the fourth region and the fifth region with different opacities. The specific superposition steps can be: superimposing the first target color at a seventh opacity on the fourth region, and superimposing the first target color on the fifth region, with the opacity of the first target color gradually changing from an eighth opacity to a ninth opacity from the bottom to the top of the text within the fifth region. Here, the eighth opacity is less than the ninth opacity; the seventh, eighth, and ninth opacities are only used to distinguish different objects and are not practically limited. The ninth opacity can be equal to the seventh opacity, the seventh opacity can be 75%, and the eighth opacity can be 0%.
[0077] It should be noted that the opacity setting of the target color in each area is not limited in this embodiment. It can be any value or a non-fixed value. For example, the opacity of an area is not fixed to a certain value. The opacity value can be gradually changed to make the final rendering have a soft light atmosphere.
[0078] This disclosure provides a rendering method according to Embodiment 1. The method includes: determining the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1; determining a target color to be superimposed on a target position based on the color of each set area; and superimposing the target color at the target position to achieve rendering. Using the above method, the colors of multiple set areas of the target object are determined to be superimposed on a target position to achieve rendering, thereby enhancing the rendering effect and improving the user's visual experience.
[0079] Example 2
[0080] Figure 2 This is a flowchart illustrating a rendering method according to Embodiment 2 of this disclosure. Embodiment 2 is a specific implementation based on the various optional solutions in the above embodiments. In this embodiment, determining the color of a set area on a target object is further specified as follows: determining the size of an image within the background; determining a set area of the image based on the size; and determining the color of the set area.
[0081] For details not covered in this embodiment, please refer to Embodiment 1.
[0082] like Figure 2 As shown, the rendering method provided in Embodiment 2 of this disclosure specifically includes the following steps: S210, determining the size of the image within the background.
[0083] Specifically, the size of the image within the background is determined for subsequent determination of the designated area of the image.
[0084] S220. Determine the designated area of the image based on the stated dimensions.
[0085] Based on the dimensions, the long side and short side can be obtained by comparing the lengths of the top edges of the image. A certain number of designated areas are selected on the long side and the short side respectively. The number of designated areas selected on the long side is greater than the number of designated areas selected on the short side, and the sum of the number of designated areas selected on the long side and the number of designated areas selected on the short side is at least equal to the designated number.
[0086] In one embodiment, determining a defined area of the image based on the size includes:
[0087] When the length of the first side of the image representing the size is greater than the length of the second side, a first number of defined regions are selected on the first side; a second number of defined regions are selected on the second side, wherein the first number is greater than the second number, and the sum of the first and second numbers is at least a set number. The set number can be six.
[0088] Here, the first side can represent the longest side among all sides of the image, and the first quantity refers to the number of designated areas selected on the first side. The second side can represent the shortest side among all sides of the image, and the second quantity refers to the number of designated areas selected on the second side. The first quantity is greater than the second quantity, and the sum of the first quantity and the second quantity is at least the designated number. The designated number can be pre-configured by relevant personnel or automatically set by the system; for example, the designated number can be 4, 5, 6, etc. The first and second sides, and the first and second quantities, are only used to distinguish different objects and are not subject to any actual limitation.
[0089] For example, Figure 2a This is a schematic diagram illustrating the determination of a defined area of the image provided in Embodiment 2 of this disclosure, as shown below. Figure 2a As shown, based on the image dimensions, the two longest sides (the two first sides) and two shortest sides (the two shortest sides) can be determined. When the number of regions is set to 6, four regions A, C, D, and F can be selected at the four vertices of the image, and two regions B and E can be selected at the midpoints of the two longest sides. This allows the determination of the image's defined regions based on the stated dimensions. For example, six 1px color points can be selected from the image edges to obtain six colors. If the colors from the six edge points are not equal (i.e., black, white, gray, RGB are all equal), then the color with the largest area in the image can be selected as the primary color. The defined regions can be square regions, each containing multiple pixels, and the primary color of those pixels is selected as the color of that region. For example, each region can contain 9 pixel grids, such as a 3*3 pixel grid.
[0090] S230, Determine the color of the set area.
[0091] The above steps can be used to obtain each set area, and the color of each set area can be determined separately.
[0092] The following steps, S2301 to S2305, in this embodiment provide the specific implementation steps for determining the color of each set area.
[0093] S2301. For each set area, determine whether the set area contains only one pixel. If yes, execute S2302; otherwise, execute S2303.
[0094] First, for each set area, the number of pixels in each set area can be determined, and then the color of the current set area can be determined according to the number of pixels.
[0095] Specifically, when a setting area contains only one pixel, it can be considered that the setting area contains only one color, and the color of this pixel can be determined as the current setting area color. When a setting area contains more than one pixel, it can be considered that the setting area contains at least two pixels, and in this case, the dominant color of each pixel is used as the current setting area color.
[0096] S2302. Set the color of the pixel to the color of the currently set area and end the operation.
[0097] S2303. Determine the primary color of each pixel as the color of the currently set area.
[0098] The currently set area can be considered as the set area for the currently determined color.
[0099] If the color obtained by superimposing the colors of each set area is colorless (i.e., the RGB values of black, white, and gray are equal), then the colors of each set area need to be updated. The following steps, S2304 to S2307, detail the specific steps for further updating the colors of each set area.
[0100] S2304. Overlay the colors of each set area and calculate the black, white and gray values of the resulting color.
[0101] Specifically, the colors of each set area can be superimposed to obtain the superimposed color. Then, the grayscale value of the superimposed color is calculated. This grayscale value is used to represent the state of the superimposed color. This grayscale value is then used to determine the color of each set area in the subsequent process.
[0102] S2305. Determine whether the black, white, and gray values of the colors formed after overlay are equal. If yes, proceed to S2306; otherwise, proceed to the step of determining the target color to be overlaid at the target position based on the colors of each set area.
[0103] The above steps yield the grayscale values of the superimposed color. By comparing these values, we can determine if they are equal. If they are equal, the superimposed color is colorless, and we need to select the primary color of the target object as the color of each set area, i.e., update the color of the set area based on the primary color of the target object. If the grayscale values are not equal, the superimposed color of each current set area is colored, and we do not update the color of the set area.
[0104] S2306. Update the main color of the target object to the color of each set area.
[0105] As can be seen from the above steps, this embodiment first determines the number of pixels in each set area, and then determines the color of each set area according to the different number of pixels. Then, it further determines whether the color of each set area needs to be adjusted by superimposing the RGB values of the colors of each set area. This improves the accuracy of determining the color of each set area, and thus can determine a more accurate target color. After superimposing based on the target color, a better visual effect can be achieved.
[0106] S240. Determine the target color to be superimposed on the target position based on the color of each of the defined regions.
[0107] In one embodiment, determining the target color to be superimposed on the target location based on the color of each of the defined regions includes:
[0108] The colors of each defined region are superimposed on white with a first opacity to obtain a first color;
[0109] The saturation of the first color is adjusted to a saturation threshold range, and the brightness is adjusted to a brightness threshold range to obtain a first target color, wherein the target color includes the first target color.
[0110] In one embodiment, determining the target color to be superimposed on the target location based on the color of each of the defined regions includes:
[0111] The colors of each defined region are superimposed on white with a second opacity to obtain a second color;
[0112] The saturation of the second color is adjusted to the saturation threshold range, and the brightness is adjusted to the brightness threshold range to obtain the second target color, wherein the target color includes the second target color;
[0113] Wherein, the second opacity is greater than the first opacity, and the difference between the second opacity and the first opacity is a set value, and the second opacity is less than or equal to the first value, the first opacity is greater than or equal to the second value, and the first value is greater than the second value.
[0114] For example, Figure 2b This is a schematic diagram of a process for obtaining a first color, as provided in Embodiment 2 of this disclosure. Figure 2b As shown, if the above steps can obtain the colors A, B, C, D, E and F of 6 defined areas, set the opacity of each of the 6 colors to 20% and overlay them on 100%#FFFFFF to obtain color A1. Set the opacity of each of the 6 colors to 30% and overlay them on 100%#FFFFFF to obtain color B1.
[0115] Herein, the difference between the opacities set when obtaining B1 (the second color) and A1 (the first color) may be 10%, the opacity set when obtaining B1 is greater than the opacity set when obtaining A1. The opacity of B1 is less than 60%, and the opacity of A1 is greater than 10%.
[0116] Figure 2c is a schematic diagram for determining a target color to be superimposed on a target position provided by the second embodiment of the present disclosure, as Figure 2c shown, the S value and B value of A1 are analyzed in the HSB mode, the S (i.e., saturation) value and B (i.e., brightness) value of A1 are respectively adjusted to 20<S<60 (i.e., the saturation threshold range) and 30<B<60 (i.e., the brightness threshold range), so that color A2 can be obtained. The S value and B value of B1 are analyzed in the HSB mode, the S value and B value of B1 are respectively adjusted to 20<S<60 (i.e., the saturation threshold range) and 30<B<60 (i.e., the brightness threshold range), so that color B2 can be obtained. The obtained A2, i.e., the first target color, and B2, i.e., the second target color, are taken as the target colors to be superimposed on the target position. The present disclosure does not limit the adjustment means, as long as the adjusted saturation is within the saturation threshold range and the brightness is within the brightness threshold range.
[0117] It should be noted that the preset saturation values corresponding to the first target color and the second target color may be the same or different, and the brightness thresholds corresponding to the first target color and the second target color may be the same or different. By limiting the saturation threshold and the brightness threshold, the rendered result can have a better visual perception.
[0118] S250. Superimposing the target color at the target position to achieve rendering.
[0119] After the target color to be superimposed on the target position is determined, the layer at the target position can be divided into different regions, and the target color is superimposed on different regions with different opacities respectively, so as to implement rendering.
[0120] For example, when the layer at the target position is one layer, the target color may be B2 or A2. Taking B2 as an example, for instance, B2 with 75% opacity may be superimposed on region 1, and B2 may be superimposed on the corresponding region 2 and region 3 by sequentially increasing the opacity by 5% from bottom to top starting from 0% opacity until reaching 75% opacity; for another example, B2 with 75% opacity may be superimposed on region 1 and region 2, and B2 may be superimposed on region 3 by sequentially increasing the fixed opacity by 5% from bottom to top starting from 0% opacity until reaching 75% opacity.
[0121] Figure 2d is a schematic diagram of superimposing a target color on a background provided by the second embodiment of the present disclosure, refer to Figure 2dFor example, when there are two layers at the target location, the target colors are A2 and B2. First, each layer is divided into regions, including: region 1 from the top of the background to the top of the image, region 2 from the top of the image to the central axis of the image, and region 3 from the central axis of the image to the bottom of the image;
[0122] Then, the bottom layer 12 of the two layers overlays B2 with 75% opacity in the corresponding areas 1 and 2; and overlays B2 in area 3, wherein the opacity of B2 gradually increases from 0% opacity to 75% opacity from the bottom of the image to the center axis of the image within area 3 with a fixed opacity of 5%.
[0123] In the two layers, the top layer 13 overlays A2 with a gradient from 0% opacity to 75% opacity from the top of the background to the top of the image in area 1, and overlays A2 with 0% opacity in areas 2 and 3.
[0124] The second target color can be B2, and the first target color can be A2.
[0125] A B2 color space can be overlaid below text in an image. The opacity of B2 is not limited; refer to the settings used when overlaying it onto a background. Overlaying B2 below text allows the target position to be adapted to the entire image. For the method of dividing the target position, refer to the method when adding a layer between the image's layer and the image's background layer.
[0126] For example, the area from the top of the image to the top of the text area is the first area, the area from the top of the text area to the central axis of the text area is the second area, and the area from the central axis of the text area to the bottom of the image area is the third area. When rendering each area, the second target color can be rendered to each area. The opacity setting for each area can be found in the settings when adding a layer between the layer where the image is located and the layer where the background of the image is located at the target position.
[0127] Figure 2d In the middle, background 11 is at the bottom layer, the bottom layer 12 is on the background 11, the top layer 13 is on the bottom layer 12, and image 14 is on the top layer 13.
[0128] It should be noted that this disclosure does not limit the opacity of the target color in the first, second, and third regions; it can be any opacity.
[0129] This disclosure achieves background color calculation by sampling colors from a defined area of an image and then calculating the target color to be superimposed on the target location, effectively enhancing the atmosphere of the displayed image in the human-computer interface. This example achieves strong compatibility by sampling colors from multiple points along the image edges, calculating colors, and then adjusting them to fit the interface.
[0130] This disclosure achieves rich rendering results and compatibility with both light and dark color modes by sampling colors from the image edges and then determining the target color. Furthermore, it creates a more harmonious transition between the image and background edges and is also compatible with full-screen scenes.
[0131] After different images are rendered using the methods provided in this disclosure, each image will have a different effect, resulting in a rich and varied rendering effect.
[0132] This invention utilizes the overlay of two layers, specifically two gradient overlays, to create images that are softer and more dynamic.
[0133] This disclosure provides a rendering method according to Embodiment 2. The method includes: determining the size of an image within a background; determining a defined area of the image based on the size; determining the color of the defined area; determining a target color to be superimposed on a target position based on the colors of each defined area; and superimposing the target color at the target position to achieve rendering. This method adaptively selects a corresponding defined area based on the size of the target object and then determines the color of that defined area, improving the accuracy of target color determination, further enhancing the rendering effect, and improving the user's visual experience.
[0134] Example 3
[0135] Figure 3 This is a schematic diagram of a rendering apparatus provided in Embodiment 3 of the present disclosure. The apparatus is applicable to rendering images and can be implemented by software and / or hardware, and is generally integrated into an electronic device.
[0136] like Figure 3 As shown, the device includes:
[0137] The determining module 310 is used to determine the color of a set area on the target object, wherein the set area is at least a set number and the set number is greater than 1;
[0138] The target color determination module 320 is used to determine the target color to be superimposed on the target position based on the color of each of the set areas;
[0139] The target color overlay module 330 is used to overlay the target color at the target location to achieve rendering.
[0140] This disclosure provides a rendering apparatus that determines a target color to be superimposed on the target location based on the colors of multiple defined areas of a target object, thereby achieving rendering, enhancing the rendering effect, and improving the user's visual experience.
[0141] Furthermore, the target object is an image, and correspondingly, the target location includes: an additional layer added between the layer where the image is located and the layer where the background of the image is located, and the defined area is the area on the image within the background; or,
[0142] The target location is the layer added between the layer where the image is located and the layer where the text on the image is located.
[0143] Furthermore, the determining module 310 includes:
[0144] A size determination unit is used to determine the size of the image within the background.
[0145] A region determination unit is used to determine a region of the image based on the size.
[0146] A color determination unit is used to determine the color of the designated area.
[0147] Furthermore, the designated area determination unit is specifically used for:
[0148] When the length of the first side of the image, which represents the size, is greater than the length of the second side, a first number of predetermined regions are selected on the first side; a second number of predetermined regions are selected on the second side, wherein the first number is greater than the second number, and the sum of the first number and the second number is at least the predetermined number.
[0149] Furthermore, the number of settings is six, and the determining module 310 is specifically used for:
[0150] For each defined region, when the defined region includes one pixel, the color of the pixel is determined as the color of the defined region; when the defined region includes at least two pixels, the primary color of each pixel is determined as the color of the defined region.
[0151] When the gray values of the colors formed by superimposing the colors in each of the defined regions are equal, the colors of each defined region are updated to the main color of the target object.
[0152] Furthermore, the target color determination module 320 includes:
[0153] The colors of each defined region are superimposed on white with a first opacity to obtain a first color;
[0154] The saturation of the first color is adjusted to a saturation threshold range, and the brightness is adjusted to a brightness threshold range to obtain a first target color, wherein the target color includes the first target color.
[0155] Furthermore, the target color determination module 320 also includes:
[0156] The colors of each defined region are superimposed on white with a second opacity to obtain a second color;
[0157] The saturation of the second color is adjusted to the saturation threshold range, and the brightness is adjusted to the brightness threshold range to obtain the second target color, wherein the target color includes the second target color;
[0158] Wherein, the second opacity is greater than the first opacity, and the difference between the second opacity and the first opacity is a set value, and the second opacity is less than or equal to the first value, the first opacity is greater than or equal to the second value, and the first value is greater than the second value.
[0159] Furthermore, the target color overlay module 330 is specifically used for:
[0160] The target color is overlaid onto the target location with different levels of transparency.
[0161] Furthermore, the target color overlay module 330 is specifically used to: overlay the target color onto the target location with different transparency levels, including:
[0162] When a layer is added at the target location between the layer where the image is located and the layer where the background of the image is located, the added layer consists of two layers. Each layer is divided into a first region from the top of the background to the top of the image, a second region from the top of the image to the central axis of the image, and a third region from the central axis of the image to the bottom of the image.
[0163] The bottom layer of the two layers overlays the second target color with a third opacity in the corresponding first and second regions; the second target color is overlaid in the corresponding third region, and the opacity of the second target color gradually changes from a fourth opacity to the third opacity from the bottom of the image to the central axis of the image in the corresponding third region, and the fourth opacity is less than the third opacity;
[0164] In the two layers, the top layer overlays the first target color, which varies from a fifth opacity to a sixth opacity, onto the top of the background in the corresponding first area and the top of the image. The fifth opacity is greater than the sixth opacity. The corresponding second area and the corresponding third area overlay the first target color with a sixth opacity.
[0165] The above-described rendering apparatus can execute the rendering method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0166] Example 4
[0167] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this disclosure. Figure 4 A schematic diagram of the structure of an electronic device 400 suitable for implementing embodiments of the present disclosure is shown. The electronic device 400 in embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The illustrated electronic device 400 is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0168] like Figure 4 As shown, electronic device 400 may include one or more processing devices (e.g., central processing unit, graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. One or more processing devices 401 implement the methods provided in this disclosure. Various programs and data required for the operation of electronic device 400 are also stored in RAM 403. Processing devices 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0169] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc., for storing one or more programs; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although... Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0170] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 408, or installed from a ROM 402. When the computer program is executed by a processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.
[0171] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0172] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol, such as Hypertext Transfer Protocol (HTTP), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0173] The aforementioned computer-readable medium may be included in the aforementioned electronic device 400; or it may exist independently and not assembled into the electronic device 400.
[0174] The aforementioned computer-readable medium stores one or more computer programs that, when executed by a processing device, implement the following method: determining the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1;
[0175] Based on the color of each defined region, determine the target color to be superimposed on the target position;
[0176] The target color is superimposed at the target location.
[0177] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, enable the electronic device 400 to write computer program code for performing the operations of this disclosure in one or more programming languages or combinations thereof. These programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. Each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0179] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0180] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programming Logic Device (CPLD), and so on.
[0181] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0182] According to one or more embodiments of this disclosure, Example 1 provides a user interface rendering method, including:
[0183] Determine the color of a set area on the target object, wherein the set area is at least a set number, and the set number is greater than 1;
[0184] Based on the color of each defined region, determine the target color to be superimposed on the target position;
[0185] The target color is overlaid at the target location to achieve rendering.
[0186] According to one or more embodiments of this disclosure, Example 2 describes the method described in Example 1.
[0187] The target object is an image; correspondingly, the target location includes: the layer added between the layer where the image is located and the layer where the background of the image is located, and the defined area is the area on the image within the background; or...
[0188] The target location is the layer added between the layer where the image is located and the layer where the text on the image is located.
[0189] According to one or more embodiments of this disclosure, Example 3 describes the method described in Example 2.
[0190] Determining the color of a designated area on the target object includes:
[0191] Determine the size of the image within the background;
[0192] Based on the stated dimensions, determine the designated area of the image;
[0193] Determine the color of the specified area.
[0194] According to one or more embodiments of this disclosure, Example 4 describes the method described in Example 3.
[0195] Determining the designated area of the image based on the size includes:
[0196] When the length of the first side of the image, which represents the size, is greater than the length of the second side, a first number of predetermined regions are selected on the first side; a second number of predetermined regions are selected on the second side, wherein the first number is greater than the second number, and the sum of the first number and the second number is at least the predetermined number.
[0197] According to one or more embodiments of this disclosure, Example 5 describes the method described in Example 3.
[0198] The number of settings is six, and the color of the set area is determined, including:
[0199] For each defined region, when the defined region includes one pixel, the color of the pixel is determined as the color of the defined region; when the defined region includes at least two pixels, the primary color of each pixel is determined as the color of the defined region.
[0200] When the gray values of the colors formed by superimposing the colors in each of the defined regions are equal, the colors of each defined region are updated to the main color of the target object.
[0201] According to one or more embodiments of this disclosure, Example 6 describes the method according to Example 2.
[0202] Determining the target color to be superimposed on the target position based on the color of each of the defined regions includes:
[0203] The colors of each defined region are superimposed on white with a first opacity to obtain a first color;
[0204] The saturation of the first color is adjusted to a saturation threshold range, and the brightness is adjusted to a brightness threshold range to obtain a first target color, wherein the target color includes the first target color.
[0205] According to one or more embodiments of this disclosure, Example 7 describes the method according to Example 6.
[0206] The colors of each defined region are superimposed on white with a second opacity to obtain a second color;
[0207] The saturation of the second color is adjusted to the saturation threshold range, and the brightness is adjusted to the brightness threshold range to obtain the second target color, wherein the target color includes the second target color;
[0208] Wherein, the second opacity is greater than the first opacity, and the difference between the second opacity and the first opacity is a set value, and the second opacity is less than or equal to the first value, the first opacity is greater than or equal to the second value, and the first value is greater than the second value.
[0209] According to one or more embodiments of this disclosure, Example 8 describes the method described in Example 7.
[0210] The process of overlaying the target color at the target location to achieve rendering includes:
[0211] The target color is overlaid onto the target location with different levels of transparency.
[0212] According to one or more embodiments of this disclosure, Example 9 describes the method described in Example 8.
[0213] Overlaying the target color onto the target location with different levels of transparency includes:
[0214] When a layer is added at the target location between the layer where the image is located and the layer where the background of the image is located, the added layer consists of two layers. Each layer is divided into a first region from the top of the background to the top of the image, a second region from the top of the image to the central axis of the image, and a third region from the central axis of the image to the bottom of the image.
[0215] The bottom layer of the two layers overlays the second target color with a third opacity in the corresponding first and second regions; the second target color is overlaid in the corresponding third region, and the opacity of the second target color gradually changes from a fourth opacity to the third opacity from the bottom of the image to the central axis of the image in the corresponding third region, and the fourth opacity is less than the third opacity;
[0216] In the two layers, the top layer overlays the first target color, which varies from a fifth opacity to a sixth opacity, onto the top of the background in the corresponding first area and the top of the image. The fifth opacity is greater than the sixth opacity. The corresponding second area and the corresponding third area overlay the first target color with a sixth opacity.
[0217] According to one or more embodiments of this disclosure, Example 10 provides an interface rendering apparatus, including:
[0218] A determining module is used to determine the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1;
[0219] The target color determination module is used to determine the target color to be superimposed on the target position based on the color of each of the defined areas;
[0220] The target color overlay module is used to overlay the target color at the target location to achieve rendering.
[0221] According to one or more embodiments of this disclosure, Example 11 provides an electronic device, including:
[0222] One or more processing devices;
[0223] Storage device for storing one or more programs;
[0224] When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any one of claims 1-9.
[0225] According to one or more embodiments of the present disclosure, Example 12 provides a computer-readable medium having a computer program stored thereon, characterized in that the program, when executed by a processing device, implements the method as described in any one of claims 1-9.
[0226] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0227] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0228] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A rendering method, characterized in that, The method includes: Determine the color of a set area on the target object, wherein the set area is at least a set number, and the set number is greater than 1; Based on the color of each defined region, determine the target color to be superimposed on the target position; The target color is superimposed onto the target location with different levels of transparency to achieve rendering. Wherein, the target object is an image, and correspondingly, the target location includes: the layer added between the layer where the image is located and the layer where the background of the image is located, and the defined area is the area on the image within the background; or... The target location is an added layer between the layer where the image is located and the layer where the text on the image is located; Determining the color of a designated area on the target object includes: Determine the size of the image within the background; Based on the stated dimensions, determine the designated area of the image; Determine the color of the designated area; Determining the designated area of the image based on the size includes: When the length of the first side of the image, which represents the size, is greater than the length of the second side, a first number of predetermined regions are selected on the first side; a second number of predetermined regions are selected on the second side, wherein the first number is greater than the second number, and the sum of the first number and the second number is at least the predetermined number.
2. The method according to claim 1, characterized in that, The number of settings is six, and the color of the set area is determined, including: For each defined region, when the defined region includes one pixel, the color of the pixel is determined as the color of the defined region; when the defined region includes at least two pixels, the primary color of each pixel is determined as the color of the defined region. When the gray values of the colors formed by superimposing the colors in each of the defined regions are equal, the colors of each defined region are updated to the main color of the target object.
3. The method according to claim 1, characterized in that, Determining the target color to be superimposed on the target position based on the color of each of the defined regions includes: The colors of each defined region are superimposed on white with a first opacity to obtain a first color; The saturation of the first color is adjusted to a saturation threshold range, and the brightness is adjusted to a brightness threshold range to obtain a first target color, wherein the target color includes the first target color.
4. The method according to claim 3, characterized in that, Determining the target color to be superimposed on the target position based on the color of each of the defined regions includes: The colors of each defined region are superimposed on white with a second opacity to obtain a second color; The saturation of the second color is adjusted to the saturation threshold range, and the brightness is adjusted to the brightness threshold range to obtain the second target color, wherein the target color includes the second target color; Wherein, the second opacity is greater than the first opacity, and the difference between the second opacity and the first opacity is a set value, and the second opacity is less than or equal to the first value, the first opacity is greater than or equal to the second value, and the first value is greater than the second value.
5. The method according to claim 1, characterized in that, Overlaying the target color onto the target location with different levels of transparency includes: When a layer is added at the target location between the layer where the image is located and the layer where the background of the image is located, the added layer consists of two layers. Each layer is divided into a first region from the top of the background to the top of the image, a second region from the top of the image to the central axis of the image, and a third region from the central axis of the image to the bottom of the image. The bottom layer of the two layers overlays the second target color with a third opacity in the corresponding first and second regions; the second target color is overlaid in the corresponding third region, and the opacity of the second target color gradually changes from a fourth opacity to the third opacity from the bottom of the image to the central axis of the image in the corresponding third region, and the fourth opacity is less than the third opacity; In the two layers, the top layer overlays the first target color, which varies from a fifth opacity to a sixth opacity, onto the top of the background in the corresponding first area and the top of the image. The fifth opacity is greater than the sixth opacity. The corresponding second area and the corresponding third area overlay the first target color with a sixth opacity.
6. A rendering apparatus, characterized in that, include: A determining module is used to determine the color of a set area on a target object, wherein the set area is at least a set number and the set number is greater than 1; The target color determination module is used to determine the target color to be superimposed on the target position based on the color of each of the defined regions; The target color overlay module is used to overlay the target color onto the target location with different transparency levels to achieve rendering. Wherein, the target object is an image, and correspondingly, the target location includes: the layer added between the layer where the image is located and the layer where the background of the image is located, and the defined area is the area on the image within the background; or... The target location is an added layer between the layer where the image is located and the layer where the text on the image is located; The determining module includes: A size determination unit is used to determine the size of the image within the background. A region determination unit is used to determine a region of the image based on the size. A color determination unit is used to determine the color of the designated area; The defined region determination unit is specifically used for: When the length of the first side of the image, which represents the size, is greater than the length of the second side, a first number of predetermined regions are selected on the first side; a second number of predetermined regions are selected on the second side, wherein the first number is greater than the second number, and the sum of the first number and the second number is at least the predetermined number.
7. An electronic device, characterized in that, include: One or more processing devices; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any one of claims 1-5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for setting colors of icons of interface and terminal
CN104050004A
Color rendering method and device of page sidebar
CN105786896A
Atmosphere rendering system and method of man-machine interaction interface
CN106406504A
Lip color-rendering method, device and electronic equipment
CN107229905A
