Color mode conversion method, electronic device and readable medium thereof
By receiving the color mode conversion instruction in the electronic device and determining the icon conversion strategy, the icons arranged together are processed uniformly, which solves the problem of inconsistent icon brightness in the existing technology and improves the user experience.
Patent Information
- Application Number
- CN202110179505.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-02-09
AI Technical Summary
During the color mode conversion of existing electronic devices, the icons arranged together are processed in different ways, resulting in inconsistent brightness, which affects the user experience.
By receiving color mode conversion instructions, the icon conversion strategy for the icon group to be converted is determined, and the icon group is uniformly converted to color based on the icon characteristics to ensure that icons in the same group with the same or similar characteristics are displayed consistently.
The user experience is improved by unifying the color and brightness of icons in the same group to make them consistent on the display, improving the overall effect of the GUI.
Smart Images

Figure CN114911545B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic devices, and in particular to a color mode conversion method, an electronic device and a readable medium thereof. Background Art
[0002] The color mode of electronic devices such as mobile phones and tablets is a mode that has emerged in recent years. Its main function is to transform the original application (Application, APP) interface and system interface from white background to black background to provide a new graphical user interface (Graphical User Interface, GUI) user experience.
[0003] The existing color mode samples a single icon and then makes judgments and processes it. For example, the system samples the pixels of an APP icon. If the proportion of color pixels is greater than a predetermined threshold, the system determines that the APP icon is a foreground icon and keeps the APP icon unchanged in the color mode.
[0004] It can be seen that the existing color modes are all processed for a single icon, which may result in different processing methods for each icon. In the GUI design of electronic devices such as mobile phones, icons arranged together often have the same or similar features (for example, size and color type). For example, several APP icons of the same size are arranged in a row. If some of the APP icons in a row are inverted and some are darkened in the color mode, the brightness of the APP icons in this row will be inconsistent when they are finally displayed on the screen, affecting the user experience. Summary of the invention
[0005] An embodiment of the present application provides a color mode conversion method, an electronic device and a readable medium thereof. The color mode conversion method of the present application enables icons in the same group with the same or similar features to be displayed consistently, thereby improving the user experience.
[0006] In a first aspect, the color mode conversion method of the present application includes:
[0007] The electronic device receives an instruction to convert a current display mode into a color mode;
[0008] The electronic device determines an icon conversion strategy for each icon to be converted in the icon group to be converted;
[0009] The electronic device determines a group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted;
[0010] The electronic device uses the group conversion strategy to perform color conversion on each icon to be converted in the group of icons to be converted.
[0011] In some embodiments of the present application, the display elements (icons, texts, etc.) on the interface are drawn from the root node in a certain order, so icons with similar drawing orders are often similar in physical space layout. For example, icons of the same size are grouped together, and then the drawing strategies of the group of icons are counted, such as inverting, darkening, color mapping, keeping unchanged, and brightening, and the drawing strategy with the largest number is used as the final drawing strategy of the group. Figure 1a As shown, icon 101, icon 102 and icon 103, there are a total of 3 icons in this group, among which the drawing strategy of 1 icon is to darken, and the drawing strategies of 2 icons are to keep the icon color unchanged. The final drawing strategy of the group is to keep the icon color unchanged, that is, the electronic device 100 uniformly keeps the icon color unchanged for icon 101, icon 102 and icon 103, so that icons in the same group with the same or similar features are displayed consistently, thereby improving the user experience.
[0012] In a possible implementation of the first aspect above, the icons to be converted include various function icons of an application installed on the electronic device in an open state.
[0013] In some embodiments of the present application, an icon may refer to various application icons displayed on the desktop of the electronic device 100, such as icon 101 and icon 102, or an icon displayed after an application installed by the electronic device 100 is opened. For example, as shown in FIG1(c), a functional application icon is displayed after an application installed by the electronic device 100 is opened, wherein the functional icons contained in the dotted box c101 have the same size, and the functional icons contained in the dotted box c102 have the same size. For another example, as shown in FIG1(d), a functional application icon is displayed after an application related to "car" installed by the electronic device 100 is opened, wherein the size and other features of icon d101, icon d102, and icon d103 are also the same.
[0014] In a possible implementation of the first aspect, the present invention further includes:
[0015] The function icons in the applications on the electronic device are grouped according to the positional relationship and icon features between the function icons in the applications.
[0016] In a possible implementation of the first aspect above, the icon feature includes at least one of icon size, colors included in the icon, the number of colors included in the icon, and icon transparency.
[0017] In a possible implementation of the first aspect, the electronic device groups the icons in the following manner:
[0018] The electronic device groups adjacent icons into the same group when the interval distance between adjacent icons is less than a distance threshold and at least one of the icon sizes, the colors included in the icons, the number of colors included in the icons, and the icon transparency of the adjacent icons are equal.
[0019] In some embodiments of the present application, the grouping module 305 performs grouping based on the size of icons, that is, putting icons to be drawn of the same size into an array, and the difference between the numbers of two adjacent icons to be drawn in the same array is smaller than a difference threshold.
[0020] For example, the grouping module 305 divides the icons into three arrays based on their sizes, namely array 1, array 2 and array 3, and the difference threshold is set to 5. The size of the icons in array 1 is 100×100, the size of the icons in array 2 is 80×80, and the size of the icons in array 3 is 50×50.
[0021] In a possible implementation of the first aspect above, when grouping icons, the electronic device limits the number of icon groups of the application icons or function icons in the application to a predetermined number.
[0022] In some embodiments of the present application, the number of icon groups of the application icons or function icons in the application is limited to 3 to 5.
[0023] In a possible implementation of the first aspect, the electronic device determines the group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted, including:
[0024] Count the number of icons to be converted that use each icon conversion strategy in the icon group to be converted;
[0025] The icon conversion strategy with the largest number of uses is determined as the group conversion strategy of the icon group to be converted.
[0026] In some embodiments of the present application, the grouping module 305 first counts the types of drawing strategies in the same array and the number of icons of each drawing strategy, and then uses the drawing strategy with the largest number of icons as the unified drawing strategy of the group, that is, all icons in the group use a unified drawing strategy, so as to ensure that the colors and brightness of the icons in the same group displayed on the final display screen 130 are consistent.
[0027] In a possible implementation of the first aspect, the electronic device determines the group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted, further comprising:
[0028] Calculate the determination probability of the conversion strategy of each icon to be converted in the group of icons to be converted;
[0029] The icon conversion strategy with a determination probability greater than a probability threshold is determined as the group conversion strategy of the icon group to be converted.
[0030] In some embodiments of the present application, for example, there are 10 icons in the same group, numbered 1 to 10, wherein the drawing strategy of icons numbered 1 to 9 is darkening, but the possibility of these 9 icons using darkening is between 50% and 60%, and the drawing strategy of icon numbered 10 is inverted color, but the possibility of the icon using inverted color is 95%, indicating that the feature of the icon is very obvious, for example, the icon is almost pure white. Since the possibility of the icon numbered 10 using inverted color is greater than the first probability threshold (for example, 90%), all icons in the group finally use the inverted color drawing strategy, thereby ensuring that the color and brightness of the icons in the same group displayed on the final display screen 130 are consistent.
[0031] In a possible implementation of the first aspect, the icon conversion strategy includes any one of the following:
[0032] Invert color;
[0033] Darken;
[0034] Color mapping;
[0035] Brighten;
[0036] Remain unchanged.
[0037] In a possible implementation of the first aspect, the icon conversion strategy is determined by the following method, including:
[0038] If the icon to be converted is a background icon, the icon conversion strategy is inverting, darkening or color mapping, so that the background icon is converted into a dark icon;
[0039] If the icon to be converted is a foreground icon, the icon conversion strategy is to darken, color map, remain unchanged or brighten, so that the foreground icon is converted into a light-colored icon while maintaining a predetermined contrast with the background icon.
[0040] In a second aspect, a readable medium stores instructions, and when the instructions are executed on the electronic device, the readable medium executes the color mode conversion method of the electronic device according to the first aspect.
[0041] According to a third aspect, an electronic device includes:
[0042] A memory storing instructions;
[0043] A processor is coupled to the memory, and when the program instructions stored in the memory are executed by the processor, the electronic device executes the color mode conversion method of the electronic device according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1(a) to 1(b) According to some embodiments of the present application, a scene schematic diagram of a color mode is provided.
[0045] Figure 1(c) to 1(d) According to some embodiments of the present application, a schematic diagram of a functional application icon displayed after an application installed on an electronic device 100 is opened is provided.
[0046] Figure 2 According to some embodiments of the present application, a structural block diagram of a mobile phone 100 capable of implementing the functions of an electronic device 100 is provided.
[0047] Figure 3 According to some embodiments of the present application, a system diagram of a mobile phone 100 for implementing the technical solution of the present invention is provided.
[0048] Figure 4 According to some embodiments of the present application, a flowchart of a color mode conversion method is provided.
[0049] Figure 5 According to some embodiments of the present application, a schematic diagram of an interface of a mobile phone 100 for setting a color mode is provided.
[0050] Figure 6 According to some embodiments of the present application, a system traversal diagram of a mobile phone 100 is provided.
[0051] Figure 7 According to some embodiments of the present application, a schematic diagram of numbering icons to be drawn is provided.
[0052] Figure 8 According to some embodiments of the present application, a schematic diagram of grouping icons based on size is provided.
[0053] Figures 9(a) to 9(b) According to some embodiments of the present application, an array schematic diagram of array 4 and array 5 is provided.
[0054] Figures 10(a) to 10(b) According to some embodiments of the present application, a schematic diagram of display effects of a color mode is provided.
[0055] Fig.11 According to some embodiments of the present application, a software structure block diagram of an electronic device 100 capable of implementing the functions of the electronic device 100 is provided. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0057] Fig. 1 shows a schematic diagram of a color mode scenario provided by an embodiment of the present application. As shown in Fig. 1, when a user wants to switch the display mode of the electronic device 100 from the normal mode to the color mode, the electronic device 100 first traverses the icons displayed on the display screen of the electronic device 100 after receiving the color mode switching instruction from the user, and then identifies the traversed icons to identify the type of the icon, and then executes the corresponding drawing strategy based on the type of the icon. For example, if the icon type is a background or bottom plate icon, the corresponding drawing strategy can be inverted or darkened, and if the icon type is a foreground icon, the corresponding drawing strategy can be to keep the icon color unchanged without any processing.
[0058] It can be understood that the icons mentioned in this application can refer to various application icons displayed on the desktop of the electronic device 100, such as icon 101 and icon 102, or icons displayed after the application installed by the electronic device 100 is opened. For example, as shown in FIG1(c), the functional application icons displayed after the application installed by the electronic device 100 is opened, wherein the functional icons contained in the dotted box c101 are of the same size, and the functional icons contained in the dotted box c102 are of the same size. For another example, as shown in FIG1(d), the functional application icons displayed after the "car" application installed by the electronic device 100 is opened, wherein the size and other features of icon d101, icon d102, and icon d103 are also the same.
[0059] For example, Figure 1a As shown, the electronic device 100 traverses icon 101, icon 102 and icon 103, first samples part of the pixels of the icon, and then compares the ratio of the sampled pixels with the size of a predetermined threshold to identify the type of the icon. For example, if the ratio of color pixels in the icon is greater than the color pixel threshold, it means that the type of the icon is a scenario icon, and the drawing strategy may be to keep the icon color unchanged. If the ratio of color pixels is less than the color pixel threshold, it means that the type of the icon may be a background, and the drawing strategy may be to darken it (for example, making the color of the icon gray).
[0060] For another example, the electronic device 100 traverses various icons of commonly used functions, namely "notification", "favorites", "lock screen", "history", etc., and first samples the transparent pixels in the icon, and then determines the ratio of transparent pixels and the size of the transparent pixel threshold. If the ratio of transparent pixels is greater than the transparent pixel threshold, the drawing strategy of the icon is inverted; if the ratio of transparent pixels is less than the transparent pixel threshold, the drawing strategy of the icon is darkened.
[0061] It can be seen that the electronic device 100 first identifies the icon type for a single icon, and then determines the drawing strategy based on the icon type. The drawing strategies include inversion, darkening, color mapping, keeping unchanged and brightening, etc. However, this method of processing single icons one by one may result in inconsistent results for color mode conversions with the same characteristics.
[0062] For example, Figure 1b As shown, icons 101, 102 and 103 in the same row have the same features, for example, the same size (e.g., 100×100), shape (e.g., rectangle) and color types (e.g., 3). If the color pixel ratio of icon 101 is less than the color pixel number threshold, the drawing strategy for icon 101 is to darken it, while the color pixel ratio of icons 102 and 103 is greater than the color pixel threshold, the drawing strategy for icons 102 and 103 is to keep the icon colors unchanged. The final displayed result is as follows: Figure 1b As shown, the brightness of icon 101 becomes darker, while the brightness of icons 102 and 103 remain unchanged.
[0063] For another example, for commonly used functions, the icons in the same group include "Notification", "Favorites", "Lock Screen", "History", ..., "Vibration", and "Edit". If the ratio of transparent pixels of the "Favorites" icon and the "Lock Screen" icon is less than the transparent pixel threshold, the drawing strategy for the "Favorites" icon and the "Lock Screen" icon is to darken them. If the ratio of transparent pixels of the remaining icons in the same group is greater than the transparent pixel threshold, the drawing strategy for the remaining icons in the same group is to invert the colors. The final displayed result is as follows: Figure 1b As shown, the brightness of the "Favorites" icon and the "Lock Screen" icon is dimmed, while the rest of the icons in the same group are inverted (from black to white).
[0064] Therefore, it can be seen from Figure 1 that processing individual icons separately may cause the same group of icons with the same or similar features to have different drawing strategies. For example, some icons are inverted, while some icons are darkened, resulting in inconsistent display of the same group of icons with the same or similar features on the display screen of the electronic device 100, affecting the user experience.
[0065] The embodiment of the present application provides a method for color mode conversion. The display elements (icons, texts, etc.) on the interface are drawn from the root node in a certain order, so icons with similar drawing orders are often similar in physical space layout. For example, icons of the same size are grouped together, and then the drawing strategies of the group of icons are counted, such as inverting, darkening, color mapping, keeping unchanged, and brightening, and the drawing strategy with the largest number is used as the final drawing strategy of the group. Figure 1aAs shown, icon 101, icon 102 and icon 103, there are a total of 3 icons in this group, among which the drawing strategy of 1 icon is to darken, and the drawing strategies of 2 icons are to keep the icon color unchanged. The final drawing strategy of the group is to keep the icon color unchanged, that is, the electronic device 100 uniformly keeps the icon color unchanged for icon 101, icon 102 and icon 103, so that icons in the same group with the same or similar features are displayed consistently, thereby improving the user experience.
[0066] It can be understood that the electronic devices applicable to the technical solution of the present application can be various electronic devices with color modes, such as smart phones, tablet computers, laptop computers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, reader devices, and smart home devices with touch screens such as smart TVs and smart speakers, etc. For ease of description, the following description takes the mobile phone 100 as an example.
[0067] Figure 2 According to an embodiment of the present application, a structural block diagram of a mobile phone 100 capable of implementing the functions of the electronic device 100 shown in FIG1 is shown. Specifically, Figure 2 As shown, the mobile phone 100 includes a processor 110, a mobile communication module 120, a wireless communication module 125, a display screen 130, a camera 140, an external storage interface 150, an internal memory 151, an audio module 160, a sensor module 170, an input unit 180 and a power supply 190.
[0068] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than those shown in the figure, or combine certain components, or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0069] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a central processing unit (CPU), a graphics processing unit (GPU), an image signal processor (ISP), a control unit, a video codec, a digital signal processor (DSP), a data processor (DPU), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0070] In some embodiments of the present application, the mobile phone 100 can traverse, identify and group icons displayed on the display screen 130 through a central processor.
[0071] In some embodiments of the present application, the mobile phone 100 may draw icons through a central processing unit or a graphics processing unit.
[0072] For example, when the mobile phone 100 switches to dark mode, the icons on the display screen 130 change from white to gray. First, the central processing unit traverses the icons, identifies the type of the icons, and adopts a corresponding drawing strategy based on the identified type. For example, the drawing strategy is to darken (i.e., change white to gray). The central processing unit or the graphics processor converts the white icons into gray icons.
[0073] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0074] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0075] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0076] The mobile communication module 120 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 110 for processing; in addition, the data related to the uplink is sent to the base station. Usually, the mobile communication module 120 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the mobile communication module 120 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0077] The wireless communication module 125 can provide wireless communication solutions including wireless local area networks (WLAN), wireless fidelity (Wi-Fi), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 125 can be one or more devices integrating at least one communication processing module. The wireless communication module 125 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 125 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, the wireless communication module 125 can implement the multi-carrier technology based on the communication protocol of the Wi-Fi network described above, thereby supporting the mobile phone 100 to achieve ultra-wideband transmission through the existing Wi-Fi protocol.
[0078] Display screen 130, display screen 130 can be a liquid crystal display (LCD), an organic light-emitting diode (OLED) display screen, an active-matrix organic light emitting diode (AMOLED) display screen, a flexible light-emitting diode (FLED) display screen, a quantum dot light-emitting diode (QLED) display screen, etc.
[0079] In some embodiments of the present application, the display screen 130 can switch between various display modes, for example, from a normal mode (with a light background) to a dark mode (with a dark background).
[0080] The camera 140 is used to obtain static images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the image signal processor (ISP) to convert it into a digital image signal. The ISP outputs the digital image signal to the digital signal processor (ISP) for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the mobile phone 100 may include 1 or N cameras 130, where N is a positive integer greater than 1.
[0081] The external memory interface 150 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 150 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0082] The internal memory 151 can be used to store computer executable program codes, which include instructions. The internal memory 151 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 151 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. In some embodiments of the present application, the processor 110 runs instructions stored in the internal memory 151, and / or instructions stored in a memory provided in the processor, as well as various functional applications and data processing.
[0083] In some embodiments of the present application, the internal memory 151 can store icon information of the icon to be drawn and the corresponding drawing strategy, wherein the icon information includes but is not limited to the icon's size, outline, color type, transparent pixel ratio, etc., and the drawing strategy includes but is not limited to inversion, darkening, color mapping, maintaining unchanged and brightening, etc.
[0084] The mobile phone 100 further includes an audio module 160, which may include a speaker, a receiver, a microphone, an earphone interface, and an application processor to implement audio functions such as music playback and recording.
[0085] The audio module 160 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 160 can also be used to encode and decode audio signals. In some embodiments, the audio module 160 can be arranged in the processor 110, or some functional modules of the audio module 160 can be arranged in the processor 110.
[0086] The mobile phone 100 also includes a sensor module 170, wherein the sensor module 170 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and the like.
[0087] The input unit 180 may be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0088] The mobile phone 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 110 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0089] Figure 3 A system diagram of an image processing solution provided by an embodiment of the present application is shown, such as Figure 3 As shown, the system 300 includes a traversal module 301, a preprocessing module 302, a cache module 303, an identification module 304, a grouping module 305, and a drawing module 306. It can be understood that the processor 110 can implement the functions of the traversal module 301, the preprocessing module 302, the identification module 304, the grouping module 305, and the drawing module 306 by calling a program, and the internal memory 151 can implement the function of the cache module 303.
[0090] Traversal module 301: After the user sends a mode switching instruction to the mobile phone 100, the traversal module 301 receives a synchronous drawing signal from the display screen 130, and the traversal module 301 can traverse the icons to be drawn displayed on the display screen 130 in order from top to bottom and from left to right.
[0091] Preprocessing module 302: For the icon to be drawn traversed by the traversal module 301, the preprocessing module 302 first obtains the icon information and drawing strategy of the icon to be drawn from the cache module 303. If it cannot be obtained from the cache module 303, it means that the icon may be drawn for the first time. The icon to be drawn can be identified by the identification module 304 to obtain the icon information and drawing strategy, and then the icon information and drawing strategy obtained for the first time are saved in the cache module 303. The preprocessing module 302 then obtains the icon information and drawing strategy from the cache module 303.
[0092] The icon information includes but is not limited to the icon's size, outline, color type, transparent pixel ratio, etc., and the drawing strategy includes but is not limited to inversion, darkening, color mapping, maintaining unchanged, and brightening, etc.
[0093] Cache module 303: provides a method interface for reading, saving, and modifying icon drawing strategies, obtains icon information and corresponding drawing strategies of the icon to be drawn from the identification module 304, and simultaneously sends the icon information and drawing strategies to the grouping module 305 for grouping, and can also obtain the modified icon information and drawing strategies sent by the grouping module 305.
[0094] The recognition module 304 samples some pixels in the icon to be drawn according to the specification information of the icon, where the specification information may be the size, color, and color type of the icon, and calculates whether the icon is the foreground, background, or base plate according to the distribution characteristics of the pixels, such as the transparent pixel ratio, the highlight pixel ratio, and the high-color pixel information, and sends the recognition result to the cache module 303.
[0095] Grouping module 305: Receives icon information and drawing strategies sent by cache module 303, and groups icons based on one or more icon features to be drawn. Icon features include but are not limited to size, color type, transparent pixel ratio, etc. The number of groups can be 3 to 5.
[0096] Drawing module 306: After receiving the drawing command sent by the grouping module 305, the drawing command of the canvas Canvas can be called to draw the icon according to the icon information and drawing strategy obtained by the preprocessing module 302. The drawing command includes the icon to be drawn, the coordinate position of the drawn icon, and the brush used to draw the icon.
[0097] Specifically, the following is combined with the above Figure 2 and Figure 3 The structure described, according to Figure 4 Combined with specific scenarios, the technical solution of this application is introduced in detail. Figure 4 As shown, the technical solution for color mode conversion provided by this application includes:
[0098] 401: The system 300 obtains a color mode switching instruction from a user.
[0099] The switching instruction indicates that the user needs to switch the display mode of the mobile phone 100 from the current mode to various color modes.
[0100] like Figure 5 As shown, when the user needs to select the "dark mode" on the mobile phone 100, the user can first enter the relevant setting interface and switch the display mode by clicking the dark mode on button shown in the display screen 130 of the mobile phone 100. In other embodiments of the present application, the user's switching command can also be input by pressing a physical button, air gestures, or voice commands, etc., and the embodiments of the present application are not limited to this.
[0101] 402: The traversal module 301 traverses the icons to be drawn.
[0102] Next, we first combine Figure 1 and Figure 6 The drawing principle of the system of mobile phone 100 is introduced.
[0103] The system first draws the root node 601 of the mobile phone 100, wherein the root node 601 may be the screen background of the mobile phone 100 in FIG. 1(a), and then draws the control group 602. For example, in FIG. 1(a), icons 101, 102, and 103 constitute the control group 602, and each icon is a sub-control of the control group 602. For example, sub-control 604 may be icon 101, and sub-control 605 may be icon 102. The system draws the sub-controls in the control group 602 in sequence. If the sub-control in the control group 602 includes multiple sub-controls, the sub-control may be regarded as a control group. For example, after opening the icon 102 as shown in FIG. 1(c), the icon 102 is also a control group.
[0104] It can be seen that the order of drawing by the system is to draw the screen background of the mobile phone 100 first, and then draw the sub-controls in each control group in turn, and the sub-controls in the same control group are very close to each other.
[0105] Based on this, the traversal module 301 can traverse the icons to be drawn displayed on the screen of the mobile phone 100 according to the drawing principle of the system, for example, traverse the icons displayed on the screen from top to bottom and from left to right. For the convenience of explanation, the icons to be drawn traversed in sequence are numbered in order.
[0106] like Figure 7 As shown, icon 101, icon 102 and icon 103 are numbered 1, 2, and 3 respectively; the "Notification" icon, "Favorites" icon, "Lock Screen" icon, "History" icon, ..., "Vibration" icon and "Edit" icon of commonly used functions are numbered 10, 12, 14, 16, ..., 30, 32 respectively; and the corresponding "Notification" text, "Favorites" text, "Lock Screen" text, "History" text, ..., "Vibration" text and "Edit" text are numbered 11, 13, 15, 17, ..., 31, 33 respectively.
[0107] 403: The pre-processing module 302 pre-processes the icon to be drawn, and obtains icon information and a drawing strategy of the icon to be drawn.
[0108] The preprocessing module 302 first obtains the icon information and drawing strategy of the icon to be drawn from the cache module 303. If it cannot be obtained from the cache module 303, it means that the icon may be drawn for the first time, and the icon information and drawing strategy are obtained by identifying the icon through the identification module 304, and then the icon information and drawing strategy obtained for the first time are saved in the cache module 303, and the preprocessing module 302 obtains the icon information and drawing strategy from the cache module 303 again.
[0109] The following describes a method for sampling target pixels of the icon to be drawn to obtain icon information and drawing strategies.
[0110] In some embodiments of the present application, the sampling rule of the target pixel may be: the pixels of the icon to be drawn are evenly and symmetrically divided into 10 rows and 10 columns, and a total of 100 points are collected. At the same time, in order to avoid not collecting pixel points at the border, 10 points are collected at the horizontal border and the vertical border of the icon to be drawn respectively, so the total number of points collected is about 120. Pixel points include but are not limited to color pixels, transparent pixels, white pixels, black pixels, and gray pixels.
[0111] After pixel sampling, the ratio of the above five pixel points can be calculated. Specifically, the following calculation methods can be used, including:
[0112] The ratio of color pixels = total number of color pixels / (total number of pixels - total number of transparent pixels);
[0113] The ratio of transparent pixels = total number of transparent pixels / total number of pixels;
[0114] The ratio of white pixels = total number of white pixels / (total number of white pixels + total number of black pixels + total number of gray pixels);
[0115] The ratio of black pixels = the total number of black pixels / (the total number of white pixels + the total number of black pixels + the total number of gray pixels);
[0116] The ratio of gray pixels = the total number of gray pixels / (the total number of white pixels+the total number of black pixels+the total number of gray pixels).
[0117] The mobile phone 100 then compares the pixel ratio of the icon to be drawn with the corresponding threshold value, and determines the drawing strategy for the icon to be drawn.
[0118] If the ratio of the color pixels of the icon to be drawn is greater than the color pixel ratio threshold, the drawing strategy for the icon to be drawn is to keep the color of the icon to be drawn unchanged, that is, no processing is performed on the icon to be drawn.
[0119] For example, the color pixel ratio threshold is set to 10%, and the color pixel ratio of the icon to be drawn is 15%, indicating that the icon to be drawn may be a scenario icon. Obviously, in the dark mode, the scenario icon needs to keep the icon color unchanged and no processing is required.
[0120] If the proportion of white pixels of the icon to be drawn is greater than the white pixel proportion threshold, the drawing strategy for the icon to be drawn is to perform inverted color or darkening processing on the icon to be drawn.
[0121] For example, the white pixel ratio threshold is set to 80%, and the ratio of white pixels of the icon to be drawn is 85%, which means that the icon to be drawn may be a background icon. Obviously, the white background icon needs to be inverted in the color mode, that is, the white background icon is changed to a black background icon (inverted) or a gray background icon (darkened).
[0122] For example, the black pixel ratio threshold is set to 60%, and the white pixel ratio of the icon to be drawn is 75%, indicating that the icon to be drawn may be a text icon. Obviously, in the dark mode, the text icon can be inverted, that is, the black text is converted into white text.
[0123] 404: The grouping module 305 groups the icons to be drawn based on the preprocessing result.
[0124] In some embodiments of the present application, the grouping module 305 performs grouping based on the size of icons, that is, putting icons to be drawn of the same size into an array, and the difference between the numbers of two adjacent icons to be drawn in the same array is smaller than a difference threshold.
[0125] For example, the grouping module 305 divides the icons into three arrays based on their sizes, namely array 1, array 2 and array 3, and the difference threshold is set to 5. The size of the icons in array 1 is 100×100, the size of the icons in array 2 is 80×80, and the size of the icons in array 3 is 50×50.
[0126] like Figure 8 As shown, array 1 includes 10 icons, numbered 1 to 10, array 2 includes 5 icons, numbered 12, 14, 16, 18, 20, and array 3 includes 5 icons, numbered 21, 24, 27, 30, 33. It can be seen that the difference between the numbers of two adjacent icons in array 1 is 1, the difference between the numbers of two adjacent icons in array 2 is 2, and the difference between the numbers of two adjacent icons in array 3 is 3. The difference between the numbers of two adjacent icons to be drawn in the three arrays is less than the interval threshold. If the size of icon A numbered 40 is also 100×100, the same as the size of the icons in array 1, but the difference between the number of icon A and the number of any icon in array 1 is greater than the interval threshold, icon A cannot be placed in array 1. This is because although icon A and the icons in array 1 are not in the same area, the distance between them in physical space is very far. If icon A is divided into array 1, the drawing strategy of icon A will be the same as the drawing strategy of the icons in array 1. Obviously, the drawing strategy used by icon A and icons numbered 1 to 10 may be different.
[0127] In addition, due to the different sizes, icon A cannot be placed in array 2 and array 3. Icon A must be placed in a new array. One method is to clear all icons in array 1 and then place icon A into array 1. This can save system memory space. In some embodiments of the present application, the grouping management module 305 can save 3 to 5 arrays. If a new icon cannot simultaneously satisfy the requirements of the same icon size and a number difference less than a difference threshold compared to the icons in any existing array, the icon in the array that has not been added for the longest time can be cleared and then added to the cleared array to form a new array.
[0128] In some other embodiments of the present application, the grouping module 305 can group based on multiple features of the icons to be drawn, wherein the multiple features of the icons to be drawn must at least include the size of the icons to be drawn, and the remaining features may be the color type, transparent pixel ratio, etc. of the icons to be drawn.
[0129] For example, the grouping module 305 groups the icons to be drawn that have the same size, colors of the four corners, and color type into one group.
[0130] return Figure 7 , for icons 101, 102 and 103 numbered 1, 2 and 3, these three icons are the same in length and width, for example, the size is 100×100, the colors and shapes of the four corners of the icons are also the same, for example, right angles on a white background, the colors contained in the icons are also the same, the main colors are relatively few, for example, 3, and there is no hollow pixel in the middle of the icon, that is, there is no transparent pixel in the middle of the icon. Therefore, Figure 9a As shown, the grouping module 305 can add icon 101 , icon 102 , and icon 103 to array 4 .
[0131] Continue to refer Figure 7 , for the icons of commonly used functions numbered 10, 12, 14, 16, ..., 30, 32, these 12 icons are the same in length and width, for example, the size is 50×50, the colors and shapes of the four corners of the icon are also the same, for example, transparent right angles, the types of colors contained in the icons are also the same, the main color types are relatively small, for example, 1, and the proportion of hollow pixels in the icons is large, for example, the proportion of transparent pixels in the icons exceeds 50%. Therefore, Figure 9b As shown, the grouping module 305 can divide the "notification" icons, "favorites" icons, "lock screen" icons, "history" icons, ..., "vibration" icons, and "edit" icons numbered 10, 12, 14, 16, ..., 30, 32 into the same array 5.
[0132] 405: The grouping module 305 unifies the drawing strategies of the icons to be drawn in the same group.
[0133] In some embodiments of the present application, the grouping module 305 first counts the types of drawing strategies in the same array and the number of icons of each drawing strategy, and then uses the drawing strategy with the largest number of icons as the unified drawing strategy of the group, that is, all icons in the group use a unified drawing strategy, so as to ensure that the colors and brightness of the icons in the same group displayed on the final display screen 130 are consistent.
[0134] For example, in Table 1, there are 15 icons in the same group, of which 10 icons have a drawing strategy of inverting colors, 2 icons have a drawing strategy of darkening, and 3 icons have a drawing strategy of keeping the icon color unchanged. Since the number of icons using the inverting drawing strategy is the largest, the final drawing strategy of this group is inverting colors.
[0135] Drawing strategy Invert Colors Darken Keep icon color unchanged Number of icons 10 2 3
[0136] Table 1
[0137] refer to Figure 9a , array 4 includes icon 101, icon 102 and icon 103. If the drawing strategy used by icon 101 is darkening, and the rule used by icons 102 and 103 is to keep the icon color unchanged, according to the rule of minority obeys majority, the number of icons using the drawing strategy of keeping the icon color unchanged is greater than the number of icons using the darkening drawing strategy. Finally, the drawing strategy used by array 4 is to keep the icon color unchanged, that is, icons 101, icon 102 and icon 103 all keep the icon color unchanged.
[0138] refer to Figure 9b , Array 5 includes 12 icons to be drawn, namely, "Notification" icon, "Favorites" icon, "Lock Screen" icon, "History" icon, ..., "Vibration" icon, "Edit" icon. If one icon uses the drawing strategy of keeping the icon color unchanged, and two icons use the rule of darkening, for example, "Favorites" icon and "Lock Screen" icon, the remaining 9 icons use the drawing strategy of inverting. According to the rule of minority obeys majority, the number of icons using the inverting drawing strategy is greater than the number of icons using the darkening drawing strategy and the drawing strategy of keeping the icon color unchanged. Finally, the drawing strategy used by Array 5 is inverting, that is, all 12 icons in Array 5 are inverted.
[0139] In some other embodiments of the present application, the grouping module 305 first counts the probability of each icon in the same group using the corresponding drawing strategy, and then uses the drawing strategy with a probability greater than a first probability threshold as the final drawing strategy of the group.
[0140] For example, there are 10 icons in the same group, numbered 1 to 10, among which the drawing strategy of icons numbered 1 to 9 is darkening, but the possibility of these 9 icons using darkening is between 50% and 60%, and the drawing strategy of icon numbered 10 is inverted color, but the possibility of using inverted color for this icon is 95%, indicating that the characteristics of this icon are very obvious, for example, this icon is almost pure white. Since the possibility of using inverted color for icon numbered 10 is greater than the first probability threshold (for example, 90%), all icons in this group finally use the inverted color drawing strategy, so as to ensure that the color and brightness of the icons in the same group displayed on the final display screen 130 are consistent.
[0141] 406: The drawing module 306 draws the icon to be drawn according to a unified drawing strategy.
[0142] For example, for an Android system, the drawing module 306 calls a corresponding color conversion strategy through a corresponding interface, executes the color conversion strategy in a Canvas canvas, and performs drawing.
[0143] 407 : The system of the mobile phone 100 displays the drawn icon on the display screen 130 .
[0144] like Fig.10a As shown, since the drawing strategy used by array 4 where icons 101, 102 and 103 are located is to keep the icon color unchanged, the drawing strategy used by array 5 where the "notification" icon, "favorites" icon, "lock screen" icon, "history" icon, ..., "vibration" icon and "edit" icon are located is to invert the color. Fig.10b As shown, the final drawn icon is displayed on the display screen 130 .
[0145] contrast Figure 1b , Fig.10b In the displayed icons, icons or texts in the same array are displayed consistently, icon 101 has the same color and brightness as icon 102 and icon 103, the color of the "Favorites" icon and the "Lock Screen" icon becomes white instead of gray, and is consistent with the color and brightness of other icons in the same array.
[0146] like Fig.11 As shown, the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0147] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0148] like Fig.11As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0149] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the display screen 130, capture the display screen 130, etc.
[0150] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, icons, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0151] The view system includes visual controls, such as controls for displaying text, controls for displaying icons, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying icons.
[0152] The phone manager is used to provide communication functions for terminal devices, such as the management of call status (including answering, hanging up, etc.).
[0153] The resource manager provides various resources for the application, such as localized strings, icons, icons, layout files, video files, etc.
[0154] The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the display screen 130 in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.
[0155] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0156] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0157] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as icon life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0158] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0159] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0160] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static icon files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0161] The 3D graphics processing library is used to implement 3D graphics drawing, icon rendering, compositing, and layer processing.
[0162] A 2D graphics engine is a drawing engine for 2D drawings.
[0163] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0164] References in the specification to "some embodiments" or "embodiments" mean that a particular feature, structure, or characteristic described in conjunction with the embodiments is included in at least one exemplary implementation or technique according to the present disclosure. The appearances of the phrase "in one embodiment" in various places in the specification do not necessarily all refer to the same embodiment.
[0165] The present disclosure also relates to an operating device for performing the text. The device can be constructed specifically for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program can be stored in a computer-readable medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic or optical card, an application-specific integrated circuit (ASIC) or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus. In addition, the computer mentioned in the specification can include a single processor or can be an architecture involving multiple processors for increased computing power.
[0166] The process and display proposed herein do not inherently relate to any specific computer or other device. Various general purpose systems may also be used together with the program according to the teachings herein, or it may prove convenient to construct more special purpose devices to perform one or more method steps. The structure for various these systems is discussed in the following description. In addition, any specific programming language sufficient to implement the technology and embodiments of the present disclosure may be used. Various programming languages may be used to implement the present disclosure, as discussed herein.
[0167] Additionally, the language used in this specification has been primarily selected for readability and instructional purposes and may not have been selected to delineate or limit the disclosed subject matter.Thus, this disclosure is intended to illustrate but not to limit the scope of the concepts discussed herein.
Claims
1. A color mode conversion method for an electronic device, characterized in that: include: The electronic device receives an instruction to convert a current display mode into a color mode; The electronic device determines an icon conversion strategy for each icon to be converted in the icon group to be converted; The electronic device determines the group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted; The electronic device uses the group conversion strategy to perform color conversion on each icon to be converted in the group of icons to be converted.
2. The method according to claim 1, characterized in that The icons to be converted include various function icons of applications installed on the electronic device in an open state.
3. The method according to claim 2, characterized in that Also includes: The function icons in the applications on the electronic device are grouped according to the positional relationship and icon features between the function icons in the applications.
4. The method according to claim 3, characterized in that The icon feature includes at least one of icon size, color included in the icon, number of colors included in the icon, and icon transparency.
5. The method according to claim 4, characterized in that The electronic device groups the icons in the following manner: The electronic device groups adjacent icons into the same group when the interval distance between adjacent icons is less than a distance threshold and at least one of the icon sizes, the colors included in the icons, the number of colors included in the icons, and the icon transparency of the adjacent icons are equal.
6. The method according to claim 3, characterized in that: When grouping icons, the electronic device limits the number of icon groups into which application icons or function icons in an application are grouped to a predetermined number.
7. The method according to claim 1, characterized in that The electronic device determines the group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted, including: Count the number of icons to be converted that use each icon conversion strategy in the icon group to be converted; The icon conversion strategy with the largest number of uses is determined as the group conversion strategy of the icon group to be converted.
8. The method according to claim 1, characterized in that The electronic device determines the group conversion strategy of the icon group to be converted based on the icon conversion strategy of each icon to be converted, further comprising: Calculate the determination probability of the conversion strategy of each icon to be converted in the group of icons to be converted; The icon conversion strategy with a determination probability greater than a probability threshold is determined as the group conversion strategy of the icon group to be converted.
9. The method according to claim 1, characterized in that: The icon conversion strategy includes any of the following: Invert color; Darken; Color mapping; Brighten; Remain unchanged.
10. The method according to claim 9, characterized in that The icon conversion strategy is determined by the following methods, including: If the icon to be converted is a background icon, the icon conversion strategy is inverting, darkening or color mapping, so that the background icon is converted into a dark icon; If the icon to be converted is a foreground icon, the icon conversion strategy is to darken, color map, remain unchanged or brighten, so that the foreground icon is converted into a light-colored icon while maintaining a predetermined contrast with the background icon.
11. A readable medium storing instructions, characterized in that: When the instructions are executed on the electronic device, the readable medium executes the color mode conversion method of the electronic device according to any one of claims 1 to 10.
12. An electronic device, characterized in that: include: A memory storing instructions; A processor is coupled to the memory, and when the program instructions stored in the memory are executed by the processor, the electronic device executes the color mode conversion method of the electronic device according to any one of claims 1 to 10.
