Picture display processing method and device, electronic equipment and storage medium
By calculating the distance between the image color and the candidate colors in a three-dimensional coordinate system, the target background color is determined, which solves the problem of abrupt main color setting in the cover image and achieves a display effect that coordinates the background color with the main color.
Patent Information
- Application Number
- CN202410923141.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-15
AI Technical Summary
In multimedia projects, directly setting the main color of the cover image as the background color results in a jarring color that affects other elements on the page, making it difficult to meet user experience requirements.
By obtaining the first color value of the target image, converting it into the first coordinate point and placing it in a preset three-dimensional coordinate system, and combining it with the second coordinate point obtained by converting the candidate color values, the distance is calculated to determine the target background color, and then the target image is displayed.
While ensuring a good user experience, the main color of the image was successfully set as the background color of the current page, meeting the display requirements of multimedia projects.
Smart Images

Figure CN118963876A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a picture display processing method, a picture display processing device, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Art
[0002] During the development stage of a multimedia project, when displaying a song cover image, there is a need to set the main color of the cover image as the background color of the current page. However, directly setting the color obtained through a color picker, such as black, white, red, etc., as the background color not only makes the color abrupt, but also has a sensory impact on other elements on the page, such as lyrics, icons, etc., and it is difficult to meet the aforementioned requirements in terms of effect. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a method for image display processing, an image display processing device, a corresponding electronic device and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0004] An embodiment of the present invention discloses a method for image display processing, the method comprising:
[0005] In response to a target image display instruction, obtaining a first color value of the target image;
[0006] A first coordinate point is obtained based on the first color value conversion, and the first coordinate point is placed in a preset three-dimensional coordinate system; a plurality of second coordinate points are placed in the preset three-dimensional coordinate system, wherein the second coordinate points are obtained based on the candidate color value conversion;
[0007] Determining a target background color based on a distance between the first coordinate point and the second coordinate point;
[0008] The target image is displayed according to the target background color.
[0009] Optionally, converting the first color value to obtain a first coordinate point includes:
[0010] The color values of different color channels in the first color value are respectively used as coordinate values of different coordinate axes of the first coordinate point to obtain the first coordinate point.
[0011] Optionally, the method further comprises:
[0012] Acquire a plurality of candidate color values, and use the color values of different color channels in each candidate color value as the coordinate values of different coordinate axes of the second coordinate point, respectively, to obtain a plurality of second coordinate points;
[0013] The preset three-dimensional coordinate system is established, and a plurality of second coordinate points are placed in the preset three-dimensional coordinate system.
[0014] Optionally, the obtaining of a plurality of candidate color values includes:
[0015] Get several candidate color values from the preset color list;
[0016] The preset color list includes a number of background colors and / or a number of background images; when the preset color list includes a background image, the candidate color value is the main color of the background image.
[0017] Optionally, determining the target background color based on the distance between the first coordinate point and the second coordinate point includes:
[0018] Calculating the spatial distance between the first coordinate point and each second coordinate point to obtain a plurality of distance values;
[0019] The second coordinate points are sorted in a preset order based on the multiple distance values, and the candidate color value corresponding to the target second coordinate point located at the preset position is used as the target background color.
[0020] Optionally, displaying the target image according to the target background color includes:
[0021] The target image is displayed, and the background of the target image when displayed is set according to the target background color.
[0022] Optionally, when the preset color list includes a background picture, the candidate color value corresponding to the target second coordinate point is the main color of the target background picture; and displaying the target picture according to the target background color includes:
[0023] The target image is displayed, and the background of the target image when displayed is set according to the main color of the target background image.
[0024] The embodiment of the present invention further discloses a picture display processing device, the device comprising:
[0025] A display instruction acquisition module, used to respond to a target image display instruction and acquire a first color value of the target image;
[0026] A coordinate point conversion module, used for converting the first color value to obtain a first coordinate point, and placing the first coordinate point in a preset three-dimensional coordinate system; the preset three-dimensional coordinate system is provided with a plurality of second coordinate points, wherein the second coordinate points are converted based on the candidate color value;
[0027] A background color determination module, used to determine a target background color based on the distance between the first coordinate point and the second coordinate point;
[0028] The image display module is used to display the target image according to the target background color.
[0029] Optionally, the device further comprises:
[0030] The three-dimensional coordinate system establishment module is used to obtain a number of candidate color values, use the color values of different color channels in each candidate color value as the coordinate values of different coordinate axes of the second coordinate point, and obtain a number of second coordinate points; establish the preset three-dimensional coordinate system, and place the number of second coordinate points in the preset three-dimensional coordinate system.
[0031] Optionally, the three-dimensional coordinate system establishing module includes:
[0032] The candidate color value acquisition submodule is used to obtain several candidate color values from a preset color list; wherein the preset color list includes several background colors and / or several background images; when the preset color list includes a background image, the candidate color value is the main color of the background image.
[0033] Optionally, the coordinate point conversion module includes:
[0034] The first coordinate point conversion submodule is used to use the color values of different color channels in the first color value as the coordinate values of different coordinate axes of the first coordinate point, so as to obtain the first coordinate point.
[0035] Optionally, the background color determination module includes:
[0036] The background color determination submodule is used to calculate the spatial distance between the first coordinate point and each second coordinate point to obtain multiple distance values; based on the multiple distance values, each second coordinate point is sorted in a preset order, and the candidate color value corresponding to the target second coordinate point located at the preset position is used as the target background color.
[0037] Optionally, the picture display module includes:
[0038] The picture display submodule is used to display the target picture and set the background of the target picture when it is displayed according to the target background color.
[0039] Optionally, when the preset color list includes a background picture, the candidate color value corresponding to the target second coordinate point is the main color of the target background picture; the picture display submodule is also used to display the target picture and set the background of the target picture when displayed according to the main color of the target background picture.
[0040] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, any one of the image display processing methods is implemented.
[0041] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the picture display processing methods is implemented.
[0042] The embodiments of the present invention include the following advantages:
[0043] In an embodiment of the present invention, by responding to a target image display instruction, the first color value of the target image to be displayed can be obtained, and a first coordinate point can be obtained based on the first color value conversion, and then the converted second coordinate point is placed in a preset three-dimensional coordinate system. A plurality of second coordinate points are also placed in the preset three-dimensional coordinate system, and the plurality of second coordinate points are mainly obtained based on the candidate color value conversion. At this time, the target background color can be determined from the candidate color value based on the distance between the first coordinate point and the second coordinate point in the preset three-dimensional coordinate system, and then the target image to be displayed can be displayed according to the target background color. By converting the first color value of the target image to be displayed into a first coordinate point, and converting a plurality of candidate color values into a plurality of second coordinate points, and utilizing the calculation of the spatial straight-line distance in the preset three-dimensional coordinate system, the target background color to be set when displaying the target image is obtained, and then the requirement of setting the main color of the image to be displayed as the background color of the current page is met while ensuring the user's sensory experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flowchart of a picture display processing method embodiment of the present invention;
[0045] Figure 2 is a flowchart of another picture display processing method embodiment of the present invention;
[0046] Figure 3 is a schematic diagram of a process of image display processing provided by an embodiment of the present invention;
[0047] Figure 4 It is a schematic diagram of filling three-dimensional data in a preset three-dimensional coordinate system provided by an example of the present invention;
[0048] Figure 5 is a schematic diagram of an application scenario of image display processing provided by an embodiment of the present invention;
[0049] Figure 6 It is a structural block diagram of an embodiment of a picture display processing device of the present invention. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] When displaying a picture, there is a need to set the main color of the picture to be displayed as the background color of the current page. For example, in the development stage of a multimedia project, when displaying the cover image of a song, there is a need to set the main color of the cover image as the background color of the current page.
[0052] Reference Figure 1 , shows a flowchart of a picture display processing method embodiment of the present invention, which may specifically include the following steps:
[0053] Step 101, responding to a target image display instruction, obtaining a first color value of the target image;
[0054] When displaying a picture, there is a need to set the main color of the picture to be displayed as the background color of the current page. The target picture display instruction can be triggered based on the picture display operation performed by the user, or it can be automatically generated when the picture display demand is detected. The embodiment of the present invention does not limit this.
[0055] For example, in the multimedia project development stage, when displaying the cover image of a song, there is a need to set the main color of the cover image as the background color of the current page. At this time, the target image may refer to the cover image of the song, and the target image display instruction may be generated by detecting that the user operates the song, or opens the song playback page, or triggers the display operation of the song cover image.
[0056] In actual applications, the target image display instruction can be responded to by a terminal device used to display the target image. Assuming that the multimedia project is deployed on a vehicle-mounted terminal, the target image display instruction can be responded to by the vehicle-mounted terminal. Based on different actual application scenarios, the terminal device that responds to the target image display instruction can also be other terminal devices besides the vehicle-mounted terminal, and the embodiments of the present invention are not limited to this.
[0057] Specifically, in order to determine the background color when displaying the target image, when responding to the target image display instruction, the first color of the target image to be displayed can be acquired, so that the final used / set background color can be determined based on the acquired first color.
[0058] The first color of the target image obtained may refer to the main color of the target image to be displayed. The main color of a certain image can be determined by reading the image data, that is, the pixel data of the corresponding image, and then traversing all pixels and calculating the frequency of occurrence of each color to obtain the color frequency of the image, and finally determining the color with the most occurrences as the main color according to the color frequency.
[0059] Step 102, obtaining a first coordinate point based on the first color value conversion, and placing the first coordinate point in a preset three-dimensional coordinate system;
[0060] In the embodiment of the present invention, the target background color to be set when displaying the target image is obtained by calculating the spatial straight-line distance in a preset three-dimensional coordinate system.
[0061] Specifically, a first coordinate point can be obtained by converting based on the first color value, and the converted first coordinate point is placed in a preset three-dimensional coordinate system. A number of second coordinate points are also placed in the preset three-dimensional coordinate system. The number of second coordinate points are mainly obtained based on the candidate color value conversion. At this time, the requirement of setting the main color of the picture to be displayed as the background color of the current page can be achieved by placing the first coordinate point and the number of second coordinate points in the preset three-dimensional coordinate system.
[0062] Among them, several candidate color values can be obtained from a preset color list, and the preset color list can contain as many colors as possible so that there can be as many choices as possible when determining the background color, so as to ensure that the determined background color is as close to the main color of the target image to be displayed as possible.
[0063] Step 103, determining the target background color based on the distance between the first coordinate point and the second coordinate point;
[0064] Specifically, it can be expressed as using the concept of the shortest straight-line distance in space to abstract the process of determining the background color into a method of solving the approximate value of any three-dimensional data.
[0065] In an embodiment of the present invention, the target background color may be determined by calculating the spatial distance between a first coordinate point and a plurality of second coordinate points placed in a preset three-dimensional coordinate system.
[0066] Step 104, displaying the target image according to the target background color.
[0067] After the target background color is determined, the target image can be displayed. When displaying the target image, it can be displayed and the background of the target image can be set according to the determined target background color, thereby satisfying the requirement of setting the main color of the image to be displayed as the background color of the current page when displaying the image.
[0068] It should be noted that the above steps 101 to 104 can be encapsulated as corresponding programs and installed in the terminal device for execution. Specifically, the terminal device installed with the above program directly triggers the specific process of implementing the above steps 101 to 104 when detecting the target image display instruction.
[0069] In an embodiment of the present invention, by responding to a target image display instruction, the first color value of the target image to be displayed can be obtained, and a first coordinate point can be obtained based on the first color value conversion, and then the converted second coordinate point is placed in a preset three-dimensional coordinate system. A plurality of second coordinate points are also placed in the preset three-dimensional coordinate system, and the plurality of second coordinate points are mainly obtained based on the candidate color value conversion. At this time, the target background color can be determined from the candidate color value based on the distance between the first coordinate point and the second coordinate point in the preset three-dimensional coordinate system, and then the target image to be displayed can be displayed according to the target background color. By converting the first color value of the target image to be displayed into a first coordinate point, and converting a plurality of candidate color values into a plurality of second coordinate points, and utilizing the calculation of the spatial straight-line distance in the preset three-dimensional coordinate system, the target background color to be set when displaying the target image is obtained, and then the requirement of setting the main color of the image to be displayed as the background color of the current page is met while ensuring the user's sensory experience.
[0070] Reference Figure 2 , shows a flowchart of another picture display processing method embodiment of the present invention, which may specifically include the following steps:
[0071] Step 201, obtaining a plurality of candidate color values, and converting each candidate color value to obtain a plurality of second coordinate points;
[0072] In an embodiment of the present invention, the conversion method of coordinate points based on color values can be expressed as using color values of different color channels in the color value as coordinate values of different coordinate axes of the coordinate point, respectively, to achieve conversion of the coordinate point.
[0073] The conversion of the second coordinate point can be performed by acquiring a plurality of candidate color values, and using the color values of different color channels in each candidate color value as the coordinate values of different coordinate axes of the second coordinate point, to obtain a plurality of second coordinate points.
[0074] The color value may be a color value using different color representation systems, which may be a hexadecimal color code or an RGB color value. Hexadecimal color codes are usually used in web design and graphic software, where each two-digit number represents a color channel (red, green, blue) ranging from 00 to FF. For example, F3 in F3F4F5 represents the red channel, F4 represents the green channel, and F5 represents the blue channel. RGB color values are color values represented by the RGB color model, which usually uses three digits to represent colors, each digit representing a color channel (red, green, blue) ranging from 0 to 255. For example, in (R:243, G:244, B:245), 243 may represent the red channel, 244 may represent the green channel, and 245 may represent the blue channel.
[0075] There are representations of the same color in different color representation systems. In the preset three-dimensional coordinate system, the coordinate values of the coordinate points can directly adopt the corresponding values of each color channel in the RGB color value, for example, the color value corresponding to the R channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the X axis), the color value corresponding to the G channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the Y axis), and the color value corresponding to the B channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the Z axis). For the determination of the coordinate values on different coordinate axes, other corresponding methods of color channels can also be used, and the embodiments of the present invention are not limited to this.
[0076] When the color value adopts a hexadecimal color code, the hexadecimal color code can be converted into an RGB color value, and each two-digit hexadecimal number can be converted into a decimal number. Exemplarily, for the hexadecimal color code F3F4F5, the conversion process can be expressed as F3 (hexadecimal) = 243 (decimal), F4 (hexadecimal) = 244 (decimal), F5 (hexadecimal) = 245 (decimal), that is, F3F4F5 can be converted into an RGB color value: (R: 243, G: 244, B: 245), and then the three-dimensional coordinate point of the corresponding coordinate value of the RGB color value in the preset three-dimensional coordinate system is obtained.
[0077] Step 202, establishing a preset three-dimensional coordinate system, and placing a plurality of second coordinate points in the preset three-dimensional coordinate system;
[0078] In one embodiment of the present invention, a preset three-dimensional coordinate system may be established so that the converted coordinate values can be filled into the established preset three-dimensional coordinate system, thereby drawing a plurality of second coordinate points in the preset three-dimensional coordinate system.
[0079] Among them, several second coordinate points can be converted based on several candidate color values, several candidate color values can be obtained from a preset color list, the preset color list can contain as many colors as possible, and the preset color list can usually directly include several background colors; in order to ensure the visual effect of the background display on the user, the preset color list can also maintain several background pictures. When the preset color list contains a background picture, the candidate color value can be the main color of the background picture, that is, the main color of the background picture to be maintained can be extracted in advance, and the extracted main color can be matched with the background picture one by one, and then when the main color of the background picture is maintained through the preset color list, the maintenance of several pictures is realized. In actual applications, the preset color list can be stored locally as the background list to be maintained, so as to provide the candidate color materials required when setting the background color.
[0080] Step 203, responding to the target image display instruction, obtaining the first color value of the target image and obtaining the established preset three-dimensional coordinate system;
[0081] In actual applications, the target image display instruction can be responded to by a terminal device used to display the target image. Assuming that the multimedia project is deployed on a vehicle-mounted terminal, the target image display instruction can be responded to by the vehicle-mounted terminal. Based on different actual application scenarios, the terminal device that responds to the target image display instruction can also be other terminal devices besides the vehicle-mounted terminal, and the embodiments of the present invention are not limited to this.
[0082] Specifically, in order to determine the background color when displaying the target image, when responding to the target image display instruction, the first color of the target image to be displayed can be acquired, so that the final used / set background color can be determined based on the acquired first color.
[0083] The acquisition of the first color of the target image can be manifested as follows: when the terminal device detects the target image display instruction, it reads the pixel data of the target image by executing the above-encapsulated program, and then obtains the color frequency of the image by traversing all pixels and calculating the frequency of occurrence of each color. After determining the color with the most occurrences according to the color frequency, the color with the most occurrences is obtained through a color picker to obtain the main color of the target image.
[0084] Step 204, obtaining a first coordinate point based on the first color value conversion, and placing the first coordinate point in a preset three-dimensional coordinate system;
[0085] In one embodiment of the present invention, the conversion method of coordinate points based on color values can be expressed as taking the color values of different color channels in the color value as the coordinate values of different coordinate axes of the coordinate point to achieve the conversion of the coordinate point. That is, for the conversion of the first coordinate point, the color values of different color channels in the first color value can be expressed as taking the color values of different color channels in the first color value as the coordinate values of different coordinate axes of the first coordinate point to obtain the first coordinate point.
[0086] The color value may be a color value using different color representation systems, which may be a hexadecimal color code or an RGB color value. Hexadecimal color codes are usually used in web design and graphic software, where each two-digit number represents a color channel (red, green, blue) ranging from 00 to FF. For example, F3 in F3F4F5 represents the red channel, F4 represents the green channel, and F5 represents the blue channel. RGB color values are color values represented by the RGB color model, which usually uses three digits to represent colors, each digit representing a color channel (red, green, blue) ranging from 0 to 255. For example, in (R:243, G:244, B:245), 243 may represent the red channel, 244 may represent the green channel, and 245 may represent the blue channel.
[0087] There are representations of the same color in different color representation systems. In the preset three-dimensional coordinate system, the coordinate values of the coordinate points can directly adopt the corresponding values of each color channel in the RGB color value, for example, the color value corresponding to the R channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the X axis), the color value corresponding to the G channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the Y axis), and the color value corresponding to the B channel is used as the coordinate value of the coordinate point on the horizontal axis (i.e., the Z axis). For the determination of the coordinate values on different coordinate axes, other corresponding methods of color channels can also be used, and the embodiments of the present invention are not limited to this.
[0088] When the color value adopts a hexadecimal color code, the hexadecimal color code can be converted into an RGB color value, and each two-digit hexadecimal number can be converted into a decimal number. Exemplarily, for the hexadecimal color code F3F4F5, the conversion process can be expressed as F3 (hexadecimal) = 243 (decimal), F4 (hexadecimal) = 244 (decimal), F5 (hexadecimal) = 245 (decimal), that is, F3F4F5 can be converted into an RGB color value: (R: 243, G: 244, B: 245), and then the three-dimensional coordinate point of the corresponding coordinate value of the RGB color value in the preset three-dimensional coordinate system is obtained.
[0089] In a preferred embodiment of the present invention, the converted coordinate values can be filled into the established preset three-dimensional coordinate system, and then the first coordinate point in the preset three-dimensional coordinate system can be drawn.
[0090] Step 205, determining the target background color based on the distance between the first coordinate point and the second coordinate point;
[0091] In the embodiment of the present invention, the concept of the shortest straight-line distance in space can be used to abstract the process of determining the background color into a method of solving the approximate value of any three-dimensional data.
[0092] In one embodiment of the present invention, the spatial distance between the first coordinate point and each second coordinate point can be calculated to obtain multiple distance values; based on the multiple distance values, each second coordinate point is sorted in a preset order, and the candidate color value corresponding to the target second coordinate point located at the preset position is used as the target background color.
[0093] In the preset three-dimensional coordinate system, the spatial distance between two coordinate points can be calculated using the Euclidean distance formula. Assume that there are two points P 1 and P 2 , and the coordinates of the two three-dimensional coordinate points are assumed to be (x 1 ,y 1 ,z 1 ) and (x 2 ,y 2 ,z 2 ), the distance d between the two three-dimensional coordinate points can be calculated, and the calculation formula can be specifically shown as follows:
[0094]
[0095] After calculating the spatial distance between the first coordinate point and several second coordinate points, multiple distance values can be obtained, such as L1, L2, L3, etc. At this time, multiple distance values can be compared, where the smaller the value, the closer the color, that is, at this time, the candidate color value corresponding to the target second coordinate point with a smaller value can be determined as the target background color. Specifically, it can be expressed as sorting multiple distance values in a preset order, or sorting each second coordinate point in a preset order based on multiple distance values. Assuming that the preset order is from large to small, at this time, the candidate color value corresponding to the target second coordinate point at a preset position in the sorting, such as the last one, can be used as the target background color; assuming that the preset order is from small to large, at this time, the candidate color value corresponding to the target second coordinate point at a preset position in the sorting, such as the first one, can be used as the target background color.
[0096] Step 206, displaying the target image according to the target background color.
[0097] In practical applications, the RBG value of the point corresponding to the minimum value can be obtained, specifically by obtaining the coordinate value of the coordinate point corresponding to the minimum value, and then the RBG value can be converted into a corresponding color value. The converted color value here can refer to a hexadecimal color code suitable for web design and graphic software to determine the background color to be used; after obtaining the converted hexadecimal color code, the hexadecimal color code can be set as the target background color, so that when the target image is displayed, the background of the target image when displayed can be set according to the target background color.
[0098] Optionally, the preset color list for maintaining candidate color values may include several background images. When the preset color list includes a background image, the candidate color value is the main color of the background image. When displaying the target image, the background of the target image can be set according to the main color of the target background image.
[0099] Optionally, the preset color list for maintaining candidate color values may include several background pictures. When the preset color list includes a background picture, the candidate color value is the main color of the background picture. Based on actual conditions, a picture display method can also be adopted in which the target background picture is displayed at the same time as the target picture. This is not limited by the embodiments of the present invention.
[0100] It should be noted that the above steps 201 to 206 can be encapsulated as corresponding programs and installed in the terminal device for execution. Specifically, the terminal device installed with the above program directly triggers the specific process of implementing the above steps 201 to 206 when detecting the target image display instruction.
[0101] In order to enable those skilled in the art to further understand the picture display processing method provided by the embodiment of the present invention, Figure 3 The picture shown in the figure shows the process of processing as follows:
[0102] Reference Figure 3 , which shows a schematic diagram of the process of image display processing provided by an embodiment of the present invention. When a terminal device with a corresponding program installed detects a target image display instruction, it can directly trigger the implementation of the following Figure 3 The pictures shown show the processing process.
[0103] Take the example of setting the main color of a cover image as the background color of the current page when displaying the cover image of a song during the multimedia project development phase.
[0104] Specifically, the target image display instruction can be responded to to obtain the first color value of the target image. At this time, the target image display instruction responded to can be a cover image display instruction, and the first color value of the target image obtained can be the main color of the cover image to be displayed. At this time, the main color of the current cover image can be obtained through the color picker, such as CCCCCC. In order to solve any three-dimensional data model approximation, the hexadecimal color code CCCCCC of the main color obtained above can be converted into RGB value (R=204, G=204, B=204), which now represents the three-dimensional coordinate value of the corresponding coordinate point, such as coordinate point O (204, 204, 204). The three-dimensional data obtained above can be filled into the preset three-dimensional coordinate system.
[0105] The preset three-dimensional coordinate system may be filled with coordinate points converted from candidate color values in the locally maintained background list. Specifically, data may be initialized to obtain a locally maintained background list, i.e., a color list {F3F4F5, 92A0FF, D6D6D6, ...}, and then all color values in the color list may be converted to RGB values and coordinate points may be obtained, for example, F3F4F5 may be converted to coordinate point A (R: 243, G: 244, B: 245), 92A0FF may be converted to coordinate point B (R: 146, G: 160, B: 255), D6D6D6 may be converted to coordinate point C (R: 214, G: 214, B: 214), etc., to obtain multiple sets of three-dimensional data, at which point the aforementioned three-dimensional data may be filled into the preset three-dimensional coordinate system. The preset three-dimensional coordinate system may be obtained by establishing.
[0106] After drawing the 3D data to the established preset 3D coordinate system, such as Figure 4 As shown, multiple coordinate points can be obtained in the preset three-dimensional coordinate system, such as coordinate points O, A, B, C, etc. At this time, the straight-line distance between the coordinate point O indicating the main color of the current cover and the coordinate points A, B, C, etc. indicating other candidate color values for setting the background color can be calculated to obtain multiple distance values, such as L1, L2, L3, L4, L5, etc. The smaller the value, the closer the corresponding candidate color value is to the main color of the current cover. At this time, the values of L1, L2, L3, L4, and L5 can be compared, and the candidate color value corresponding to the minimum value can be determined as the target background color.
[0107] Specifically, the RGB value of the point corresponding to the minimum value may be obtained, and the RGB value may be converted into a color value represented by a hexadecimal color code, and then the color corresponding to the color value may be set as the background color when the cover image of the song is displayed.
[0108] In the above-mentioned image display processing process, the embodiment of the present invention converts the first color value of the target image to be displayed into a first coordinate point, and converts several candidate color values into several second coordinate points, and utilizes the calculation of the spatial straight-line distance in the preset three-dimensional coordinate system to obtain the target background color to be set when displaying the target image, thereby satisfying the requirement of setting the main color of the image to be displayed as the background color of the current page while ensuring the user's sensory experience.
[0109] The above-mentioned picture display processing process can be encapsulated as a corresponding program and installed in a terminal device for execution and implementation. Specifically, the terminal device installed with the above-mentioned program directly triggers the implementation of the above-mentioned specific process when detecting a target picture display instruction.
[0110] During the development of a multimedia project, when displaying a song cover image, there is a need to set the main color of the cover image to the background color of the current page. Assuming that the multimedia project is deployed on a vehicle terminal, the vehicle terminal can respond to the target image display instruction at this time. That is, the application scenario of image display processing can involve the following: Figure 5 The vehicle terminal 510 and the execution program 51 deployed on the vehicle terminal, the deployed execution program 51 can implement the following Figure 3 The process shown.
[0111] In an embodiment of the present invention, by responding to a target image display instruction, the first color value of the target image to be displayed can be obtained, and a first coordinate point can be obtained based on the first color value conversion, and then the converted second coordinate point is placed in a preset three-dimensional coordinate system. A plurality of second coordinate points are also placed in the preset three-dimensional coordinate system, and the plurality of second coordinate points are mainly obtained based on the candidate color value conversion. At this time, the target background color can be determined from the candidate color value based on the distance between the first coordinate point and the second coordinate point in the preset three-dimensional coordinate system, and then the target image to be displayed can be displayed according to the target background color. By converting the first color value of the target image to be displayed into a first coordinate point, and converting a plurality of candidate color values into a plurality of second coordinate points, and utilizing the calculation of the spatial straight-line distance in the preset three-dimensional coordinate system, the target background color to be set when displaying the target image is obtained, and then the requirement of setting the main color of the image to be displayed as the background color of the current page is met while ensuring the user's sensory experience.
[0112] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0113] Reference Figure 6 , shows a structural block diagram of an embodiment of a picture display processing device of the present invention, which may specifically include the following modules:
[0114] A display instruction acquisition module 601, configured to respond to a target image display instruction and acquire a first color value of the target image;
[0115] A coordinate point conversion module 602 is used to obtain a first coordinate point based on the first color value conversion, and place the first coordinate point in a preset three-dimensional coordinate system; the preset three-dimensional coordinate system is placed with a plurality of second coordinate points, wherein the second coordinate points are obtained based on the candidate color value conversion;
[0116] A background color determination module 603, configured to determine a target background color based on a distance between the first coordinate point and the second coordinate point;
[0117] The picture display module 604 is used to display the target picture according to the target background color.
[0118] In an embodiment of the present invention, the device provided by the embodiment of the present invention may further include the following modules:
[0119] The three-dimensional coordinate system establishment module is used to obtain a number of candidate color values, use the color values of different color channels in each candidate color value as the coordinate values of different coordinate axes of the second coordinate point, and obtain a number of second coordinate points; establish the preset three-dimensional coordinate system, and place the number of second coordinate points in the preset three-dimensional coordinate system.
[0120] In one embodiment of the present invention, the three-dimensional coordinate system establishment module may include the following submodules:
[0121] The candidate color value acquisition submodule is used to obtain several candidate color values from a preset color list; wherein the preset color list includes several background colors and / or several background images; when the preset color list includes a background image, the candidate color value is the main color of the background image.
[0122] In one embodiment of the present invention, the coordinate point conversion module 602 may include the following submodules:
[0123] The first coordinate point conversion submodule is used to use the color values of different color channels in the first color value as the coordinate values of different coordinate axes of the first coordinate point, so as to obtain the first coordinate point.
[0124] In one embodiment of the present invention, the background color determination module 603 may include the following submodules:
[0125] The background color determination submodule is used to calculate the spatial distance between the first coordinate point and each second coordinate point to obtain multiple distance values; based on the multiple distance values, each second coordinate point is sorted in a preset order, and the candidate color value corresponding to the target second coordinate point located at the preset position is used as the target background color.
[0126] In one embodiment of the present invention, the picture display module 604 may include the following submodules:
[0127] The picture display submodule is used to display the target picture and set the background of the target picture when it is displayed according to the target background color.
[0128] In one embodiment of the present invention, when the preset color list includes a background picture, the candidate color value corresponding to the target second coordinate point is the main color of the target background picture; the picture display submodule is also used to display the target picture and set the background of the target picture when it is displayed according to the main color of the target background picture.
[0129] In an embodiment of the present invention, the image processing device provided by the embodiment of the present invention can obtain the first color value of the target image to be displayed by responding to the target image display instruction, and obtain the first coordinate point based on the first color value conversion, and then place the converted second coordinate point in a preset three-dimensional coordinate system. The preset three-dimensional coordinate system is also placed with a plurality of second coordinate points, and the plurality of second coordinate points are mainly obtained based on the candidate color value conversion. At this time, the target background color can be determined from the candidate color value based on the distance between the first coordinate point and the second coordinate point in the preset three-dimensional coordinate system, and then the target image to be displayed is displayed according to the target background color. By converting the first color value of the target image to be displayed into the first coordinate point, and converting the plurality of candidate color values into the plurality of second coordinate points, the target background color to be set when the target image is displayed is obtained by calculating the spatial straight-line distance in the preset three-dimensional coordinate system, and then the requirement of setting the main color of the image to be displayed as the background color of the current page is met while ensuring the user's sensory experience.
[0130] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0131] An embodiment of the present invention further provides an electronic device, including:
[0132] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned picture display processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0133] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned image display processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0135] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0136] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0139] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0140] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0141] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0142] The above is a detailed introduction to a picture display processing method, a picture display processing device, a corresponding electronic device and a corresponding computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for image display processing, characterized in that: The method comprises: In response to a target image display instruction, obtaining a first color value of the target image; A first coordinate point is obtained based on the first color value conversion, and the first coordinate point is placed in a preset three-dimensional coordinate system; a plurality of second coordinate points are placed in the preset three-dimensional coordinate system, wherein the second coordinate points are obtained based on the candidate color value conversion; Determining a target background color based on a distance between the first coordinate point and the second coordinate point; The target image is displayed according to the target background color.
2. The method according to claim 1, characterized in that The converting the first color value to obtain the first coordinate point includes: The color values of different color channels in the first color value are respectively used as coordinate values of different coordinate axes of the first coordinate point to obtain the first coordinate point.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquire a plurality of candidate color values, and use the color values of different color channels in each candidate color value as the coordinate values of different coordinate axes of the second coordinate point, respectively, to obtain a plurality of second coordinate points; The preset three-dimensional coordinate system is established, and a plurality of second coordinate points are placed in the preset three-dimensional coordinate system.
4. The method according to claim 3, characterized in that The obtaining of a plurality of candidate color values comprises: Get several candidate color values from the preset color list; The preset color list includes a number of background colors and / or a number of background images; when the preset color list includes a background image, the candidate color value is the main color of the background image.
5. The method according to claim 1, characterized in that Determining a target background color based on a distance between the first coordinate point and the second coordinate point includes: Calculating the spatial distance between the first coordinate point and each second coordinate point to obtain a plurality of distance values; The second coordinate points are sorted in a preset order based on the multiple distance values, and the candidate color value corresponding to the target second coordinate point located at the preset position is used as the target background color.
6. The method according to claim 5, characterized in that The displaying the target image according to the target background color includes: The target image is displayed, and the background of the target image when displayed is set according to the target background color.
7. The method according to claim 5 or 6, characterized in that: When the preset color list includes a background picture, the candidate color value corresponding to the target second coordinate point is the main color of the target background picture; and displaying the target picture according to the target background color includes: The target image is displayed, and the background of the target image when displayed is set according to the main color of the target background image.
8. A picture display processing device, characterized in that: The device comprises: A display instruction acquisition module, used to respond to a target image display instruction and acquire a first color value of the target image; A coordinate point conversion module, used for converting the first color value to obtain a first coordinate point, and placing the first coordinate point in a preset three-dimensional coordinate system; the preset three-dimensional coordinate system is provided with a plurality of second coordinate points, wherein the second coordinate points are converted based on the candidate color value; A background color determination module, used to determine a target background color based on the distance between the first coordinate point and the second coordinate point; The image display module is used to display the target image according to the target background color.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the image display processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image display processing method according to any one of claims 1 to 7 is implemented.
