CN106445970B - Loading processing method and device for placeholder map - Google Patents
Loading processing method and device for placeholder map Download PDFInfo
- Publication number
- CN106445970B CN106445970B CN201510490535.6A CN201510490535A CN106445970B CN 106445970 B CN106445970 B CN 106445970B CN 201510490535 A CN201510490535 A CN 201510490535A CN 106445970 B CN106445970 B CN 106445970B
- Authority
- CN
- China
- Prior art keywords
- color
- picture
- dominant
- sub
- loading
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention discloses a loading processing method and a loading processing device for a placeholder map, which are used for improving the loading speed of the placeholder map and meeting the requirement that a user knows an original picture to be loaded in advance. The method provided by the embodiment of the invention comprises the following steps: acquiring a main tone corresponding to a picture needing delayed loading; setting colors occupying the bitmap according to the dominant hue; and loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a loading processing method and device of a placeholder map.
Background
With the rapid development of multimedia technology, a user can obtain more and more pictures from a network, but the pictures occupy more information resources relative to texts, so that a certain storage space is required for storing the pictures, therefore, when the pictures are loaded to a certain position of a webpage from the network, a occupied bitmap is required to be occupied before the pictures in the webpage are not loaded, and currently, a commonly used method for loading the occupied map mainly comprises the following two schemes.
1. The method is used for loading a known small picture at the picture position of the webpage.
The known picture with a small storage space is preloaded at the position where the image needs to be loaded in the webpage, for example, the known picture can be an identification picture of a website domain name symbol, and the original picture is displayed to a user after the original picture is loaded successfully.
The above-described prior art enables a user to determine that a picture is being loaded by providing the user with a known small picture, so that the user can expect the upcoming picture. However, the known small pictures are the same before all the pictures are loaded, which makes the interface of the web page monotonous and easily causes the user to lose interest and wait patience.
2. A method for loading a thumbnail corresponding to an original picture at a picture position of a webpage.
Before the original pictures are loaded, a thumbnail corresponding to the original pictures and occupying a small storage space is stored in advance, the thumbnail is displayed at the picture position in an amplification mode when the thumbnail is loaded, a user can know the original pictures which are being loaded in advance, and the original pictures are displayed to the user after the original pictures are loaded successfully. To further compress the storage space, the thumbnail may also be set to a black and white picture.
The above prior art can load the image preview of the original image to the user, so that the user can know the upcoming original image in advance. Although the thumbnail has been compressed compared to the original picture, the information of the content that needs to be loaded when loading the thumbnail is so large that the loading speed of the thumbnail is slow.
Disclosure of Invention
The embodiment of the invention provides a loading processing method and device of an occupation bitmap, which are used for improving the loading speed of the occupation bitmap and meeting the requirement that a user knows an original picture needing to be loaded in advance.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for loading and processing a placeholder map, including:
acquiring a main tone corresponding to a picture needing delayed loading;
setting colors occupying the bitmap according to the dominant hue;
and loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture.
In a second aspect, an embodiment of the present invention further provides a device for processing loading of a occupied bitmap, where the device includes:
the dominant color acquisition module is used for acquiring a dominant color tone corresponding to the picture needing to be loaded in a delayed manner;
the color setting module is used for setting the colors of the occupied bitmap according to the dominant hue;
and the occupation bitmap loading module is used for loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, the corresponding dominant hue of the picture needing to be loaded in a delayed mode is firstly obtained, then the color of the occupation bitmap is set according to the dominant hue, and finally the occupation bitmap after the color setting is finished is loaded on the display position corresponding to the picture. In the embodiment of the invention, the colors of the occupation bitmap can be set according to the main tone corresponding to the picture, so the occupation bitmap with the set colors can be loaded at the display position corresponding to the picture before the picture is loaded, so that no known thumbnail picture is displayed at the picture display position, and no thumbnail picture is displayed, but a colored occupying picture map is displayed, the color of the occupying bitmap is determined by the corresponding main tone of the picture being loaded, so that the occupying bitmap can reflect the color attribute of the picture being loaded, a user can see the color of the occupying bitmap before seeing the original picture, the requirement of the user on knowing the picture in advance is met, in addition, the colors of the occupying bitmap are displayed at the corresponding display positions of the pictures, the color values of the occupying bitmap can be completed only by occupying a plurality of bytes, therefore, compared with a mode of loading the thumbnail, the loading speed of loading the occupation bitmap in the embodiment of the invention is very high.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings.
Fig. 1 is a schematic flowchart illustrating a loading processing method for a placeholder map according to an embodiment of the present invention;
FIG. 2-a is a schematic diagram illustrating a component structure of a loading processing apparatus for a placeholder map according to an embodiment of the present invention;
fig. 2-b is a schematic structural diagram of a dominant color obtaining module according to an embodiment of the present invention;
fig. 2-c is a schematic structural diagram of another dominant color obtaining module according to an embodiment of the present invention;
fig. 2-d is a schematic structural diagram of another dominant color obtaining module according to an embodiment of the present invention;
fig. 2-e is a schematic diagram of a color setting module according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a configuration in which the method for loading and processing a occupation map according to the embodiment of the present invention is applied to a terminal.
Detailed Description
The embodiment of the invention provides a loading processing method and device of an occupation bitmap, which are used for improving the loading speed of the occupation bitmap and meeting the requirement that a user knows an original picture needing to be loaded in advance.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one skilled in the art from the embodiments given herein are intended to be within the scope of the invention.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this invention and the above-described drawings are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The following are detailed below.
Referring to fig. 1, the loading processing method provided in an embodiment of the present invention may include the following steps:
101. and acquiring the corresponding main tone of the picture needing to be loaded in a delayed manner.
In the embodiment of the invention, when the terminal loads the picture from the network, the picture usually needs to be loaded in a delayed manner because the picture occupies larger resources compared with the text. In the embodiment of the invention, the main tone corresponding to the picture needing to be loaded in a delayed manner is obtained, wherein the main tone corresponding to the picture is the main tone of the picture, the main tone refers to the main color attribute expressed in the color collocation of the picture, the main tone refers to the condition that which wavelength is dominant in the light reflected by the picture, different wavelengths generate different colors, and the main tone is the important characteristic of the colors of the picture. For example, the pictures to be loaded in a delayed manner adopt a Red Green Blue (RGB) color mode, and for different pictures, RGB, that is, intensities of three primary colors of Red, Green and Blue need to be respectively specified, in the RGB color mode, each color intensity is at least 0 and at most 255, and is usually identified by 16-system numerical values, for example, 255 corresponds to hexadecimal or FF, and the numerical values of the three RGB components are sequentially arranged to start with # to represent different colors, for example, a color value # FF0000 is Red. When the picture adopts the RGB color mode, for example, the corresponding dominant hue of the picture acquired in step 101 is RGB (76,125,158). It should be noted that, in the embodiment of the present invention, the color of the picture may also be implemented by using other color modes, for example, a YUV color mode, and the like, which is not limited herein.
It should be noted that, the dominant hue of the picture is mainly used for identifying the image by the computer technology at present, but in the embodiment of the present invention, the dominant hue of the picture is used in the loading process of the occupied bitmap, which can realize fast loading and meet the requirement of the user to know the picture in advance. In the embodiment of the present invention, there are multiple methods for calculating the dominant hue of the picture, where one of the methods is as follows, and the step 101 obtains the dominant hue corresponding to the picture that needs to be loaded with a delay, and specifically includes the following steps:
a1, obtaining a color disc according to the colors selected from the color plate database, wherein the color disc comprises multiple colors;
a2, receiving a color code of a main tone corresponding to a picture sent by a background server;
and A3, matching the color codes with the colors in the color disc, and determining the corresponding main tone of the picture according to the matching result.
In step a1, the palette database may be customized as needed, a plurality of colors that may be displayed are stored in the palette database, and a plurality of colors are selected from the palette database according to a pre-configured requirement and placed in one color wheel, so that the color wheel includes the selected plurality of colors. Such as 24 basic colors of a universal color wheel. After the color wheel is obtained, step a2 is executed, the terminal may receive, through the client, the color code of the keytone corresponding to the picture that needs to be delay loaded and is sent by the background server, that is, the keytone corresponding to the picture that needs to be delay loaded is calculated by the background server, after the keytone corresponding to the picture that needs to be delay loaded is calculated by the background server, the background server sends the color code of the keytone to the terminal, and then the terminal may receive the color code of the keytone sent by the background server. Next, step a3 is executed, the color code of the received dominant hue is used to match with the color in the color wheel, a matching result is generated, and what kind of color in the color wheel and the color code can be successfully matched is recorded in the matching result, so that the color in the color wheel which is successfully matched is the dominant hue corresponding to the picture which needs to be loaded with a delay time.
In the foregoing implementation manner, the terminal receives the color code of the main tone corresponding to the picture that needs to be loaded in a delayed manner through interaction with the background server, so that the main tone corresponding to the picture is obtained through the color palette. In another implementation manner of the present invention, the step 101 of obtaining the corresponding dominant hue of the picture that needs to be loaded with a delay may specifically include the following steps:
b1, dividing the picture needing to be loaded in a delayed mode into N sub-pictures, wherein N is a natural number larger than 1;
b2, respectively calculating the corresponding main tone of each sub-picture in the N sub-pictures to obtain N main tones corresponding to the N sub-pictures;
and B3, selecting one main tone with the largest number of sub pictures from the N main tones as the main tone corresponding to the picture.
The method includes the steps of obtaining a main tone corresponding to a picture, obtaining a main tone corresponding to the picture through a calculation mode, cutting the picture needing delay loading in step B1 to obtain N sub-pictures, wherein the sub-pictures can also be called mosaic tiles, executing step B2 to calculate the main tone corresponding to each sub-picture in the N sub-pictures respectively, obtaining the main tone corresponding to each sub-picture, namely obtaining the N main tones, traversing all the sub-pictures in step B3, counting the number of different main tones in the N main tones respectively, counting the number of sub-pictures in each main tone, and selecting the main tone with the largest number of sub-pictures as the main tone corresponding to the picture needing delay loading.
It should be noted that, in step B2, the dominant hue corresponding to each sub-picture needs to be calculated, and there are various methods for calculating the dominant hue of the sub-picture, for example, the average RGB value of all pixel points in the sub-picture may be calculated, and the color corresponding to the average RGB value is used as the color corresponding to the dominant hue of the sub-picture, and for example, the RGB values of all pixel points in the sub-picture may also be calculated, then the number of pixel points corresponding to different RGB values is counted, and the color corresponding to the RGB value with the largest number of pixel points is taken as the color corresponding to the dominant hue of the sub-picture.
Further, in the embodiment of steps B1 to B3 of the present invention, before the step B3 selects one dominant hue with the largest number of sub-pictures from the N dominant hues as the dominant hue corresponding to the pictures, the method for loading the occupancy map provided in the embodiment of the present invention may further include the following steps:
and B4, removing the M main tones with black or white colors from the N main tones to obtain (N-M) main tones, wherein M is a natural number smaller than N.
In an implementation scenario of performing step B4, step B3 selects one dominant hue with the largest number of sub-pictures from the N dominant hues as the dominant hue corresponding to the picture, and specifically includes the following steps:
and selecting one main tone with the largest number of sub-pictures from the (N-M) main tones as the main tone corresponding to the picture.
That is, after obtaining N keytones corresponding to the N sub-pictures in step B2, obtaining black and white keytones from the N keytones, if the number of the obtained black or white keytones is M, removing the black or white keytones from the N keytones, and counting the number of different keytones from the (N-M) keytones through all the sub-pictures except the black or white keytones, and then selecting one keytone with the largest number of sub-pictures as the keytone corresponding to the picture requiring time-lapse loading. It should be noted that, when step B4 is executed, the main tone of black or white in the sub-picture is removed from the N main tones, so that the main tone corresponding to the acquired picture that needs to be subjected to time-lapse loading may not be black or white, and of course, in the embodiment of the present invention, step B4 may not be executed, and the main tone corresponding to the acquired picture that needs to be subjected to time-lapse loading may also be black or white.
102. The color occupying the bitmap is set according to the dominant hue.
In the embodiment of the invention, after the main tone corresponding to the picture needing to be loaded in a delayed manner is acquired, the color of the occupation map is set according to the main tone corresponding to the picture, wherein the occupation map refers to the picture which is used for occupation before the picture in the webpage is not loaded. In the foregoing prior art, the occupation map used may be a known small picture (for example, a domain name identifier of a website) or a thumbnail corresponding to the original picture, whereas in the embodiment of the present invention, the occupation map is a color with a color value determined by a main color, and the color of the occupation map may be determined according to the main color, so that the occupation map may reflect the color attribute of the picture being loaded. Compared with the setting mode of the placeholder map in the prior art, the placeholder map in the embodiment of the invention is a picture with color attributes set according to the main tone, and the placeholder map in the embodiment of the invention can be shown only through the color values, and the color values generally only need to occupy a few bytes, namely information smaller than 0.01k, so that the placeholder map provided by the embodiment of the invention occupies a small storage space.
In some embodiments of the present invention, the step 102 of setting the color occupying the bitmap according to the dominant hue specifically includes the following steps:
and C1, setting the color of the occupation map as the first color corresponding to the dominant hue according to the dominant hue.
In the embodiment that step C1 is executed, after the dominant hue corresponding to the picture that needs to be delay loaded is obtained in the foregoing step, the terminal determines that the dominant hue corresponding to the picture that needs to be delay loaded is the first color, for example, if the picture that needs to be delay loaded is a picture of blue sky, and the first color corresponding to the dominant hue of the picture is obtained as blue, the color of the occupancy map may be set as the first color corresponding to the dominant hue in the embodiment of the present invention, that is, the color of the occupancy map may be set as blue. In the implementation scenario of step C1, the technique of identifying the dominant hue of the picture is used in the placeholder map for picture delay loading, and the dominant hue of the picture to be delay loaded can be used as the color of the placeholder map, and the color of the placeholder map is the same as the color of the picture to be delay loaded, so that the user can know the dominant hue of the picture in advance before the picture loading is completed, and not only can the curiosity of the user about the picture to be loaded be satisfied, but also the loading flow can be saved, and the color value for loading the dominant hue only needs to transmit a few bytes, which is less than 0.01K of data volume, so that the loading speed can be increased, and the loading flow can be saved.
In other embodiments of the present invention, the step 102 of setting the color of the occupation map according to the dominant hue specifically includes the following steps:
d1, correcting the first color corresponding to the main tone according to the preset color correction parameters to obtain a second color, and setting the color of the occupation bitmap as the second color obtained by correcting the first color.
In the embodiment that step D1 is executed, after the foregoing step acquires the dominant hue corresponding to the picture that needs to be subjected to time-lapse loading, the terminal side sets a set of color correction parameters in advance, for example, taking the picture as an RGB color mode as an example, the terminal side may set the color correction parameters in 3 components of RGB to be +2, for example, if the foregoing step acquires the first color corresponding to the dominant hue corresponding to the picture that needs to be subjected to time-lapse loading to be RGB (76,125,158), the first color is corrected according to the color correction parameters, and the obtained second color is RGB (76+2,125+2,158+2) ═ RGB (78,127,160). And after the second color is obtained, setting the color of the occupation bitmap as the second color. It should be noted that, unlike the implementation of the foregoing step C1, in step D1, the first color corresponding to the dominant hue of the picture is not directly used as the color of the bitmap in step D1, but the first color corresponding to the dominant hue of the picture is corrected to obtain the second color, and the second color obtained after the correction is the color of the bitmap. In the implementation scenario of step D1, the technique of identifying the dominant hue of the picture is used in the placeholder map for picture delayed loading, the first color corresponding to the dominant hue of the picture to be delayed loaded may be modified to serve as the color of the placeholder map, and the color of the placeholder map and the dominant hue of the picture to be delayed loaded have a direct association relationship, so that a user may know the color related to the dominant hue of the picture in advance before the picture is loaded, which may not only meet the curiosity of the user about the picture to be loaded, but also save the loading traffic, and the color value for loading the dominant hue only needs to transmit several bytes, which is less than 0.01K of data volume, thereby increasing the loading speed and saving the loading traffic.
In other embodiments of the present invention, the step 102 of setting the color of the occupation map according to the dominant hue specifically includes the following steps:
e1, obtaining a plurality of color discs selected from the color plate database, wherein each color disc in the plurality of color discs corresponds to one color;
e2, selecting a third color which is the same as or closest to the first color from the multiple color discs according to the first color corresponding to the main tone;
and E3, setting the color of the occupation map as a third color.
Step E1 is similar to step a1 in the foregoing embodiment, and the terminal may customize the color palette database as needed, store multiple colors that may be displayed in the color palette database, and select multiple colors from the color palette database according to the preconfigured requirements and place the multiple colors in one color wheel, where the color wheel includes the selected multiple colors. After the color wheel is defined in step E1, if the corresponding dominant hue of the picture that needs to be loaded in a delayed manner is the first color, matching the first color with the color in the color wheel, if the color wheel has the same color as the first color, the third color is a color completely equal to the color code of the first color, or if the color wheel does not have the same color as the first color, selecting the third color with the color closest to the first color from the color wheel. The third color whose color is closest to the first color may refer to a color code whose value of each component of the color code is closest to the first color, for example, a color code whose value of each component of the first color is closest in distance may be calculated as the third color, where the proximity degree of two close colors may be calculated by a euclidean distance, or may be realized by other distance algorithms.
103. And loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture.
In the embodiment of the invention, in the process of loading the original picture, the occupied bitmap after the color setting is finished can be loaded, and the occupied bitmap with a certain color is displayed at the display position corresponding to the original picture, so that a user can see the color of the occupied bitmap before seeing the original picture in the process of waiting for the original picture to be loaded, the requirement of the user on knowing the picture in advance is met, in addition, the color of the occupied bitmap is displayed at the display position corresponding to the picture, and the color value of the color of the occupied bitmap can be finished only by occupying a few bytes, so that the loading speed of the occupied bitmap in the embodiment of the invention is very high.
As can be seen from the description of the embodiment of the present invention in the above embodiment, the dominant hue corresponding to the picture that needs to be loaded in a delayed manner is first obtained, then the color of the occupied bitmap is set according to the dominant hue, and finally the occupied bitmap after the color setting is completed is loaded at the display position corresponding to the picture. In the embodiment of the invention, the colors of the occupation bitmap can be set according to the main tone corresponding to the picture, so the occupation bitmap with the set colors can be loaded at the display position corresponding to the picture before the picture is loaded, so that no known thumbnail picture is displayed at the picture display position, and no thumbnail picture is displayed, but a colored occupying picture map is displayed, the color of the occupying bitmap is determined by the corresponding main tone of the picture being loaded, so that the occupying bitmap can reflect the color attribute of the picture being loaded, a user can see the color of the occupying bitmap before seeing the original picture, the requirement of the user on knowing the picture in advance is met, in addition, the colors of the occupying bitmap are displayed at the corresponding display positions of the pictures, the color values of the occupying bitmap can be completed only by occupying a plurality of bytes, therefore, compared with a mode of loading the thumbnail, the loading speed of loading the occupation bitmap in the embodiment of the invention is very high.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
To facilitate a better implementation of the above-described aspects of embodiments of the present invention, the following also provides relevant means for implementing the above-described aspects.
Referring to fig. 2-a, a device 200 for processing loading of a placeholder map according to an embodiment of the present invention may include: a dominant color acquisition module 201, a color setting module 202, a placeholder loading module 203, wherein,
a dominant color obtaining module 201, configured to obtain a dominant color corresponding to a picture that needs to be loaded in a delayed manner;
a color setting module 202, configured to set a color of the occupied bitmap according to the dominant hue;
and the placeholder map loading module 203 is used for loading the placeholder map with the set color at the display position corresponding to the picture.
In some embodiments of the present invention, referring to fig. 2-b, the dominant color obtaining module 201 includes:
a color palette obtaining sub-module 2011, configured to obtain a color palette according to multiple colors selected from the color palette database, where the color palette includes multiple colors;
the receiving submodule 2012 is configured to receive a color code of a dominant hue corresponding to the picture sent by the background server;
and the dominant color matching submodule 2013 is used for matching the color codes with the colors in the color disc and determining the dominant hue corresponding to the picture according to the matching result.
In some embodiments of the present invention, referring to fig. 2-c, the dominant color obtaining module 201 includes:
the picture division sub-module 2014 is used for dividing the picture needing to be subjected to time delay loading into N sub-pictures, wherein N is a natural number greater than 1;
a dominant color calculation sub-module 2015, configured to calculate a dominant color corresponding to each of the N sub-pictures to obtain N dominant colors corresponding to the N sub-pictures;
the dominant color selecting sub-module 2016 is configured to select, from the N dominant colors, one dominant color having the largest number of sub-pictures as the dominant color corresponding to the picture.
In some embodiments of the present invention, please refer to fig. 2-d, the dominant color obtaining module 201 further includes: a color removal sub-module 2017, wherein,
the color removing sub-module 2017 is configured to, before the dominant color selecting sub-module 2016 selects one dominant color having the largest number of sub-pictures from the N dominant colors as the dominant color corresponding to the picture, remove M dominant colors from the N dominant colors, where M is a natural number smaller than N, of the black or white dominant colors to obtain (N-M) dominant colors;
the dominant color selecting sub-module 2016 is specifically configured to select, from the (N-M) dominant colors, one dominant color having the largest number of sub-pictures as the dominant color corresponding to the picture.
In some embodiments of the present invention, the color setting module 202 is specifically configured to set the color of the occupation map as the first color corresponding to the dominant hue according to the dominant hue.
In some embodiments of the present invention, the color setting module 202 is specifically configured to correct a first color corresponding to the main tone according to a preset color correction parameter to obtain a second color, and set the color of the occupation map as the second color obtained by correcting the first color.
In some embodiments of the present invention, referring to fig. 2-e, the color setting module 202 comprises:
the color disc obtaining sub-module 2021 is configured to obtain a color disc according to multiple colors selected from the color palette database, where the color disc includes multiple colors;
the color selection sub-module 2022 is configured to select, according to the first color corresponding to the main hue, a third color having a color identical to or closest to the first color from the color wheel;
a color setting sub-module 2023, configured to set the color of the occupation map to the third color.
As can be seen from the above description of the embodiment of the present invention, firstly, the dominant color obtaining module obtains the dominant hue corresponding to the picture that needs to be loaded in a delayed manner, then the color setting module sets the color of the occupation bitmap according to the dominant hue, and finally, the color setting module loads the occupation bitmap after the color setting is completed on the display position corresponding to the picture. In the embodiment of the invention, the colors of the occupation bitmap can be set according to the main tone corresponding to the picture, so the occupation bitmap with the set colors can be loaded at the display position corresponding to the picture before the picture is loaded, so that no known thumbnail picture is displayed at the picture display position, and no thumbnail picture is displayed, but a colored occupying picture map is displayed, the color of the occupying bitmap is determined by the corresponding main tone of the picture being loaded, so that the occupying bitmap can reflect the color attribute of the picture being loaded, a user can see the color of the occupying bitmap before seeing the original picture, the requirement of the user on knowing the picture in advance is met, in addition, the colors of the occupying bitmap are displayed at the corresponding display positions of the pictures, the color values of the occupying bitmap can be completed only by occupying a plurality of bytes, therefore, compared with a mode of loading the thumbnail, the loading speed of loading the occupation bitmap in the embodiment of the invention is very high.
Another terminal is provided in the embodiment of the present invention, as shown in fig. 3, for convenience of description, only a part related to the embodiment of the present invention is shown, and details of the specific technology are not disclosed, please refer to the method part in the embodiment of the present invention. The terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of sales), a vehicle-mounted computer, etc., taking the terminal as the mobile phone as an example:
fig. 3 is a block diagram illustrating a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention. Referring to fig. 3, the cellular phone includes: radio Frequency (RF) circuit 310, memory 320, input unit 330, display unit 340, sensor 350, audio circuit 360, wireless fidelity (WiFi) module 370, processor 380, and power supply 390. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 3:
the RF circuit 310 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then processes the received downlink information to the processor 380; in addition, the data for designing uplink is transmitted to the base station. In general, the RF circuit 310 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 310 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to global system for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The memory 320 may be used to store software programs and modules, and the processor 380 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 320. The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 320 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 330 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 330 may include a touch panel 331 and other input devices 332. The touch panel 331, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on the touch panel 331 or near the touch panel 331 using any suitable object or accessory such as a finger, a stylus, etc.) on or near the touch panel 331, and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 331 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch panel 331 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 330 may include other input devices 332 in addition to the touch panel 331. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 340 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 340 may include a display panel 341, and optionally, the display panel 341 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 331 can cover the display panel 341, and when the touch panel 331 detects a touch operation on or near the touch panel 331, the touch panel is transmitted to the processor 380 to determine the type of the touch event, and then the processor 380 provides a corresponding visual output on the display panel 341 according to the type of the touch event. Although in fig. 3, the touch panel 331 and the display panel 341 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 331 and the display panel 341 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 350, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 341 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 341 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 370, and provides wireless broadband internet access for the user. Although fig. 3 shows the WiFi module 370, it is understood that it does not belong to the essential constitution of the handset, and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 380 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory 320, thereby performing overall monitoring of the mobile phone. Optionally, processor 380 may include one or more processing units; preferably, the processor 380 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 380.
The handset also includes a power supply 390 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 380 via a power management system to manage charging, discharging, and power consumption via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In the embodiment of the present invention, the processor 380 included in the terminal further has a flow of a loading processing method for controlling and executing the above placeholder map executed by the terminal.
It should be noted that the above-described embodiments of the apparatus are merely schematic, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by software plus necessary general hardware, and may also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components and the like. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions may be various, such as analog circuits, digital circuits, or dedicated circuits. However, the implementation of a software program is a more preferable embodiment for the present invention. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a readable storage medium, such as a floppy disk, a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk of a computer, and includes instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
In summary, the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the above embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the above embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (8)
1. A loading processing method of a placeholder map is characterized by comprising the following steps:
acquiring a main tone corresponding to a picture needing delayed loading, wherein the main tone comprises the following steps: dividing a picture needing delay loading into N sub-pictures, wherein N is a natural number greater than 1; respectively calculating the corresponding main tone of each sub-picture in the N sub-pictures to obtain N main tones corresponding to the N sub-pictures; selecting one main tone with the largest number of sub-pictures from the N main tones as a main tone corresponding to the picture;
setting colors occupying the bitmap according to the dominant hue, wherein the setting comprises: correcting a first color corresponding to the main tone according to a preset color correction parameter to obtain a second color, and setting the color of the occupation map as the second color obtained after the first color is corrected; or obtaining a color disc according to a plurality of colors selected from a color plate database, wherein the color disc comprises a plurality of colors, selecting a third color which is the same as or closest to the first color from the color disc according to the first color corresponding to the main tone, and setting the color of the occupation map as the third color, wherein the color code of the third color which is closest to the first color is the color code which is closest to the first color in each component value;
and loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture.
2. The method according to claim 1, wherein the obtaining the corresponding dominant hue of the picture needing delayed loading comprises:
obtaining a color disc according to a plurality of colors selected from a color plate database, wherein the color disc comprises a plurality of colors;
receiving a color code of a main tone corresponding to the picture sent by a background server;
and matching the color codes with the colors in the color disc, and determining the corresponding main tone of the picture according to the matching result.
3. The method according to claim 1, wherein before selecting one of the N dominant hues having the largest number of sub-pictures as the corresponding dominant hue of the picture, the method further comprises:
removing M main tones with black or white colors from the N main tones to obtain (N-M) main tones, wherein M is a natural number smaller than N;
the selecting, from the N dominant hues, one dominant hue having the largest number of sub-pictures as the dominant hue corresponding to the picture includes:
and selecting one main tone with the largest number of sub-pictures from the (N-M) main tones as the main tone corresponding to the picture.
4. A device for processing loading of a placeholder map, comprising:
the dominant color acquisition module is used for acquiring a dominant color tone corresponding to the picture needing to be loaded in a delayed manner;
the color setting module is used for setting the colors of the occupation map according to the dominant hue, and comprises the following steps: correcting a first color corresponding to the main tone according to a preset color correction parameter to obtain a second color, and setting the color of the occupation map as the second color obtained after the first color is corrected; or obtaining a color disc according to a plurality of colors selected from a color plate database, wherein the color disc comprises a plurality of colors, selecting a third color which is the same as or closest to the first color from the color disc according to the first color corresponding to the main tone, and setting the color of the occupation map as the third color, wherein the color code of the third color which is closest to the first color is the color code which is closest to the first color in each component value;
the occupation bitmap loading module is used for loading the occupation bitmap after the color setting is finished on the display position corresponding to the picture;
the dominant color obtaining module includes:
the image segmentation sub-module is used for segmenting an image needing delay loading into N sub-images, wherein N is a natural number greater than 1;
the dominant color calculation sub-module is used for respectively calculating the dominant color tone corresponding to each sub-picture in the N sub-pictures to obtain N dominant color tones corresponding to the N sub-pictures;
and the dominant color selection submodule is used for selecting one dominant color with the largest number of sub-pictures from the N dominant colors as the dominant color corresponding to the pictures.
5. The apparatus of claim 4, wherein the dominant color obtaining module comprises:
the color disc obtaining sub-module is used for obtaining a color disc according to a plurality of colors selected from the color plate database, and the color disc comprises a plurality of colors;
the receiving submodule is used for receiving the color code of the dominant hue corresponding to the picture sent by the background server;
and the main color matching sub-module is used for matching the color codes with the colors in the color disc and determining the main color corresponding to the picture according to the matching result.
6. The apparatus of claim 4, wherein the dominant color obtaining module further comprises: a color removal sub-module, wherein,
the color removing sub-module is configured to remove M dominant hues whose colors are black or white from the N dominant hues to obtain (N-M) dominant hues before the dominant color selecting sub-module selects one dominant hue having the largest number of sub-pictures from the N dominant hues as the dominant hue corresponding to the picture, where M is a natural number smaller than N;
and the dominant color selection submodule is specifically configured to select one dominant color with the largest number of sub-pictures from the (N-M) dominant colors as the dominant color corresponding to the picture.
7. A terminal device comprising a memory and a processor;
the memory is used for storing software programs and modules;
the processor is used for executing the loading processing method of the occupation map according to any one of claims 1 to 3 by running the software program and the module stored in the memory.
8. A storage medium, wherein a software program and a module are stored in the storage medium, and when executed, the software program and the module implement the method for processing loading of the occupation map according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510490535.6A CN106445970B (en) | 2015-08-11 | 2015-08-11 | Loading processing method and device for placeholder map |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510490535.6A CN106445970B (en) | 2015-08-11 | 2015-08-11 | Loading processing method and device for placeholder map |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106445970A CN106445970A (en) | 2017-02-22 |
CN106445970B true CN106445970B (en) | 2020-08-21 |
Family
ID=58092501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510490535.6A Active CN106445970B (en) | 2015-08-11 | 2015-08-11 | Loading processing method and device for placeholder map |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106445970B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107197353A (en) * | 2017-05-24 | 2017-09-22 | 环球智达科技(北京)有限公司 | The processing method of the occupy-place figure of interface images |
CN107222773A (en) * | 2017-05-24 | 2017-09-29 | 环球智达科技(北京)有限公司 | The processing system of the occupy-place figure of interface images |
CN108334531A (en) * | 2017-09-19 | 2018-07-27 | 平安普惠企业管理有限公司 | Picture tone extracting method, equipment and computer readable storage medium |
CN108595235B (en) * | 2018-03-20 | 2021-10-19 | 车音智能科技有限公司 | Picture loading method and device |
CN110096662A (en) * | 2019-04-22 | 2019-08-06 | 华为技术有限公司 | Webpage display method and related device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102918492A (en) * | 2010-06-11 | 2013-02-06 | 微软公司 | Adaptive image rendering and use of imposter |
CN103218989A (en) * | 2013-04-09 | 2013-07-24 | 广东欧珀移动通信有限公司 | Personalized display method and personalized display terminal during picture preloading |
CN103914450A (en) * | 2012-12-31 | 2014-07-09 | 北京新媒传信科技有限公司 | Method and device for presenting web graphics in mobile terminal platform |
CN104050172A (en) * | 2013-03-12 | 2014-09-17 | 腾讯科技(深圳)有限公司 | Webpage picture loading method and system |
CN104462312A (en) * | 2014-11-28 | 2015-03-25 | 北京奇虎科技有限公司 | Web page displaying method and browser client side |
CN105162954A (en) * | 2015-07-30 | 2015-12-16 | 努比亚技术有限公司 | Embedded picture amplifying method and device, and mobile terminal |
-
2015
- 2015-08-11 CN CN201510490535.6A patent/CN106445970B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102918492A (en) * | 2010-06-11 | 2013-02-06 | 微软公司 | Adaptive image rendering and use of imposter |
CN103914450A (en) * | 2012-12-31 | 2014-07-09 | 北京新媒传信科技有限公司 | Method and device for presenting web graphics in mobile terminal platform |
CN104050172A (en) * | 2013-03-12 | 2014-09-17 | 腾讯科技(深圳)有限公司 | Webpage picture loading method and system |
CN103218989A (en) * | 2013-04-09 | 2013-07-24 | 广东欧珀移动通信有限公司 | Personalized display method and personalized display terminal during picture preloading |
CN104462312A (en) * | 2014-11-28 | 2015-03-25 | 北京奇虎科技有限公司 | Web page displaying method and browser client side |
CN105162954A (en) * | 2015-07-30 | 2015-12-16 | 努比亚技术有限公司 | Embedded picture amplifying method and device, and mobile terminal |
Non-Patent Citations (2)
Title |
---|
""Gradify-提取图片颜色,创建响应式的CSS渐变"";梦想天空;《https://www.bbsmax.com/A/l1dyYjQVde/》;20150716;第1页 * |
"Android UI设计(一)——胜过千言万语的图片设计";小老妈;《https://site.douban.com/169072/widget/notes/9233791/note/317606433/》;20131123;第1-5页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106445970A (en) | 2017-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3370204B1 (en) | Method for detecting skin region and device for detecting skin region | |
CN107038681B (en) | Image blurring method and device, computer readable storage medium and computer device | |
CN107038715B (en) | Image processing method and device | |
CN110021256B (en) | Display brightness adjusting method and related product | |
CN107222613B (en) | Display method and terminal | |
CN106445970B (en) | Loading processing method and device for placeholder map | |
CN107731199B (en) | Screen color temperature adjusting method, terminal and computer readable storage medium | |
CN106844580B (en) | Thumbnail generation method and device and mobile terminal | |
CN103634580A (en) | Color gamut adjusting method and device for color image | |
CN108460769B (en) | image processing method and terminal equipment | |
CN110458921B (en) | Image processing method, device, terminal and storage medium | |
CN108200421B (en) | White balance processing method, terminal and computer readable storage medium | |
CN109614173B (en) | Skin changing method and device | |
CN108052820B (en) | Unlocking control method, terminal equipment and related product | |
CN108122528A (en) | Display control method and related product | |
CN110851350A (en) | Method and device for monitoring white screen of web page interface | |
CN108172200A (en) | A kind of method and terminal device of this display of applicating Chinese | |
CN106254469A (en) | A kind of picture pushes and display packing, server and communication terminal | |
CN107330867B (en) | Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment | |
CN107292833B (en) | Image processing method and device and mobile terminal | |
CN111131612B (en) | Screen color temperature control method and device, storage medium and mobile terminal | |
CN110097570B (en) | Image processing method and device | |
CN108877733B (en) | Color temperature adjusting method and related device | |
CN113590069A (en) | Switching method, mobile terminal and storage medium | |
CN111104193B (en) | Application program active interface display method and device, storage medium and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |