CN109410295B - Color setting method, device, equipment and computer readable storage medium - Google Patents

Color setting method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN109410295B
CN109410295B CN201811074154.XA CN201811074154A CN109410295B CN 109410295 B CN109410295 B CN 109410295B CN 201811074154 A CN201811074154 A CN 201811074154A CN 109410295 B CN109410295 B CN 109410295B
Authority
CN
China
Prior art keywords
color
value
values
target
background layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811074154.XA
Other languages
Chinese (zh)
Other versions
CN109410295A (en
Inventor
刘少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201811074154.XA priority Critical patent/CN109410295B/en
Publication of CN109410295A publication Critical patent/CN109410295A/en
Application granted granted Critical
Publication of CN109410295B publication Critical patent/CN109410295B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention discloses a color setting method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: reading a background layer comprising one or more colors; obtaining the main color of the background layer according to the color value of the pixel point of the background layer; acquiring a first color with a preset color contrast degree with the main color of the background layer; and setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer. The invention can automatically set the painting brush with proper color according to the color of the background layer, thereby facilitating the operation and viewing of writers.

Description

Color setting method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a color setting method, apparatus, device, and computer readable storage medium.
Background
Drawing boards are application software which can write and erase handwriting in a specific area by using input devices such as a mouse/touch screen/touch pad. The drawing boards can be roughly classified into a drawing board of a fixed background picture and a drawing board of a non-fixed background picture according to the background picture thereof. For a fixed background drawing board, the brush color of the board may be fixed (e.g., black-green blackboard background with white brush); however, it is not preferable to use a fixed brush color for a palette without a fixed background image, because it may occur that the brush color is too weak to contrast with the background image color, resulting in writing on the palette not being visible.
Currently, for a drawing board without a fixed background picture, a color taking board color taking method is generally adopted to set the color of a painting brush. The color extraction panel has the advantage of high user customization, and the disadvantage of not being quick and automated, and the writer needs to spend additional effort and time selecting the appropriate color, which results in distraction of the writer and the participants.
Disclosure of Invention
The embodiment of the invention provides a color setting method, a device, equipment and a computer readable storage medium, which aim at a drawing board without a fixed background image, can automatically set a drawing pen with a proper color according to the background image, and is convenient for a writer to operate.
The embodiment of the invention provides a color setting method, which comprises the following steps:
reading a background layer comprising one or more colors;
obtaining the main color of the background layer according to the color value of the pixel point of the background layer;
acquiring a first color with a preset color contrast degree with the main color of the background layer;
and setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer.
Preferably, the main color of the background layer is obtained according to the color value of the pixel point of the background layer, specifically:
extracting the color value of each pixel point on the background layer, counting the number of pixels corresponding to each color value, and setting the color value with the largest number of pixels as the main color of the background layer;
the obtaining a first color with a predetermined color contrast degree with the main color of the background layer specifically comprises:
projecting the main color to an HSV color space to obtain an HSV value corresponding to the main color;
inverting the H value in the HSV values to obtain H' values;
and obtaining a first color according to the H' value.
Preferably, the main color of the background layer is obtained according to the color value of the pixel point of the background layer, specifically:
extracting the color value of each pixel point on the background layer, and counting the number of pixels corresponding to each color value;
obtaining N color values of which the pixel number is arranged in the front N bits, and obtaining the main color of the background layer;
the acquiring the first color with the predetermined color contrast degree with the main color of the background layer specifically comprises:
projecting the N color values into an HSV color space to obtain N H values corresponding to the N color values;
obtaining a target H value set according to the N H values and a preset hue angle distance threshold;
and obtaining a first color according to the target H value set.
Preferably, the obtaining a target H value set according to the N H values and a preset hue angle distance threshold specifically includes:
and obtaining target H values, the absolute values of which are larger than a preset hue angle distance threshold value, of the differences between the N H values, and generating a target H value set according to the obtained target H values.
Preferably, the obtaining the target H value set according to the N H values and a preset hue angle distance threshold specifically includes:
s1: judging whether target H values with hue angle distances from H values in a background H value set are larger than a preset hue angle distance threshold value exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits;
s2: if so, generating a target H value set according to the acquired target H value;
s3: if not, deleting the last H value in the background H value set, and returning to the step S1; the last H value is the H value with the least number of pixels of the corresponding color value among all H values in the background H value set.
Preferably, the obtaining a first color according to the target H value set specifically includes:
acquiring a first H value corresponding to a color value with the largest pixel number;
calculating a target H value with the greatest color contrast degree with the first H value in the target H value set;
and obtaining a first color according to the target H value.
Preferably, the hue angle distance threshold is 120 °, and the greater the degree of color contrast of two colors when the hue angle distance of the H values of the two colors on the hue circle is closer to 180 °.
The embodiment of the invention also provides a color setting device, which comprises:
the background layer reading unit is used for reading a background layer comprising one or more colors;
a main color acquisition unit, configured to obtain a main color of the background layer according to a color value of a pixel point of the background layer;
a first color acquisition unit configured to acquire a first color having a predetermined degree of color contrast with a main color of the background layer;
and the color setting unit is used for setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer.
Preferably, the main color obtaining unit is specifically configured to extract a color value of each pixel point on the background layer, count the number of pixels corresponding to each color value, and set a color value with the largest number of pixels as a main color of the background layer;
the first color acquisition unit specifically includes:
the projection module is used for projecting the main color to an HSV color space to obtain an HSV value corresponding to the main color;
the inverting module is used for inverting the H value in the HSV values to obtain H' values;
and the first color acquisition module is used for acquiring a first color according to the H' value.
Preferably, the main color acquisition unit specifically includes:
the statistics module is used for extracting the color value of each pixel point on the background layer and counting the number of pixels corresponding to each color value;
the main color acquisition module is used for acquiring N color values of which the pixel number is arranged in the front N bits to acquire the main color of the background layer;
the first color acquisition unit specifically includes:
the projection module is used for projecting the N color values into an HSV color space to obtain N H values corresponding to the N color values;
the target H value set acquisition module is used for acquiring a target H value set according to the N H values and a preset hue angle distance threshold value;
and the first color acquisition module is used for acquiring a first color according to the target H value set.
Preferably, the target H value set acquisition module is specifically configured to:
and acquiring target H values with hue angle distances from N H values being larger than a preset hue angle distance threshold value, and generating a target H value set according to the acquired target H values.
Preferably, the target H value set obtaining module specifically includes:
the judging submodule is used for judging whether target H values with hue angle distances from H values in the background H value set are larger than a preset hue angle distance threshold value exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits; if yes, notifying a target H value set generation sub-module; if not, notifying the deleting sub-module;
the target H value set generation submodule is used for generating a target H value set according to the acquired target H value;
the deleting sub-module is used for deleting the last H value in the background H value set and notifying the judging sub-module; the last H value is the H value with the least number of pixels of the corresponding color value among all H values in the background H value set.
Preferably, the first color acquisition module specifically includes:
the first H value acquisition sub-module is used for acquiring a first H value corresponding to the color value with the largest pixel number;
the target H value calculation sub-module is used for calculating a target H value with the greatest color contrast degree with the first H value in the target H value set;
and the first color acquisition sub-module is used for acquiring a first color according to the target H value.
Preferably, the hue angle distance threshold is 120 °, and the greater the degree of color contrast of two colors when the hue angle distance of the H values of the two colors is closer to 180 °.
The embodiment of the invention also provides a color setting device, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processing, wherein the color setting method is realized when the processor executes the computer program.
The embodiment of the invention also provides a computer readable storage medium, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the process, wherein the color setting method is realized when the processor executes the computer program.
In the above embodiment, since the first color and the main color of the background layer have a predetermined color contrast degree, at least most handwriting or editing information drawn on the background layer can be easily distinguished by the meeting participants and the writers, and meanwhile, the writers are not required to select the colors through the color-taking plate, so that the operation of the writers is facilitated.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a color setting method according to a first embodiment of the present invention.
Fig. 2 is a schematic diagram of a color phase ring according to a first embodiment of the present invention.
Fig. 3 is a schematic structural view of a color setting device according to a second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a first embodiment of the present invention provides a color setting method, which at least includes:
s101, reading a background layer comprising one or more colors.
In this embodiment, when a drawing board with a background layer or editable application software with a background layer is opened, the background layer may be read. The background layer may include only one color, or may include multiple colors or patterns, and the invention is not limited in particular.
In addition, the background layers may be variable, for example, a plurality of background layers may be preset, and one background layer is randomly selected to be loaded each time the drawing board or the application software is started.
S102, obtaining the main color of the background layer according to the color value of the pixel point of the background layer.
In this embodiment, after the background layer is obtained, the color value of each pixel on the background layer may be extracted, so that the main color of the background layer is obtained according to the color value of each pixel.
In one implementation:
the number of pixels corresponding to each color value contained in the background layer may be counted, and then the color value having the largest number of pixels is set as the primary color of the background layer.
In another implementation:
the number of pixels corresponding to each color value contained in the background layer may be counted, and then the N color values with the number of pixels arranged in the first N are set as the main color of the background layer.
Where N may be a fixed value, for example, 3,4,5. It is also possible to require that the sum of the pixel numbers of the N color values of the N preceding pixel numbers reaches at least a predetermined proportion of the total pixel number of the background layer, e.g. at least 70%, etc.
S103, a first color with a preset color contrast degree with the main color of the background layer is obtained.
In this embodiment, the color contrast degree is defined as the difference between two colors, wherein the larger the color contrast degree is, the larger the difference between the two colors is, and the more obvious the contrast is at the time of display. For example, cyan and red are complementary colors in hue, and accordingly, the degree of color contrast is also maximized.
In one implementation, the degree of color contrast of two colors can be determined by their hue angle distance on the hue circle.
Specifically, for a color represented by RGB, it may be projected into HSV space to obtain its corresponding HSV value, where H represents hue, S represents saturation, and V represents brightness. Hue is the primary characteristic of color and is the most accurate standard for distinguishing between various colors. Hues of different colors can be represented by a hue angle on a hue circle (as shown in fig. 2), wherein the intensity of hue contrast can be divided into:
the same hue: the hue angle distance of the hues of the two colors on the hue circle is 0 degrees;
adjacent color phase: the hue angle distance of the hues of the two colors on the hue circle is 15 degrees to 30 degrees;
similar hue: the hue angle distance of the hues of the two colors on the hue circle is between 30 degrees and 60 degrees;
medium-difference hue: the hue angle distance of the hues of the two colors on the hue circle is between 60 and 90 degrees;
contrasting color: the hue angle distance of the hues of the two colors on the hue circle is between 90 DEG and 120 DEG; tonifying device
Hue: the hue angle distance of the hues of the two colors on the hue circle is 180 °.
It can be seen that the hue angle distance of the two colors on the hue circle is 180 ° at the maximum, and when the hue angle distance of the two colors is between 120 ° and 180 °, the two colors have a relatively obvious contrast effect and can be easily distinguished when displayed.
And S104, setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer.
In this embodiment, after the first color is determined, the first color is set to a default color value of the background layer, so that when a writer needs to perform handwriting drawing or other editing operations on the background layer, the writer automatically defaults to perform editing drawing with the first color. Because the first color and the main color of the background layer have preset color contrast degree, at least most handwriting or editing information drawn on the background layer can be distinguished easily by participants and writers, and meanwhile, the writers are not required to select colors through the color taking plate, so that the operation of the writers is facilitated.
In order to facilitate an understanding of the invention, some preferred embodiments of the invention are described further below.
On the basis of the first embodiment, in a preferred embodiment:
step S102, specifically, the following steps:
obtaining a color value of each pixel point on the background layer, counting the number of pixels corresponding to each color value, and setting the color value with the largest number of pixels as the main color of the background layer;
step S103 specifically includes:
projecting the main color to an HSV color space to obtain an HSV value corresponding to the main color;
inverting the H value in the HSV values to obtain H' values;
and obtaining a first color according to the H' value.
In this embodiment, the hue angle distance between the H' value and the H value on the hue circle is 180 °, so that the primary color has the greatest color contrast degree with the first color, so that handwriting of the brush can be displayed most obviously on the background layer.
It should be noted that the S value and the V value of the first color may be the same as the S value and the V value of the main color, or the saturation S of the first color may be reduced according to actual needs to achieve a soft color, which is not specifically limited in the present invention.
In a preferred embodiment:
step S102, specifically, the following steps:
extracting the color value of each pixel point on the background layer, and counting the number of pixels corresponding to each color value;
obtaining N color values of which the pixel number is arranged in the front N bits, and obtaining the main color of the background layer;
step S103 specifically includes:
s1031, projecting the N color values into an HSV color space to obtain N H values corresponding to the N color values;
s1032, obtaining a target H value set according to the N H values and a preset hue angle distance threshold value;
s1033, obtaining a first color according to the target H value set.
In the above embodiment, considering that the background layer may include multiple colors, if the first color is generated only according to the color with the largest number of pixels, handwriting of the brush may not be detected in a partial area. For example, one background layer includes red and cyan, and the proportion of red is slightly greater than that of cyan, then the color opposite to red is cyan, and if the first color is set to cyan, handwriting drawn in the cyan region of the background layer is rendered difficult to view.
For this reason, in this embodiment, N color values of which the number of pixels is arranged in the first N bits are obtained at the same time, and the main color of the background layer is obtained. Meanwhile, when the first color is selected, the hue angle distances between the hue of the first color and the hues of the N color values are required to be larger than a preset hue angle distance threshold (for example, are larger than 120 degrees), so that handwriting drawn by the first color can be ensured to be obviously seen in most areas of the background layer.
For example, assuming that N H values of the N color values are 80 °, 100 °, 150 °, and the hue angle distance threshold is 120 °, the calculated target H value set is [270 °,320 ° ] according to the basic set operation rule.
In a preferred embodiment, S1032 specifically includes:
s1: judging whether target H values with absolute values of differences from H values in a background H value set larger than a preset hue angle distance threshold exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits;
s2: if so, generating a target H value set according to the acquired target H value;
s3: if not, deleting the last H value in the background H value set, and returning to the step S1; the last H value is the H value with the least number of pixels of the corresponding color value among all H values in the background H value set.
In the above embodiment, a case may occur in which the target H value set is an empty set, that is, there is no target H value that meets the requirements. For example, assuming that N H values of the N color values are 80 °, 100 °, 205 °, and the hue angle distance threshold is 120 °, the calculated set of target H values is an empty set.
For this reason, in the present embodiment, if the calculated target H value set is an empty set, the last H value (for example, 205 °) in the background H value set is deleted, and at this time, the background H value set is 80 °, 100 °, and the calculated target H value set is [220 °,320 ° ].
In this embodiment, by deleting the last H value, it is ensured that a required target H value set can be obtained, and because the last H value is deleted, the influence on the overall drawing effect is small.
Preferably, the obtaining a first color according to the target H value set specifically includes:
acquiring a first H value corresponding to a color value with the largest pixel number;
calculating a target H value with the greatest color contrast degree with the first H value in the target H value set;
and obtaining a first color according to the target H value.
In this embodiment, for example, the first H value corresponding to the color value with the largest number of pixels is 80 °, the target H value set is [220 °,320 ° ], and then 260 ° is selected as the target H value, and the first color is generated by the target H value. At this time, the generated first color has the greatest color contrast degree with the most dominant color of the background layer, so that the display effect drawn on the background layer can be ensured as much as possible.
It should be noted that, in the above embodiment, the hue angle distance threshold is not limited to 120 ° mentioned above, and may be set according to actual needs, and the present invention is not particularly limited.
Referring to fig. 3, a second embodiment of the present invention further provides a color setting device, including:
a background layer reading unit 10 for reading a background layer including one or more colors;
a main color obtaining unit 20, configured to obtain a main color of the background layer according to a color value of a pixel point of the background layer;
a first color acquisition unit 30 for acquiring a first color having a predetermined degree of color contrast with a main color of the background layer;
and a color setting unit 40, configured to set the first color as a default color value of the background layer, so as to perform editing drawing according to the first color value by default on the background layer.
Preferably, the main color obtaining unit 20 is specifically configured to extract a color value of each pixel point on the background layer, count the number of pixels corresponding to each color value, and set the color value with the largest number of pixels as the main color of the background layer;
the first color acquisition unit 30 specifically includes:
the projection module is used for projecting the main color to an HSV color space to obtain an HSV value corresponding to the main color;
the inverting module is used for inverting the H value in the HSV values to obtain H' values;
and the first color acquisition module is used for acquiring a first color according to the H' value.
Preferably, the main color acquisition unit 20 specifically includes:
the statistics module is used for extracting the color value of each pixel point on the background layer and counting the number of pixels corresponding to each color value;
the main color acquisition module is used for acquiring N color values of which the pixel number is arranged in the front N bits to acquire the main color of the background layer;
the first color acquisition unit 30 specifically includes:
the projection module is used for projecting the N color values into an HSV color space to obtain N H values corresponding to the N color values;
the target H value set acquisition module is used for acquiring a target H value set according to the N H values and a preset hue angle distance threshold value;
and the first color acquisition module is used for acquiring a first color according to the target H value set.
Preferably, the target H value set acquisition module is specifically configured to:
and acquiring target H values with hue angle distances from N H values being larger than a preset hue angle distance threshold value, and generating a target H value set according to the acquired target H values.
Preferably, the target H value set obtaining module specifically includes:
the judging submodule is used for judging whether target H values with hue angle distances from H values in the background H value set are larger than a preset hue angle distance threshold value exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits; if yes, notifying a target H value set generation sub-module; if not, notifying the deleting sub-module;
the target H value set generation submodule is used for generating a target H value set according to the acquired target H value;
the deleting sub-module is used for deleting the last H value in the background H value set and notifying the judging sub-module; the last H value is the H value with the least number of pixels of the corresponding color value among all H values in the background H value set.
Preferably, the first color acquisition module specifically includes:
the first H value acquisition sub-module is used for acquiring a first H value corresponding to the color value with the largest pixel number;
the target H value calculation sub-module is used for calculating a target H value with the greatest color contrast degree with the first H value in the target H value set;
and the first color acquisition sub-module is used for acquiring a first color according to the target H value.
Preferably, the hue angle distance threshold is 120 °, and the greater the degree of color contrast of two colors when the hue angle distance of the H values of the two colors is closer to 180 °.
A third embodiment of the present invention provides a color setting apparatus including a processor, a memory, and a computer program stored in the memory and configured to be executed by the process, the processor implementing the color setting method as described in the first embodiment when executing the computer program.
The fourth embodiment of the present invention also provides a computer-readable storage medium including a stored computer program. Wherein the device in which the computer-readable storage medium is located is controlled to execute one of the color setting methods described in the first embodiment described above when the computer program is run.
Illustratively, the computer programs described in the third and fourth embodiments of the present invention may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in the implementation of a color setting device. For example, the device described in the second embodiment of the present invention.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the color setting method, and which connects the various parts of the entire implementation color setting method using various interfaces and lines.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the internet of things-based item tracking method by running or executing the computer program and/or module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, a text conversion function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, text message data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the modules may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on this understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each method embodiment described above when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that the above-described apparatus embodiments are merely illustrative, and the units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (6)

1. A color setting method, characterized by comprising:
reading a background layer comprising one or more colors;
obtaining the main color of the background layer according to the color value of the pixel point of the background layer; extracting the color value of each pixel point on the background layer, and counting the number of pixels corresponding to each color value; obtaining N color values of which the pixel number is arranged in the front N bits, and obtaining the main color of the background layer; wherein the sum of the pixel numbers of the N color values before the pixel number reaches at least a predetermined proportion of the total pixel number of the background layer; the predetermined ratio is at least 70%;
acquiring a first color with a preset color contrast degree with the main color of the background layer; the N color values are projected to an HSV color space to obtain N H values corresponding to the N color values; obtaining a target H value set according to the N H values and a preset hue angle distance threshold; obtaining a first color according to the target H value set; specifically, a first H value corresponding to a color value with the largest pixel number is obtained; calculating a target H value with the greatest color contrast degree with the first H value in the target H value set; obtaining a first color according to the target H value, and simultaneously reducing the saturation S of the first color; the obtaining the target H value set according to the N H values and a preset hue angle distance threshold specifically includes: s1: judging whether target H values with hue angle distances from H values in a background H value set are larger than a preset hue angle distance threshold value exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits; s2: if so, generating a target H value set according to the acquired target H value; s3: if not, deleting the last H value in the background H value set, and returning to the step S1; the last H value is the H value with the least number of pixels of the corresponding color value in all H values in the background H value set;
and setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer.
2. The color setting method according to claim 1, wherein the obtaining a target H value set according to the N H values and a preset hue angle distance threshold value specifically includes:
and acquiring target H values with hue angle distances from the N H values being larger than a preset hue angle distance threshold, and generating a target H value set according to the acquired target H values.
3. The color setting method according to claim 2, wherein the hue angle distance threshold is 120, and the degree of color contrast of two colors is greater as the hue angle distance of the H values of the two colors on the hue circle is closer to 180 °.
4. A color setting device, characterized by comprising:
the background layer reading unit is used for reading a background layer comprising one or more colors;
a main color acquisition unit, configured to obtain a main color of the background layer according to a color value of a pixel point of the background layer; the method is specifically used for: extracting the color value of each pixel point on the background layer, and counting the number of pixels corresponding to each color value; obtaining N color values of which the pixel number is arranged in the front N bits, and obtaining the main color of the background layer; wherein the sum of the pixel numbers of the N color values before the pixel number reaches at least a predetermined proportion of the total pixel number of the background layer; the predetermined ratio is at least 70%;
a first color acquisition unit configured to acquire a first color having a predetermined degree of color contrast with a main color of the background layer; the method is specifically used for: projecting the N color values into an HSV color space to obtain N H values corresponding to the N color values; obtaining a target H value set according to the N H values and a preset hue angle distance threshold; obtaining a first color according to the target H value set; specifically, a first H value corresponding to a color value with the largest pixel number is obtained; calculating a target H value with the greatest color contrast degree with the first H value in the target H value set; obtaining a first color according to the target H value, and simultaneously reducing the saturation S of the first color; the obtaining the target H value set according to the N H values and a preset hue angle distance threshold specifically includes: s1: judging whether target H values with hue angle distances from H values in a background H value set are larger than a preset hue angle distance threshold value exist or not; the background H value set initially comprises N H values corresponding to N color values of which the number of pixels is arranged in the front N bits; s2: if so, generating a target H value set according to the acquired target H value; s3: if not, deleting the last H value in the background H value set, and returning to the step S1; the last H value is the H value with the least number of pixels of the corresponding color value in all H values in the background H value set;
and the color setting unit is used for setting the first color as a default color value of the background layer so as to edit and draw according to the first color value by default on the background layer.
5. A color setting device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the process, the processor implementing the color setting method according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized by comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the process, the processor implementing the color setting method according to any one of claims 1 to 3 when executing the computer program.
CN201811074154.XA 2018-09-14 2018-09-14 Color setting method, device, equipment and computer readable storage medium Active CN109410295B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811074154.XA CN109410295B (en) 2018-09-14 2018-09-14 Color setting method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811074154.XA CN109410295B (en) 2018-09-14 2018-09-14 Color setting method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109410295A CN109410295A (en) 2019-03-01
CN109410295B true CN109410295B (en) 2023-09-15

Family

ID=65464910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811074154.XA Active CN109410295B (en) 2018-09-14 2018-09-14 Color setting method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109410295B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111091607B (en) * 2019-12-24 2023-08-29 厦门美图之家科技有限公司 Color matching method and device, electronic equipment and storage medium
CN111612857B (en) * 2020-05-28 2024-03-26 北京明略昭辉科技有限公司 Color acquisition method and device, electronic equipment and readable storage medium
CN113377311A (en) * 2021-06-10 2021-09-10 广州朗国电子科技有限公司 Electronic blackboard control system and method and electronic equipment
CN113256498B (en) * 2021-06-24 2021-11-02 杭州未名信科科技有限公司 Interpolation method, device and equipment based on three-dimensional color space and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102769758A (en) * 2012-07-18 2012-11-07 京东方科技集团股份有限公司 Method and system for processing RGB (red, green and blue) data
CN104811677A (en) * 2015-05-22 2015-07-29 广东欧珀移动通信有限公司 Display control method and device of mobile terminal
CN104834454A (en) * 2014-02-10 2015-08-12 宏碁股份有限公司 Electronic device and display method thereof
CN105979400A (en) * 2016-06-28 2016-09-28 乐视控股(北京)有限公司 Screen brightness adjusting method, device and terminal
CN106775747A (en) * 2016-12-28 2017-05-31 Tcl集团股份有限公司 A kind of method and apparatus of color configuration
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture
CN108389163A (en) * 2018-01-22 2018-08-10 西安工程大学 A kind of self-adapting enhancement method based on half-light coloured image

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10217243B2 (en) * 2016-12-20 2019-02-26 Canon Kabushiki Kaisha Method, system and apparatus for modifying a scene model

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102769758A (en) * 2012-07-18 2012-11-07 京东方科技集团股份有限公司 Method and system for processing RGB (red, green and blue) data
CN104834454A (en) * 2014-02-10 2015-08-12 宏碁股份有限公司 Electronic device and display method thereof
CN104811677A (en) * 2015-05-22 2015-07-29 广东欧珀移动通信有限公司 Display control method and device of mobile terminal
CN105979400A (en) * 2016-06-28 2016-09-28 乐视控股(北京)有限公司 Screen brightness adjusting method, device and terminal
CN106775747A (en) * 2016-12-28 2017-05-31 Tcl集团股份有限公司 A kind of method and apparatus of color configuration
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture
CN108389163A (en) * 2018-01-22 2018-08-10 西安工程大学 A kind of self-adapting enhancement method based on half-light coloured image

Also Published As

Publication number Publication date
CN109410295A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109410295B (en) Color setting method, device, equipment and computer readable storage medium
CN108961157B (en) Picture processing method, picture processing device and terminal equipment
CN109005283B (en) Method, device, terminal and storage medium for displaying notification message
CN111957040A (en) Method and device for detecting shielding position, processor and electronic device
CN107909368B (en) Payment control method and device, terminal and readable storage medium
CN111223045B (en) Jigsaw method and device and terminal equipment
US8830251B2 (en) Method and system for creating an image
US20150098648A1 (en) Image Processing Device Capable of Segmenting an Image into Plural Areas
CN108668161A (en) Method of video image processing, computer installation and computer readable storage medium
CN112449110B (en) Image processing method and device and electronic equipment
CN112149745B (en) Method, device, equipment and storage medium for determining difficult example sample
CN111597009A (en) Application program display method and device and terminal equipment
CN111861965B (en) Image backlight detection method, image backlight detection device and terminal equipment
CN108898169B (en) Picture processing method, picture processing device and terminal equipment
CN108932704B (en) Picture processing method, picture processing device and terminal equipment
CN113837181B (en) Screening method, screening device, computer equipment and computer readable storage medium
CN114546375A (en) Page configuration method, page configuration device and electronic equipment
CN110969674B (en) Method and device for generating winding drawing, terminal equipment and readable storage medium
CN114245193A (en) Display control method and device and electronic equipment
CN114298925A (en) Picture character fidelity editing method and device and computer readable storage medium
US20180211027A1 (en) Password setting method and device
CN109242763B (en) Picture processing method, picture processing device and terminal equipment
CN113902841A (en) Image drawing method and device, electronic equipment and readable storage medium
CN113747076A (en) Shooting method and device and electronic equipment
CN109089040B (en) Image processing method, image processing device and terminal equipment

Legal Events

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