[go: up one dir, main page]

CN110865862B - Page background setting method and device and electronic equipment - Google Patents

Page background setting method and device and electronic equipment Download PDF

Info

Publication number
CN110865862B
CN110865862B CN201911111909.3A CN201911111909A CN110865862B CN 110865862 B CN110865862 B CN 110865862B CN 201911111909 A CN201911111909 A CN 201911111909A CN 110865862 B CN110865862 B CN 110865862B
Authority
CN
China
Prior art keywords
main color
color element
preset
pixel
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911111909.3A
Other languages
Chinese (zh)
Other versions
CN110865862A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201911111909.3A priority Critical patent/CN110865862B/en
Publication of CN110865862A publication Critical patent/CN110865862A/en
Application granted granted Critical
Publication of CN110865862B publication Critical patent/CN110865862B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for setting page background and electronic equipment, wherein the method comprises the following steps: acquiring values of R, G, B three channels corresponding to each pixel of a theme picture in a page respectively; for each pixel, determining a candidate main color element corresponding to the pixel according to the values of the R, G, B three channels corresponding to the pixel; for each candidate main color element, determining the number of pixels corresponding to the candidate main color element; determining whether each candidate main color element meets a preset visual attribute condition; determining candidate main color elements meeting preset visual attribute conditions and corresponding pixel quantity meeting preset conditions as main color elements of the theme pictures; the main color element is used as the main color element of the page background, and the color attribute of the main color element is set in the preset area of the page according to the preset rule, so that the main color element is gradually changed in the preset area, the visual effect of the page is optimized, and the user experience is improved.

Description

Page background setting method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a page background setting method and device and electronic equipment.
Background
The page background is mainly used for creating a more interesting Word document background, the Web layout view and the reading layout view can display the background, and elements such as gradual change, patterns, pictures, solid colors or textures can be applied to the background, and the elements are tiled or repeated to fill the page.
In general, in setting the page background, the color of the page background may be set by a user or a developer.
Disclosure of Invention
This disclosure is provided in part to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a page background setting method, a page background setting device and electronic equipment, which coordinate the tone of a theme picture and a public page, thereby optimizing the visual effect of the page and improving the user experience.
In a first aspect, an embodiment of the present disclosure provides a method for setting a page context, including: acquiring values of R, G, B three channels corresponding to each pixel of a theme picture in a page respectively; for each pixel, determining a candidate main color element corresponding to the pixel according to the values of the R, G, B three channels corresponding to the pixel; for each candidate main color element, determining the number of pixels corresponding to the candidate main color element; determining whether each candidate main color element meets a preset visual attribute condition; determining candidate main color elements meeting the preset visual attribute conditions and the corresponding pixel quantity meeting the preset conditions as main color elements of the theme pictures; and taking the main color element as the main color element of the page background, and setting the color attribute of the main color element in a preset area of the page according to a preset rule, so that the main color element gradually changes in the preset area.
In a second aspect, an embodiment of the present disclosure provides a page context setting apparatus, including: the acquisition module is used for acquiring values of R, G, B three channels corresponding to each pixel of the theme picture in the page respectively; a first determining module, configured to determine, for each pixel, a candidate main color element corresponding to the pixel according to values of three R, G, B channels corresponding to the pixel; a second determining module, configured to determine, for each candidate main color element, a number of pixels corresponding to the candidate main color element; a third determining module, configured to determine whether each candidate primary color element meets a preset visual attribute condition; a fourth determining module, configured to determine, as a main color element of the theme picture, a candidate main color element that satisfies the preset visual attribute condition and the corresponding pixel number satisfies the preset condition; the setting module is used for taking the main color element as the main color element of the page background, and setting the color attribute of the main color element in a preset area of the page according to a preset rule, so that the main color element is gradually changed in the preset area.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the page background setting method of the first aspect.
In a fourth aspect, an embodiment of the present disclosure provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the page background setting method described in the first aspect.
According to the page background setting method, the page background setting device and the electronic equipment, the main color element corresponding to the theme picture in the page is obtained and is used as the main color element of the page background, and the color attribute of the main color element is set in the preset area of the page according to the preset rule, so that the main color element is gradually changed in the preset area, the theme picture is coordinated with the color tone of the public page, the visual effect of the page is optimized, and the user experience is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of one embodiment of a page background setting method according to the present disclosure;
FIG. 2 is a schematic flow chart of obtaining candidate dominant color elements in accordance with the present disclosure;
FIG. 3 is a schematic flow chart of determining candidate dominant color elements in accordance with the present disclosure;
FIG. 4 is a schematic diagram of the structure of one embodiment of a page background setting apparatus according to the present disclosure;
FIG. 5 is an exemplary system architecture to which the page background setting method of one embodiment of the present disclosure may be applied;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other.
Referring to FIG. 1, a flow chart of one embodiment of a page background setting method according to the present disclosure is shown. As shown in fig. 1, the page background setting method includes the steps of:
step 101, obtaining values of R, G, B three channels corresponding to each pixel of the theme picture in the page.
The page here may be a Web page, a page of an application program, or the like.
At least one picture may be included in the page. The subject picture may be one of the at least one picture having the largest number of pixels, may be a picture located in a designated area of the page (e.g., a middle area of the page), or may be a picture determined from the at least one picture by a user's selection operation.
The theme pictures can be arbitrarily selected according to the requirements of users. In some application scenarios, the theme pictures may be head portrait pictures displayed by the user on the page. The page background generated by using the head portrait picture of the user is easier to distinguish the user and display the uniqueness of the corresponding user.
In some application scenarios, the page may be obtained by a user clicking, e.g., the user clicks on a page recommended by the browser, or the user enters a page address in an address bar and clicks to load the corresponding page, it being understood that user clicking should be construed broadly herein, including mouse clicking (e.g., using a mouse operation in a PC), keyboard input (e.g., using the Enter key in a PC), gesture operation (e.g., user clicking via a gesture in a display screen of the mobile terminal), mobile terminal key operation, etc.; in other application scenarios, pages may also be opened by browser hopping, including browser automatic hopping or user click link address hopping, etc.
For each pixel, the pixel value of the pixel can be divided into Red (Red, R), green (Green, G), blue (Blue, B) three primary color components.
The R, G, B three primary color component of each pixel may be generally referred to as R, G, B three channel component.
Existing methods for extracting pixel values of images can be used to obtain R, G, B three-channel values corresponding to pixels of a subject picture in a page.
The above method for extracting the pixel value of the image is a method widely studied and applied at present, and is not described herein.
Step 102, for each pixel, determining a candidate main color element corresponding to the pixel according to the values of the R, G, B three channels corresponding to the pixel.
A plurality of candidate dominant color elements may be set in advance. And then determining the candidate main color element corresponding to the pixel according to the pixel value of the pixel.
In practice, a plurality of candidate dominant color elements may be obtained by the steps shown in fig. 2 below:
and step A101, for each of the three R, B, G channels, dividing the value range between the maximum value and the minimum value corresponding to the channel into N areas.
The maximum value here may be 255 and the minimum value may be 0. The above-described division may divide the range of values between the maximum value and the minimum value of the R channel into N regions, the range of values between the maximum value and the minimum value of the G channel into N regions, and the range of values between the maximum value and the minimum value of the B channel into N regions.
Step a102, for each region, maps the values in the region to a representative value.
For example, if the value range between the maximum value and the minimum value of the G channel is divided into 16 regions, the value of the first region includes 0 to 15, the value of the second region includes 16 to 31, the value of the third region includes 32 to 47 … …, each value in the first region may be mapped to a representative value 1, each value in the second region may be mapped to a representative value 2, each value in the third region may be mapped to a representative value 3 … …, and thus, the values in the value ranges of the 16 regions may be mapped to one representative value.
Step A103, combining N representative values corresponding to the R, G, B three channels respectively to obtain N multiplied by N representative value combinations, wherein each combination corresponds to a candidate main color element.
In this way the first and second light sources, there may be N x N candidate dominant color elements.
Further, the candidate main element corresponding to the pixel may be determined by the steps shown in fig. 3:
step B101, for each of the three R, G, B channels of the pixel, determining a target region of the N regions corresponding to the value of the channel.
Step B102, determining a representative value combination corresponding to the R, G, B three-channel values of the pixel according to the target areas corresponding to the R, G, B three-channel values, and determining a candidate main color element corresponding to the pixel according to the representative value combination.
The value range of N may be 8-32, i.e. the value range between the maximum value and the minimum value corresponding to each of the three R, G, B channels is divided into 8-32 regions.
Further, N regions in which the value range between the maximum value and the minimum value corresponding to each channel is divided may be represented by granularity values. I.e., for each channel in R, G, B, the channel is divided into N granularities. N may take a value between 8 and 32. For each determined N value, then the granularity value into which each channel is divided is also determined.
Further, the value range between the maximum value and the minimum value corresponding to each channel is divided into more areas by the value N in the value range, so that the number of the obtained candidate main color elements is more, and more accurate color interval division can be performed on the picture.
When N is smaller than 8, the number of divided areas of the value ranges corresponding to the channels is too small, so that the distinction degree of different colors of the picture is poor.
When N is greater than 32, excessive distinction of different colors of the picture is caused, and the number of candidate main color elements is excessive, so that the display effect of the main color elements selected from the candidate main color elements is not facilitated.
Step 103, for each candidate primary color element, determining the number of pixels corresponding to the candidate primary color element.
After obtaining the candidate main color elements corresponding to each pixel of the theme picture, the number of pixels corresponding to each candidate main color element can be detected, and all the candidate main color elements are arranged in a descending order according to the number of the pixels, so that the main color elements are determined as soon as possible.
Step 104, determining whether each candidate main color element meets the preset visual attribute condition.
Step 105, determining the candidate main color element satisfying the preset visual attribute condition and the corresponding pixel number satisfying the preset condition as the main color element of the theme picture.
Visual attributes of a color may include saturation (color saturation), brightness, hue, and the like. A preset visual attribute condition may be set for each visual attribute. And for the candidate main color element, determining whether each visual attribute value corresponding to the candidate main color element meets a preset visual attribute condition. And determining the candidate main color element of which the corresponding visual attribute value meets the preset visual attribute condition and the corresponding pixel number meets the preset condition as the main color element of the theme picture.
In some application scenarios, preset visual property conditions may be set for saturation and brightness. In these application scenarios, it may be determined, for each candidate primary color element, whether the saturation and the brightness of the candidate primary color element meet a preset saturation condition and a preset brightness condition, respectively.
Candidate main color elements which meet the preset visual attribute condition and the corresponding pixel number is 5% -12% of the total pixel number contained in the picture can be determined as main color elements of the theme picture, so that visual effects visible to naked eyes are obtained.
The main color element may be at least one color value determined from a color value of a pixel of the subject picture. In some application scenarios, the main color element may be determined according to the number of pixels corresponding to the color value of each color included in the theme picture, for example, the color value with the largest number of corresponding pixels is determined as the main color element. In other application scenarios, the primary color element may be determined according to a color value of a color corresponding to a key object in the theme picture. The key object may be an object located in the middle area of the theme picture, or may be an object with the largest number of included pixels.
In some application scenarios, the visual attributes include saturation and brightness. In these application scenarios, the step 104 may include determining whether the saturation of each candidate primary color element meets a preset saturation condition, and whether the brightness meets a preset brightness condition. The step 105 may include determining, as the main color element of the subject picture, a candidate main color element having a saturation that satisfies a preset saturation condition, a brightness that satisfies a preset brightness condition, and a corresponding number of pixels that satisfies the preset condition.
In some alternative implementations, the preset saturation condition is that the saturation is between 30% and 100%, preferably, when the saturation is less than 40%, the saturation is set to 40% so as to increase the color component of the page and optimize the visual effect; when the saturation is greater than 90%, the saturation is set to 90% to reduce the decoloring component in the page and optimize the visual effect.
The preset brightness condition is that the brightness is between 0 and 100 percent, and preferably, when the brightness is more than 85 percent, the brightness is set to be 85 percent so as to reduce the brightness of the page and optimize the visual effect.
And 106, taking the main color element as the main color element of the page background, and setting the color attribute of the main color element in a preset area of the page according to a preset rule so that the main color element gradually changes in the preset area.
Further, determining a main color element from the theme picture, taking the main color element as a background color of the upper half screen of the page, and gradually changing the background color from deep to light or from light to deep so as to realize transition and connection of the page background and the color elements of the public page.
In general, there are multiple colors in the theme pictures, if the colors in the page are not related to the colors in the theme pictures, the colors of the theme pictures and the page background are not coordinated, so that the phenomenon of splitting the theme pictures and the page occurs, and the visual effect of the page is reduced.
According to the method provided by the embodiment of the invention, the main color element corresponding to the theme picture in the page is obtained and is used as the main color element of the page background, the color attribute of the main color element is set in the preset area of the page according to the preset rule, so that the main color element is gradually changed in the preset area, the theme picture is coordinated with the tone of the public page, the visual effect of the page is optimized, and the user experience is improved.
Referring to fig. 4, there is shown a schematic structural diagram of one embodiment of a page background setting apparatus according to the present disclosure, which includes, as shown in fig. 4, an acquisition module 401, a first determination module 402, a second determination module 403, a third determination module 404, a fourth determination module 405, and a setting module 406. The acquiring module 401 is configured to acquire values of three R, G, B channels corresponding to each pixel of the theme picture in the page; a first determining module 402, configured to determine, for each pixel, a candidate main color element corresponding to the pixel according to values of three R, G, B channels corresponding to the pixel; a second determining module 403, configured to determine, for each candidate main color element, a number of pixels corresponding to the candidate main color element; a third determining module 404, configured to determine whether each candidate primary color element meets a preset visual attribute condition; a fourth determining module 405, configured to determine, as a main color element of the theme picture, a candidate main color element that satisfies a preset visual attribute condition and the corresponding number of pixels satisfies the preset condition; the setting module 406 is configured to take the main color element as a main color element of the page background, and set color attributes of the main color element in a preset area of the page according to a preset rule, so that the main color element is gradually changed in the preset area.
It should be noted that, the specific processes and the technical effects brought by the acquiring module 401, the first determining module 402, the second determining module 403, the third determining module 404, the fourth determining module 405 and the setting module 406 of the page background setting device may refer to the related descriptions of the step 101, the step 102, the step 103, the step 104, the step 105 and the step 106 in the corresponding embodiment of fig. 1, and are not repeated herein.
In some optional implementations of this embodiment, the page background setting apparatus further includes a candidate dominant color element determination module. The candidate dominant color element determination module is configured to obtain a candidate dominant color element based on: for each of the three R, G, B channels, dividing a value range between a maximum value and a minimum value corresponding to the channel into N areas; for each region, mapping the values in the region to a representative value; and combining N representative values corresponding to the R, G, B three channels respectively to obtain N multiplied by N representative value combinations, wherein each combination corresponds to a candidate main color element.
In some optional implementations of this embodiment, the first determining module 402 is further configured to: for each of the three R, G, B channels, dividing a value range between a maximum value and a minimum value corresponding to the channel into N areas; for each region, mapping the values in the region to a representative value; and combining N representative values corresponding to the R, G, B three channels respectively to obtain N multiplied by N representative value combinations, wherein each combination corresponds to a candidate main color element.
In some optional implementations of this embodiment, the first determining module 402 is further configured to: for each of the R, G, B three channels of the pixel, determining a target region of the N regions corresponding to the value of the channel; and determining a representative value combination corresponding to the R, G, B three-channel values of the pixel according to the target area corresponding to each of the R, G, B three-channel values, and determining a candidate main color element corresponding to the pixel according to the representative value combination.
In some alternative implementations of this embodiment, N ranges from 8 to 32.
In some optional implementations of this embodiment, the fourth determining module 405 is further configured to: and determining candidate main color elements which meet the preset visual attribute condition and the corresponding pixel number is 5% -12% of the total pixel number contained in the picture as main color elements of the theme picture.
In some alternative implementations of the present embodiment, the visual attributes may include saturation and brightness; and, the third determination module 404 is further to: determining whether the saturation of each candidate main color element meets a preset saturation condition and whether the brightness meets a preset brightness condition; and, the fourth determination module 405 is further configured to: and determining the candidate main color elements with the saturation meeting the preset saturation condition, the brightness meeting the preset brightness condition and the corresponding pixel quantity meeting the preset condition as main color elements of the theme picture.
In some optional implementations of this embodiment, the preset saturation condition is that the saturation is between 30% and 100%, and the preset brightness condition is that the brightness is between 0% and 100%.
The operation of the page background setting apparatus will be specifically described below by way of an example.
Taking a page, the content of the selected theme picture is that a white cloud is floated in the blue sky.
First, the obtaining module 401 obtains values of R, G, B three channels corresponding to all pixels in the subject picture, the first determining module 402, for each channel of R, G, B corresponding to each pixel, dividing a value range between a maximum value and a minimum value corresponding to the channel into 16 areas, mapping the 16 areas into a fixed representative value respectively, and combining the representative values obtained by the three channels respectively to obtain 16 x 16 candidate main color elements.
Then, if it is determined that the white clouds in the subject picture can be divided into five candidate main color elements (white 1, white 2, white 3, white 4, and white 5) with different gradients based on the granularity value, and the blue sky can be divided into five candidate main color elements (blue 1, blue 2, blue 3, blue 4, and blue 5) with different gradients.
Next, the second determining module 403 detects the numbers of pixels corresponding to the five candidate main color elements of the white cloud and the five candidate main color elements of the blue sky, and sorts the ten candidate main color elements in descending order according to the numbers of the pixels, and if the order is blue 1, blue 2, blue 3, blue 4, blue 5, white 1, white 2, white 3, white 4 and white 5, the third determining module 404 determines whether the blue 1 satisfies the preset visual attribute condition, that is, detects whether the numbers of pixels, the saturation and the brightness corresponding to the blue 1 are all within the preset range. If at the fourth determination module 405 sets blue 1 as the primary color element of the theme picture. And setting the color attribute of blue 1 in the upper half screen of the page according to a preset rule by the setting module 406, so that blue 1 gradually changes in the upper half screen of the page.
If the third determining module 404 detects that any parameter of the saturation and the brightness of the blue 1 does not meet the corresponding preset range, it further detects whether the saturation and the brightness corresponding to the blue 2 are within the preset range, so as to determine whether the blue 2 can be set as the main color element of the background of the page.
And so on until a primary color element is found that meets the preset requirements.
Referring to fig. 5, an exemplary system architecture to which the page background setting method of one embodiment of the present disclosure may be applied is shown.
As shown in fig. 5, the system architecture may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The terminal devices and servers described above may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The terminal devices 501, 502, 503 may interact with the server 505 via the network 504 to receive or send messages or the like. Various client applications, such as a video distribution application, a search class application, a news information class application, may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be hardware or software. When the terminal devices 501, 502, 503 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like. When the terminal devices 501, 502, 503 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 505 may be a server that can provide various services, for example, receives video acquisition requests transmitted from the terminal devices 501, 502, 503, analyzes the video acquisition requests, and transmits analysis processing results (for example, video data corresponding to the above-described acquisition requests) to the terminal devices 501, 502, 503.
It should be noted that, the method for setting a page background provided by the embodiments of the present disclosure may be performed by the server 505, and accordingly, the device for setting a page background may be set in the server 505. Or by the terminal devices 501, 502, 503, and accordingly, the page background setting means may be provided in the terminal devices 501, 502, 503.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., the server of fig. 5) suitable for use in implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring values of R, G, B three channels corresponding to each pixel of a theme picture in a page respectively; for each pixel, determining a candidate main color element corresponding to the pixel according to the values of the R, G, B three channels corresponding to the pixel; for each candidate main color element, determining the number of pixels corresponding to the candidate main color element; determining whether each candidate main color element meets a preset visual attribute condition; determining candidate main color elements meeting preset visual attribute conditions and corresponding pixel quantity meeting preset conditions as main color elements of the theme pictures; and taking the main color element as the main color element of the page background, and setting the color attribute of the main color element in a preset area of the page according to a preset rule, so that the main color element gradually changes in the preset area.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the module is not limited to the unit itself in some cases, and for example, the acquisition module may also be described as "a module for acquiring values of R, G, B three channels corresponding to each pixel of the subject picture in the page".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (8)

1. A page background setting method, characterized by comprising:
acquiring values of R, G, B three channels corresponding to each pixel of a theme picture in a page respectively;
for each pixel, determining a candidate main color element corresponding to the pixel according to the values of the R, G, B three channels corresponding to the pixel;
for each candidate main color element, determining the number of pixels corresponding to the candidate main color element;
determining whether each candidate main color element meets a preset visual attribute condition;
determining candidate main color elements meeting the preset visual attribute conditions and the corresponding pixel quantity meeting the preset conditions as main color elements of the theme pictures;
the main color element is used as the main color element of the page background, and the color attribute of the main color element is set in a preset area of the page according to a preset rule, so that the main color element is gradually changed in the preset area;
wherein the candidate dominant color element is obtained based on the following steps:
for each of the three R, G, B channels, dividing a value range between a maximum value and a minimum value corresponding to the channel into N areas;
for each region, mapping the values in the region to a representative value;
and combining N representative values corresponding to the R, G, B three channels respectively to obtain N multiplied by N representative value combinations, wherein each combination corresponds to a candidate main color element.
2. The method of claim 1, wherein for each pixel, determining the candidate dominant color element for the pixel based on the R, G, B three-channel value for the pixel comprises:
for each of the R, G, B three channels of the pixel, determining a target region of the N regions corresponding to the value of the channel;
and determining a representative value combination corresponding to the R, G, B three-channel values of the pixel according to the target area corresponding to each of the R, G, B three-channel values, and determining a candidate main color element corresponding to the pixel according to the representative value combination.
3. The method according to claim 1, characterized in that: the value range of N is 8-32.
4. The method according to claim 1, wherein determining the candidate main color element that satisfies the preset visual attribute condition and the corresponding number of pixels satisfies the preset condition as the main color element of the theme picture includes:
and determining candidate main color elements which meet the preset visual attribute condition and the corresponding pixel number is 5% -12% of the total pixel number contained in the picture as main color elements of the theme picture.
5. The method of claim 1, wherein the visual attributes include saturation and brightness; and
the determining whether each candidate dominant color element meets a preset visual attribute condition includes:
determining whether the saturation of each candidate main color element meets a preset saturation condition and whether the brightness meets a preset brightness condition; and
the determining the candidate main color element meeting the preset visual attribute condition and the corresponding pixel number meeting the preset condition as the main color element of the theme picture includes:
and determining candidate main color elements with saturation meeting a preset saturation condition, brightness meeting a preset brightness condition and the corresponding pixel number meeting the preset condition as main color elements of the theme picture.
6. A page background setting device, characterized by comprising:
the acquisition module is used for acquiring values of R, G, B three channels corresponding to each pixel of the theme picture in the page respectively;
a first determining module, configured to determine, for each pixel, a candidate main color element corresponding to the pixel according to values of three R, G, B channels corresponding to the pixel;
a second determining module, configured to determine, for each candidate main color element, a number of pixels corresponding to the candidate main color element;
a third determining module, configured to determine whether each candidate primary color element meets a preset visual attribute condition;
a fourth determining module, configured to determine, as a main color element of the theme picture, a candidate main color element that satisfies the preset visual attribute condition and the corresponding pixel number satisfies the preset condition;
the setting module is used for taking the main color element as the main color element of the page background, and setting the color attribute of the main color element in a preset area of the page according to a preset rule so that the main color element is gradually changed in the preset area;
wherein the candidate dominant color element is obtained based on the following steps:
for each of the three R, G, B channels, dividing a value range between a maximum value and a minimum value corresponding to the channel into N areas;
for each region, mapping the values in the region to a representative value;
and combining N representative values corresponding to the R, G, B three channels respectively to obtain N multiplied by N representative value combinations, wherein each combination corresponds to a candidate main color element.
7. An electronic device, comprising:
one or more processors;
storage means having stored thereon one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
8. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN201911111909.3A 2019-11-13 2019-11-13 Page background setting method and device and electronic equipment Active CN110865862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911111909.3A CN110865862B (en) 2019-11-13 2019-11-13 Page background setting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911111909.3A CN110865862B (en) 2019-11-13 2019-11-13 Page background setting method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110865862A CN110865862A (en) 2020-03-06
CN110865862B true CN110865862B (en) 2023-04-28

Family

ID=69654801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911111909.3A Active CN110865862B (en) 2019-11-13 2019-11-13 Page background setting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110865862B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112037303A (en) * 2020-08-31 2020-12-04 深圳市欢太科技有限公司 Card background color generation method, device, equipment and medium for theme display cards
CN112069340B (en) * 2020-09-04 2024-12-27 抖音视界有限公司 Background image processing and search result display method, device, equipment and medium
CN112579962A (en) * 2020-12-29 2021-03-30 五八有限公司 Webpage color adjusting method and device, electronic equipment and computer readable medium
CN113656134B (en) * 2021-08-17 2023-08-04 北京百度网讯科技有限公司 Color matching method, device, equipment and storage medium for interface element
CN113886726A (en) * 2021-10-27 2022-01-04 北京达佳互联信息技术有限公司 Page display method and device, electronic equipment and storage medium
CN114119783B (en) * 2021-12-08 2025-05-06 掌阅科技股份有限公司 Image processing method, electronic device and computer storage medium
CN114416089A (en) * 2022-01-19 2022-04-29 惠州Tcl移动通信有限公司 Page display method, device, mobile terminal and storage medium
CN116188608B (en) * 2022-12-27 2024-03-12 上海元彩科技有限公司 Method and device for arranging colors in plane
CN116033638B (en) * 2023-03-30 2023-06-13 深圳市智岩科技有限公司 Light control method, device, product, medium and light control equipment
CN117315172B (en) * 2023-09-22 2024-04-12 鲸数科技(北京)有限公司 Map page configuration method, map page configuration device, electronic equipment and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6963425B1 (en) * 2000-08-14 2005-11-08 National Instruments Corporation System and method for locating color and pattern match regions in a target image
CN109783182A (en) * 2019-02-15 2019-05-21 百度在线网络技术(北京)有限公司 A kind of method of adjustment, device, equipment and the medium of page subject matter tone
CN110210532A (en) * 2019-05-15 2019-09-06 北京字节跳动网络技术有限公司 Background colour generation method, device and electronic equipment
CN110377860A (en) * 2019-07-18 2019-10-25 百度(中国)有限公司 A kind of page color method of adjustment, device and electronic equipment
WO2020138803A1 (en) * 2018-12-24 2020-07-02 (주)제이엘케이 Image analysis device and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7046842B2 (en) * 1999-08-17 2006-05-16 National Instruments Corporation System and method for color characterization using fuzzy pixel classification with application in color matching and color match location
US10181192B1 (en) * 2017-06-30 2019-01-15 Canon Kabushiki Kaisha Background modelling of sport videos

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6963425B1 (en) * 2000-08-14 2005-11-08 National Instruments Corporation System and method for locating color and pattern match regions in a target image
WO2020138803A1 (en) * 2018-12-24 2020-07-02 (주)제이엘케이 Image analysis device and method
CN109783182A (en) * 2019-02-15 2019-05-21 百度在线网络技术(北京)有限公司 A kind of method of adjustment, device, equipment and the medium of page subject matter tone
CN110210532A (en) * 2019-05-15 2019-09-06 北京字节跳动网络技术有限公司 Background colour generation method, device and electronic equipment
CN110377860A (en) * 2019-07-18 2019-10-25 百度(中国)有限公司 A kind of page color method of adjustment, device and electronic equipment

Also Published As

Publication number Publication date
CN110865862A (en) 2020-03-06

Similar Documents

Publication Publication Date Title
CN110865862B (en) Page background setting method and device and electronic equipment
CN111260601B (en) Image fusion method and device, readable medium and electronic equipment
CN110211030B (en) Image generation method and device
KR102360271B1 (en) Methods and devices for determining the color of a text
CN113742025A (en) Page generation method, device, equipment and storage medium
CN111796825B (en) Bullet screen drawing method, bullet screen drawing device, bullet screen drawing equipment and storage medium
CN116459508A (en) Special effect prop generation method, picture processing method and device and electronic equipment
CN110097520B (en) Image processing method and device
CN113961280B (en) View display method and device, electronic equipment and computer readable storage medium
CN112579962A (en) Webpage color adjusting method and device, electronic equipment and computer readable medium
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN111461965B (en) Picture processing method and device, electronic equipment and computer readable medium
CN110399802B (en) Method, apparatus, medium, and electronic device for processing eye brightness of face image
CN110636331B (en) Method and apparatus for processing video
WO2024193632A1 (en) Data large-screen page processing method and apparatus, and related device
US20230360286A1 (en) Image processing method and apparatus, electronic device and storage medium
CN117234650A (en) Image display method and device, storage medium and electronic equipment
US20250157180A1 (en) Subject material determination method and apparatus, and electronic device and storage medium
CN110599394A (en) Method and device for processing pictures in online presentation, storage medium and equipment
EP4283973A1 (en) Image brightness adjustment method and apparatus, and electronic device and medium
CN112801997B (en) Image enhancement quality evaluation method, device, electronic equipment and storage medium
CN114416089A (en) Page display method, device, mobile terminal and storage medium
CN111199519B (en) Method and device for generating special effect package
CN113989404A (en) Image processing method, apparatus, device, storage medium and program product
CN111223105B (en) Image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant