Method and device for setting background picture and electronic equipment
By obtaining the reference color of the interface background image, the content carrier background is solved, and the problem of inconsistency between the content carrier background and the environment is improved, and the flexibility and visual experience of background settings are improved.
Patent Information
- Application Number
- CN202310857759.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, the background setting of the content carrier is inconsistent with the environment in which it is located, resulting in the background and environment not matching enough and lack of flexibility.
By obtaining the interface background image of the interface where the content carrier is located, and setting the background image of the content carrier based on its reference color, improving the flexibility of background settings.
It realizes the coordination between the content carrier background and the interface background, improving the flexibility of background settings and user visual experience.
Smart Images

Figure CN119311346A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and more specifically, to a method, device and electronic device for setting a background picture. Background Art
[0002] In electronic devices, content can be displayed through content carriers. For example, time information, weather information, flight information, etc. can be displayed through content carriers. However, in related methods, the background setting method corresponding to the content carrier needs to be improved. Summary of the invention
[0003] In view of the above problems, the present application proposes a method, device and electronic device for setting a background image to improve the above problems.
[0004] In a first aspect, the present application provides a method for setting a background picture, which is applied to an electronic device, and the method includes: in response to a background setting instruction, obtaining an interface background picture of an interface where a content carrier is located; obtaining a corresponding reference color based on the interface background picture; and setting a content carrier background picture of the content carrier based on the reference color.
[0005] In a second aspect, the present application provides a device for setting a background picture, which runs on an electronic device, and the device includes: an interface background image acquisition unit, which is used to obtain an interface background image of the interface where a content carrier is located in response to a background setting instruction; a reference acquisition unit, which is used to obtain a corresponding reference color based on the interface background image; and a content carrier background setting unit, which is used to set the content carrier background image of the content carrier based on the reference color.
[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium storing a program code executable by a processor, wherein the computer-readable storage medium includes the stored program code, wherein the above method is executed when the program code is run.
[0008] The present application provides a method, device and electronic device for setting a background image. After obtaining the interface background image of the interface where the content carrier is located in response to a background setting instruction, the corresponding reference color can be obtained based on the interface background image to set the content carrier background image of the content carrier based on the reference color. Thus, through the above method, when it is necessary to set the content carrier background image of the content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of background setting for the content carrier. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram showing content display through a content carrier is shown;
[0011] Figure 2 A flowchart of a method for setting a background image proposed in an embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram showing a content carrier background image for setting a content carrier in an embodiment of the present application is shown;
[0013] Figure 4 A flowchart of a method for setting a background image proposed in another embodiment of the present application is shown;
[0014] Figure 5 A schematic diagram showing an area where a content carrier is located in an embodiment of the present application is obtained;
[0015] Figure 6 A schematic diagram showing a picture including multiple pixels in an embodiment of the present application is shown;
[0016] Figure 7 A flowchart of a method for setting a background image proposed in another embodiment of the present application is shown;
[0017] Figure 8 A schematic diagram of a color wheel in an embodiment of the present application is shown;
[0018] Fig. 9 A structural block diagram of a device for setting a background image proposed in an embodiment of the present application is shown;
[0019] Fig.10A structural block diagram of an electronic device for executing a method for setting a background image according to an embodiment of the present application is shown;
[0020] Fig.11 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the method for setting a background image according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] In electronic devices, a content carrier can be understood as a carrier for displaying content, and the electronic device can display content through the content carrier. For example, the content carrier can be used to display time information, weather information, flight information, etc. Figure 1 As shown, flight information can be displayed through a content carrier.
[0023] However, the inventors found in the research that in the related methods, the background setting method corresponding to the content carrier needs to be improved. For example, the inventors found that in the related methods, the background of the content carrier is usually irrelevant to the environment in which the content carrier is located (for example, the interface in which the content carrier is located), which may cause the background of the content carrier to be inconsistent with the environment in which the content carrier is located. Therefore, the inventors proposed a method, device and electronic device for setting a background picture in the present application. In this method, after obtaining the interface background image of the interface in which the content carrier is located in response to the background setting instruction, the corresponding reference color can be obtained based on the interface background image to set the content carrier background image of the content carrier based on the reference color. Therefore, through the above method, when it is necessary to set the content carrier background image of the content carrier, the interface background image of the interface in which the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of background setting for the content carrier.
[0024] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0025] See also Figure 2 The present application provides a method for setting a background image, which is applied to an electronic device, and the method includes:
[0026] S110: In response to the background setting instruction, obtain an interface background image of the interface where the content carrier is located.
[0027] In an embodiment of the present application, the content carrier may be a card. In the case where the content carrier is a card, the content carrier background image may be understood as a card background image. The background setting instruction is an instruction for setting the content carrier background image of the content carrier. The content carrier background image may be understood as the background of the content carrier. In the case where the content carrier is provided with a content carrier background image, the content displayed in the content carrier may be stacked on the content carrier background image. In an embodiment of the present application, setting the content carrier background image of the content carrier may include replacing the content carrier background image of the content carrier, or, in the case where the content carrier is not currently provided with a content carrier background image, setting a content carrier background image for the content carrier. In the case where the content carrier is not provided with a content carrier background image, the background of the content carrier may be white.
[0028] As a method, the electronic device can generate the background setting instruction when detecting that the interface background image of the interface where the content carrier is located is changed, so as to adaptively update the content carrier background image of the content carrier. Exemplarily, when the content carrier is displayed on the desktop, if the user changes the desktop wallpaper (the background image of the desktop), the electronic device can generate the background setting instruction so that the content carrier background image of the content carrier can be synchronously updated so that the updated content carrier background image can adapt to the updated wallpaper.
[0029] S120: Acquire a corresponding reference color based on the interface background image.
[0030] In the embodiment of the present application, the reference color can be understood as the color distribution of most pixels in the interface background image. Therefore, the color distribution of pixels included in the interface background image can be understood through the reference color, and the content carrier background image can be set through the reference color.
[0031] S130: Setting a content carrier background image of the content carrier based on the reference color.
[0032] After determining the reference color corresponding to the interface background image, the corresponding content carrier background image can be set for the content carrier based on the reference color. In the embodiment of the present application, after obtaining the reference color, there can be multiple ways to set the content carrier background image.
[0033] As a method, after determining the reference color, a picture can be generated based on the reference color, and then the picture can be set as the content carrier background picture of the content carrier. Among them, the picture generated based on the reference color can at least include the reference color. Optionally, in the picture generated based on the reference color, the color of each pixel can be the reference color. Optionally, in the picture generated based on the reference color, the color of some pixels can be the reference color, and the color of other pixels can be a color close to the reference color.
[0034] As another way, after determining the reference color, the color value of each pixel in the current content carrier background image may be changed based on the reference color to change the color of the current content carrier background image, thereby changing the visual experience of the current content carrier image.
[0035] As another way, after determining the reference color, a pre-generated picture corresponding to the reference color can be obtained, and the picture can be set as the content carrier background picture of the content carrier. In an embodiment of the present application, a corresponding picture can be pre-configured corresponding to multiple colors, wherein the visual experience of the picture and the corresponding color is similar. For example, if a certain color gives the user a relatively dark visual experience, then the picture corresponding to the color will also be a dark-colored picture. For another example, if a certain color gives the user a relatively bright visual experience, then the picture corresponding to the color will also be a bright-colored picture.
[0036] For example, Figure 3 As shown, Figure 3 The left image shows the desktop 10 and the content carrier background image of the content carrier 20 before the wallpaper (the interface background image of the desktop) is updated. Figure 3 In the case shown in the right image, the electronic device will update the content carrier background image of the content carrier 20 based on the method provided in the embodiment of the present application, and the updated content carrier background image can be as shown in FIG. Figure 3 Shown in the image on the right.
[0037] The present embodiment provides a method for setting a background image. After obtaining the interface background image of the interface where the content carrier is located in response to a background setting instruction, the corresponding reference color can be obtained based on the interface background image to set the content carrier background image of the content carrier based on the reference color. Thus, through the above method, when it is necessary to set the content carrier background image of the content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image as a reference, thereby improving the flexibility of background setting for the content carrier.
[0038] See also Figure 4The present application provides a method for setting a background image, which is applied to an electronic device, and the method includes:
[0039] S210: In response to the background setting instruction, obtain an interface background image of the interface where the content carrier is located.
[0040] S220: Obtain color values of multiple pixels in the interface background image.
[0041] In this embodiment, the multiple pixels in the interface background image can be understood as each pixel in the interface background image. Alternatively, the multiple pixels in the interface background image can be understood as the multiple pixels in the target area in the interface where the content carrier is located, and the target area is the area corresponding to the content carrier in the interface where the content carrier is located. Optionally, the electronic device can divide the interface background image into multiple areas. In this case, the area where the content carrier is located can be used as the target area. For example, Figure 5 As shown, you can set the interface background Fig.10 The upper area 11 and the lower area 12 are divided into an upper area 11 and a lower area 12. When the content carrier 21 is detected to be located in the upper area 11, the upper area 11 can be used as the target area. Correspondingly, when the content carrier 21 is detected to be located in the lower area 12, the lower area 12 can be used as the target area.
[0042] It should be noted that for different interface background images, the image content included will be different, and the distribution of each pixel in the image will also be different. Therefore, there may be a situation where the color value that accounts for the majority of the interface background image is far away from the content carrier. In this case, if the reference color is still determined directly based on the overall pixel distribution in the interface background image, the final content carrier background image may not improve the user's visual experience. Figure 5 For example, the content carrier 21 is located in the interface background Fig.10 The upper part of the interface background image, while the colors that account for a large proportion of the interface background image may be mainly distributed in the interface background. Fig.10 In this case, if a color with a relatively large proportion is directly obtained as a reference color based on the overall interface background image, the re-set content carrier background image may not bring the expected visual improvement to the user. Therefore, determining the reference color by the color values of multiple pixels included in the target area is conducive to setting the content carrier background image of the content carrier by the reference color, which can actually bring about an improvement in the user's visual experience.
[0043] S230: Obtain corresponding reference colors based on the color values of the multiple pixels.
[0044] In the embodiments of the present application, there are multiple ways to obtain the reference color.
[0045] As a method, the average color value corresponding to the color values of the multiple pixels can be obtained, and the color corresponding to the average color value can be used as a reference color. It should be noted that each pixel in the image can correspond to a color, and the color corresponding to the pixel can be reflected by the color value. For example, in the case where the color value is an RGB (RGB color mode) color value, if the color value of the pixel is (0, 0, 0), the color corresponding to the pixel is black, and if the color value of the pixel is (255, 255, 255), the color corresponding to the pixel is white. In this way, the color values of multiple pixels can be averaged to obtain an average color value.
[0046] Optionally, when the color value is an RGB color value, the corresponding average value may be calculated for each color channel to obtain the average color value. Figure 6 As shown, in Figure 6 The multiple pixels shown include pixel P1, pixel P2, pixel P3, pixel P4, pixel P5, pixel P6, pixel P7, pixel P8 and pixel P9. Among them, the color value corresponding to pixel P1 can be (r1, g1, b1), the color value corresponding to pixel P2 can be (r2, g2, b2), the color value corresponding to pixel P3 can be (r3, g3, b3), the color value corresponding to pixel P4 can be (r4, g4, b4), the color value corresponding to pixel P5 can be (r5, g5, b5), the color value corresponding to pixel P6 can be (r6, g6, b6), the color value corresponding to pixel P7 can be (r7, g7, b7), the color value corresponding to pixel P8 can be (r8, g8, b8), and the color value corresponding to pixel P9 can be (r9, g9, b9). In this case, after calculating the average value based on each color channel, the average color value obtained can be:
[0047] ((r1+r2+r3+r4+r5+r6+r7+r8+r9) / ,(g1+g2+g3+g4+g5+g6+g7+g8+g9) / 9,(b1+b2+b3+b4+b5+b6+b7+b8+b9) / 9).
[0048] As another method, the color value with the largest proportion among the color values of the multiple pixels may be obtained, and the color corresponding to the color value with the largest proportion may be used as the reference color. In this method, the number of color values of the multiple pixels may be counted, and the color value with the largest number of corresponding values may be used as the color value with the largest proportion. For example, Figure 6 As shown, if Figure 6The color values of the multiple pixels shown in are: the color value corresponding to pixel P1 can be (r1, g1, b1), the color value corresponding to pixel P2 can be (r2, g2, b2), the color value corresponding to pixel P3 can be (r3, g3, b3), the color value corresponding to pixel P4 can be (r4, g4, b4), the color value corresponding to pixel P5 can be (r4, g4, b4), the color value corresponding to pixel P6 can be (r4, g4, b4), the color value corresponding to pixel P7 can be (r4, g4, b4), the color value corresponding to pixel P8 can be (r4, g4, b4), and the color value corresponding to pixel P9 can be (r4, g4, b4). In this case, it can be obtained that the color value (r4, g4, b4) accounts for the largest proportion, and then the color corresponding to the color value (r4, g4, b4) can be used as a reference color.
[0049] As another way, the color value with the largest proportion among the color values of the multiple pixels and the average color value corresponding to the color values of the multiple pixels can be simultaneously obtained, and then the average value is compared with the color value with the largest proportion to determine the reference color according to the comparison result. Optionally, if the difference between the color value with the largest proportion and the average value is less than a specified threshold, the color corresponding to the average color value is used as the reference color; if the difference between the color value with the largest proportion and the average value is not less than the specified threshold, the color corresponding to the color value with the largest proportion is used as the reference color.
[0050] S240: Setting a content carrier background image of the content carrier based on the reference color.
[0051] The present embodiment provides a method for setting a background image, so that through the above method, when it is necessary to set the background image of the content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of setting the background of the content carrier. In addition, in the present embodiment, the color values of multiple pixels in the interface background image can be obtained, and then the average value of the color values of the multiple pixels or the color value with the largest proportion is calculated as the reference color, thereby making the determined reference color more representative, thereby improving the accuracy of the determined content carrier background image.
[0052] See also Figure 7 The present application provides a method for setting a background image, which is applied to an electronic device, and the method includes:
[0053] S310: In response to the background setting instruction, obtain the interface background image of the interface where the content carrier is located.
[0054] S320: Acquire a corresponding reference color based on the interface background image.
[0055] S330: Acquire a standard color that is closest to the reference color.
[0056] In the embodiment of the present application, the standard color can be understood as a reference standard for determining the background image of the content carrier, and the closest standard color can be understood as the currently determined reference standard. After determining the reference standard, the final content carrier background image can be determined based on the reference standard.
[0057] Wherein, acquiring the standard color closest to the reference color may include: calculating the color difference between the reference color and the plurality of standard colors to be selected, and taking the standard color with the smallest color difference as the closest standard color.
[0058] Optionally, in the case where the color values corresponding to the reference color and the standard color are both multi-channel color values, the color difference values between the reference color and the multiple standard colors to be selected on the multiple channels can be obtained, and then the color difference values on the multiple channels can be added to obtain the color difference values corresponding to the reference color and the multiple standard colors to be selected. For example, in the case where the multi-channel color value corresponds to three color channels (the first color channel, the second color channel, and the third color channel), the first color difference value between the reference color and the multiple standard colors to be selected on the first color channel can be obtained first, the second color difference value between the reference color and the multiple standard colors to be selected on the second color channel can be obtained, and the third color difference value between the reference color and the multiple standard colors to be selected on the third color channel can be obtained, and then the first color difference value, the second color difference value, and the third color difference value can be added to obtain the color difference values corresponding to the reference color and the multiple standard colors to be selected.
[0059] Exemplarily, taking the multi-channel color value as RGB color value, in this case, the color difference between the reference color and multiple standard colors to be selected on the R channel can be obtained as the first color difference, the color difference between the reference color and multiple standard colors to be selected on the G channel can be obtained as the second color difference, and the color difference between the reference color and multiple standard colors to be selected on the B channel can be obtained as the third color difference.
[0060] It should be noted that in the embodiment of the present application, when calculating the difference between two colors, the color values of the two colors corresponding to the specified color space can be obtained first, and then the difference is calculated based on the color values of the two colors corresponding to the specified color space. The specified color space can be an HLS (Hue, Lightness, Saturation) color space.
[0061] S340: Acquire an associated color corresponding to the standard color, and obtain a content carrier background image of the content carrier based on the associated color.
[0062] In the embodiment of the present application, a corresponding associated color may be pre-configured for the standard color, wherein the associated color may be a color similar to the closest standard color, or the associated color may be a contrasting color to the closest standard color.
[0063] As a way, two colors (for example, a standard color and another color) are similar colors, which can be understood as the angle between the positions of the two colors in the color wheel is within a specified angle. The specified angle can be 60 degrees or 90 degrees. The color wheel is a long strip of color sequence seen in the color spectrum, but the ends are connected together, so that red is connected to purple at the other end. The color wheel can include 12 to 24 different colors. For example, Figure 8 The color wheel shown may have regions corresponding to different angles. For example, regions 30, 31, and 32 correspond to angles α. Region 40 corresponds to angle β, and region 50 corresponds to angle θ. Different regions in the color wheel represent different colors. The angle between the positions of two colors in the color wheel can be determined based on the regions of the two colors in the color wheel.
[0064] Among them, the areas of the two colors in the color wheel are in the circumferential direction ( Figure 8 In the case where the two colors are adjacent in the direction of the color wheel (in the direction indicated by the arrow in the middle), the angles corresponding to the areas where the two colors are located are added, and the angle between the positions of the two colors in the color wheel is obtained. Exemplarily, area 30 and area 40 are adjacent in the circumferential direction of the color wheel, and the angle between the colors corresponding to area 30 and area 40 is α+β. In the case where the areas of the two colors in the color wheel are not adjacent in the circumferential direction, the angles corresponding to the areas where the two colors are located can be added to obtain a first angle, and then the angles corresponding to the areas between the areas of the two colors in the color wheel in the circumferential direction can be added to obtain a second angle, and then the first angle and the second angle can be added to obtain the angle between the positions of the two colors in the color wheel. Exemplarily, the regions corresponding to the two colors may be region 31 and region 50, wherein region 31 and region 50 are not adjacent in the circumferential direction. In this case, the angles corresponding to region 31 and region 50 may be added first to obtain a first angle (α+θ), and then the angles corresponding to the region between region 31 and region 50 may be added to obtain a second angle (β+γ). The resulting included angle between region 31 and region 50 is (α+θ)+(β+γ).
[0065] As another way, two colors being similar can be understood as the difference between the color values corresponding to the two colors being small. Wherein, the small difference can be understood as the difference being less than a target threshold, and the target threshold can be preset. Optionally, the method for calculating the difference between the color values corresponding to the two colors can refer to the method for calculating the difference shown in the above content, which will not be repeated here.
[0066] In one way, two colors being contrasting colors can be understood as the angle between the positions of the two colors in the color wheel is outside a specified angle. The specified angle can be 60 degrees or 90 degrees. In another way, two colors being contrasting colors can be understood as the difference between the color values corresponding to the two colors is large. In other words, a large difference can be understood as a difference greater than a target threshold.
[0067] In an embodiment of the present application, a similar color correspondence relationship or a contrasting color correspondence relationship may be established. After determining the closest standard color, the similar color correspondence relationship and the contrasting color correspondence relationship may be used to determine the similar color or contrasting color of the closest standard color.
[0068] For example, the corresponding relationship of similar colors can be shown in the following table:
[0069] ID Standard colors Similar colors 1 C1 C4 2 C2 C5 3 C3 C6
[0070] Based on the above table, if the closest standard color determined is C2, then the close color determined is C5. If the closest standard color determined is C3, then the close color determined is C6.
[0071] When the associated colors can be similar colors or contrasting colors, the electronic device can use multiple methods to determine whether the content carrier background image is currently generated based on similar colors or contrasting colors.
[0072] As a method, the electronic device can determine whether to generate a content carrier background image based on similar colors or based on contrasting colors according to the user's configuration. Optionally, a color configuration interface can be provided in the electronic device, in which two options, similar colors and contrasting colors, can be provided. If the user selects a similar color, the electronic device will obtain the similar color corresponding to the closest standard color to generate the content carrier background image after determining the closest standard color. If the user selects a contrasting color, the electronic device will obtain the contrasting color corresponding to the closest standard color to generate the content carrier background image after determining the closest standard color.
[0073] As a method, the electronic device can determine whether to generate the content carrier background image based on similar colors or contrasting colors according to the current ambient brightness. It should be noted that when the ambient brightness is low, it means that the user may be in a dimly lit environment. In this case, configuring the content carrier background image to be similar to the interface background image of the interface is helpful in protecting the user's eyes from excessive stimulation. When the ambient brightness is high, it means that the user may be in a brightly lit environment. In this case, configuring the content carrier background image to be opposite to the interface background image of the interface is helpful in enabling the user to easily see the content in the content carrier.
[0074] Optionally, if the electronic device detects that the current ambient brightness is lower than the brightness threshold, the associated color corresponding to the standard color obtained is a similar color corresponding to the standard color. If the electronic device detects that the current ambient brightness is not lower than the brightness threshold, the associated color corresponding to the standard color obtained is a contrasting color corresponding to the standard color.
[0075] Wherein, obtaining the content carrier background image of the content carrier based on the associated color may include: generating a picture including at least the associated color as the content carrier background image of the content carrier.
[0076] Optionally, after obtaining the associated color, a content carrier background image can be obtained based on the associated color, wherein a picture including only the associated color can be generated as a content carrier associated image. For example, when the number of associated colors is one, a picture including only the associated color can be understood as a pure color picture. Exemplarily, when the associated color is blue, a pure color picture about blue can be generated as a content carrier background image. Exemplarily, when the associated color is black, a pure color picture about black can be generated as a content carrier background image.
[0077] In addition, after obtaining the associated colors, a picture of a gradient color can be generated based on the associated colors as the content carrier background map. Optionally, when the number of associated colors is multiple, a picture of a color gradient can be generated based on the multiple colors as the content carrier background map. In this case, the generated content carrier background map can include multiple associated colors, and colors that are gradiently changed between multiple associated colors. For example, in the generated content carrier background map, one associated color can be distributed at one end of the content carrier background map, another associated color can be distributed at the other end of the content carrier background map, and what is distributed between the two ends is the color involved in the process of transitioning from one associated color to another associated color.
[0078] Optionally, when there is only one associated color, a part of the associated color can be obtained, and then a color gradient picture is generated based on the associated color and the part of the similar color as the content carrier background image. In this case, the generated content carrier background image can include the associated color and the part of the similar color of the associated color, and the color that is gradiently changed between the associated color and the part of the similar color. For example, in the generated content carrier background image, the associated color can be distributed at one end of the content carrier background image, a similar color of the associated color can be distributed at the other end of the content carrier background image, and the colors involved in the process of transitioning from the associated color to the similar color are distributed between the two ends.
[0079] The present embodiment provides a method for setting a background image, so that, through the above method, when it is necessary to set the background image of the content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of setting the background of the content carrier. In addition, in the present embodiment, after obtaining the reference color, the standard color closest to the reference color is first determined, and then the associated color is obtained through the closest standard color, and then the content carrier background image of the content carrier is obtained based on the associated color.
[0080] See also Fig. 9 The present application provides a device 400 for setting a background image, which runs on an electronic device. The device 400 includes:
[0081] The interface background image acquisition unit 410 is used to acquire the interface background image of the interface where the content carrier is located in response to the background setting instruction.
[0082] As a method, the interface background image acquisition unit 410 is also used to generate a background setting instruction in response to a background image replacement operation.
[0083] The reference acquisition unit 420 is used to acquire a corresponding reference color based on the interface background image.
[0084] The content carrier background setting unit 430 is used to set a content carrier background image of the content carrier based on the reference color.
[0085] As one approach, the reference acquisition unit 420 is specifically used to acquire color values of multiple pixels in the interface background image; and obtain corresponding reference colors based on the color values of the multiple pixels.
[0086] Optionally, the reference acquisition unit 420 is specifically used to obtain an average color value corresponding to the color values of the multiple pixels, and use the color corresponding to the average color value as a reference color; or, obtain the color value with the largest proportion among the color values of the multiple pixels, and use the color corresponding to the color value with the largest proportion as a reference color.
[0087] Optionally, a reference acquisition unit 420 is specifically used to obtain the color value with the largest proportion among the color values of the multiple pixels and the average of the color values of the multiple pixels; if the difference between the color value with the largest proportion and the average value is less than a specified threshold, the color corresponding to the average color value is used as the reference color; if the difference between the color value with the largest proportion and the average value is not less than the specified threshold, the color corresponding to the color value with the largest proportion is used as the reference color.
[0088] As a method, the content carrier background setting unit 430 is specifically used to obtain a standard color closest to the reference color; obtain an associated color corresponding to the standard color, and obtain a content carrier background image of the content carrier based on the associated color.
[0089] Optionally, the content carrier background setting unit 430 is specifically used to generate a picture including at least the associated color as a content carrier background image of the content carrier. Optionally, the content carrier background setting unit 430 is specifically used to calculate the color difference between the reference color and the multiple standard colors to be selected; and use the standard color with the smallest color difference as the closest standard color.
[0090] This embodiment provides a device for setting a background image. Through the above device, when it is necessary to set the background image of a content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of background setting for the content carrier.
[0091] It should be noted that the device embodiments in the present application correspond to the aforementioned method embodiments, and the specific implementation principles of each unit in the device embodiments are similar to the principles in the aforementioned method embodiments. The specific contents in the device embodiments can be found in the method embodiments, and will not be repeated in the device embodiments.
[0092] The following will be combined Fig.10 An electronic device provided by the present application is described.
[0093] See also Fig.10Based on the above-mentioned method and device for setting a background image, the embodiment of the present application also provides an electronic device 1000 that can execute the above-mentioned method for setting a background image. The electronic device 1000 includes one or more (only one is shown in the figure) processors 105, a memory 104, an audio playback module 106, and an audio acquisition device 108 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above-mentioned embodiment, and the processor 105 can execute the program stored in the memory 104.
[0094] Among them, the processor 105 may include one or more processing cores. The processor 105 uses various interfaces and lines to connect various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 105 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 105 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 105, but may be implemented separately through a communication chip.
[0095] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.
[0096] Furthermore, in addition to the aforementioned components, the electronic device 1000 may further include a network module 110 and a sensor module 112 .
[0097] The network module 110 is used to realize information interaction between the electronic device 1000 and other devices. For example, a connection can be established with other audio playback devices or other electronic devices, and information interaction is performed based on the established connection. As a way, the network module 110 of the electronic device 1000 is a radio frequency module, which is used to receive and send electromagnetic waves, realize the mutual conversion of electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. For example, the radio frequency module can interact with external devices through electromagnetic waves sent or received.
[0098] The sensor module 112 may include at least one sensor. Specifically, the sensor module 112 may include but is not limited to: a pressure sensor, a motion sensor, an acceleration sensor, and other sensors.
[0099] Among them, the pressure sensor may be a sensor that detects the pressure generated by pressing on the electronic device 1000. That is, the pressure sensor detects the pressure generated by contact or pressing between the user and the electronic device 1000, for example, the pressure generated by contact or pressing between the user's ear and the electronic device 1000. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the electronic device 1000, and the magnitude of the pressure.
[0100] Among them, the acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of the electronic device 1000 (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. In addition, the electronic device 1000 can also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, etc., which will not be repeated here.
[0101] The audio collection device 110 is used to collect audio signals. Optionally, the audio collection device 110 includes a plurality of audio collection devices, which may be microphones.
[0102] Please refer to Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1100 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0103] The computer readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1110 can be compressed, for example, in an appropriate form.
[0104] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0105] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0106] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0107] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0108] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0109] In summary, the present application provides a method, device, and electronic device for setting a background image. After obtaining the interface background image of the interface where the content carrier is located in response to a background setting instruction, the corresponding reference color can be obtained based on the interface background image to set the content carrier background image of the content carrier based on the reference color. Thus, through the above method, when it is necessary to set the content carrier background image of the content carrier, the interface background image of the interface where the content carrier is located can be obtained, and the background image of the content carrier can be set based on the reference color corresponding to the interface background image, thereby improving the flexibility of background setting for the content carrier.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical feature diagrams therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for setting a background image, characterized in that: Applied to electronic equipment, the method comprises: In response to the background setting instruction, obtaining the interface background image of the interface where the content carrier is located; Acquire a corresponding reference color based on the interface background image; A content carrier background image of the content carrier is set based on the reference color.
2. The method according to claim 1, characterized in that The acquiring a corresponding reference color based on the interface background image includes: Obtain color values of multiple pixels in the interface background image; Based on the color values of the plurality of pixels, corresponding reference colors are obtained.
3. The method according to claim 2, characterized in that The obtaining corresponding reference colors based on the color values of the plurality of pixels comprises: Obtaining an average color value corresponding to the color values of the plurality of pixels, and using the color corresponding to the average color value as a reference color; Alternatively, a color value with the largest proportion among the color values of the multiple pixels is obtained, and a color corresponding to the color value with the largest proportion is used as a reference color.
4. The method according to claim 2, characterized in that: The obtaining corresponding reference colors based on the color values of the plurality of pixels comprises: Obtaining the color value with the largest proportion among the color values of the multiple pixels and the average corresponding to the color values of the multiple pixels; If the difference between the color value with the largest proportion and the average value is less than the specified threshold, the color corresponding to the average color value is used as the reference color. If the difference between the color value with the largest proportion and the average value is not less than the specified threshold, the color corresponding to the color value with the largest proportion is used as the reference color.
5. The method according to any one of claims 2 to 4, characterized in that: The plurality of pixels include each pixel in the interface where the content carrier is located.
6. The method according to any one of claims 2 to 4, characterized in that: The multiple pixels include multiple pixels in a target area in the interface where the content carrier is located, and the target area is an area in the interface where the content carrier is located that corresponds to the content carrier.
7. The method according to claim 1, characterized in that The step of setting a content carrier background image of the content carrier based on the reference color comprises: Obtaining a standard color that is closest to the reference color; An associated color corresponding to the standard color is acquired, and a content carrier background image of the content carrier is obtained based on the associated color.
8. The method according to claim 7, characterized in that The step of obtaining a content carrier background image of the content carrier based on the associated color includes: A picture at least including the associated colors is generated as a content carrier background picture of the content carrier.
9. The method according to claim 7, characterized in that: The obtaining of a standard color closest to the reference color comprises: Calculating a color difference between the reference color and the plurality of standard colors to be selected; The standard color with the smallest color difference is taken as the closest standard color.
10. The method according to claim 1, characterized in that Before the step of obtaining the interface background image of the interface where the content carrier is located in response to the background setting instruction, the step further includes: In response to the background image changing operation, a background setting instruction is generated.
11. A device for setting a background image, characterized in that: Running on an electronic device, the device comprises: An interface background image acquisition unit, used to acquire an interface background image of the interface where the content carrier is located in response to a background setting instruction; A reference acquisition unit, used to acquire a corresponding reference color based on the interface background image; The content carrier background setting unit is used to set a content carrier background image of the content carrier based on the reference color.
12. An electronic device, characterized in that: comprising one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing a program code executable by a processor, characterized in that: The computer-readable storage medium includes stored program code, wherein when the program code is executed, the method according to any one of claims 1 to 10 is executed.