CN107358637A - Word-Drawing method and device, terminal and storage medium - Google Patents

Word-Drawing method and device, terminal and storage medium Download PDF

Info

Publication number
CN107358637A
CN107358637A CN201710508903.4A CN201710508903A CN107358637A CN 107358637 A CN107358637 A CN 107358637A CN 201710508903 A CN201710508903 A CN 201710508903A CN 107358637 A CN107358637 A CN 107358637A
Authority
CN
China
Prior art keywords
component
color
pixel
target
word
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.)
Granted
Application number
CN201710508903.4A
Other languages
Chinese (zh)
Other versions
CN107358637B (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.)
Chengdu kugou business incubator management Co.,Ltd.
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201710508903.4A priority Critical patent/CN107358637B/en
Publication of CN107358637A publication Critical patent/CN107358637A/en
Application granted granted Critical
Publication of CN107358637B publication Critical patent/CN107358637B/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/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Abstract

The invention discloses a kind of Word-Drawing method and device, terminal and storage medium, belong to technical field of image processing.Including:Using the color value being pre-configured with of each pixel of word to be drawn, by Word-Drawing to be drawn on interim base map;The color component and the color component being pre-configured with of the corresponding pixel points of word to be drawn for comparing the first pixel on interim base map whether there is difference;If the color component of the first pixel on interim base map has differences with the color component being pre-configured with of the corresponding pixel points of word to be drawn, the target color values of the second pixel are determined, the transparency of color component of the target color values based on the first pixel and target base map obtains;On target base map the second pixel is drawn using target color values.The invention enables the color for the word drawn out and expected color are closer, the degree of accuracy of the color for the word drawn out is improved.The present invention is used to draw word on image.

Description

Word-Drawing method and device, terminal and storage medium
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of Word-Drawing method and device, terminal and storage Medium.
Background technology
In order to lift the display effect of image, it usually needs drawn in the target base map of image have default transparency and The word of color value.In correlation technique, using GDI (English:Graphics Device Interface;Referred to as: GDI) and Word-Drawing function, drawn in the target base map with certain transparency and color with default transparency and color The word of value.
Because correlation technique does not consider influence of the target base map to the word of drafting when drawing word, may cause in mesh There is certain difference with expected color in the color for the word drawn out in base number of a tender figure.
The content of the invention
In order to solve not consider influence of the target base map to the word of drafting in correlation technique, may cause in target base map In the color of word drawn out there is the problem of certain difference with expected color, the embodiments of the invention provide a kind of text Word method for drafting and device, terminal and storage medium.The technical scheme is as follows:
First aspect, there is provided a kind of Word-Drawing method, including:
Using the color value being pre-configured with of each pixel of word to be drawn, by the Word-Drawing to be drawn On interim base map, each word is made up of multiple pixels, and the color value includes transparency component and multiple color components, The transparency component of all pixels point and color component are 0 in the interim base map, and the word to be drawn is to wait to draw Word to target base map;
Compare the respective pixel of the color component and the word to be drawn of the first pixel on the interim base map The color component being pre-configured with of point whether there is difference, and first pixel is any being plotted on the interim base map Pixel;
If the corresponding pixel points of the color component and the word to be drawn of the first pixel on the interim base map The color component being pre-configured with have differences, determine the target color values of the second pixel, the target color values are based on institute The transparency for stating the color component and the target base map of the first pixel is obtained, and second pixel is described to be waited to draw The pixel corresponding with first pixel of word;
On the target base map the second pixel is drawn using the target color values.
Alternatively, the contrast of the target color values and the target base map is less than the color value of first pixel With the contrast of the target base map.
Alternatively, the target color values include:Target clear degree component, the color of object for determining the second pixel Value, including:
Obtain the transparency component of the target base map;
The transparency component of first pixel is obtained, the transparency component of first pixel is according to described first The color component of pixel determines;
The target is determined according to the transparency component of the transparency component of the target base map and first pixel Transparency component.
Alternatively, the target color values include:Multiple color of object components,
The target color values for determining the second pixel, in addition to:
Judge whether the target clear degree component is more than the first color component, first color component is described first Any color component in multiple color components of pixel;
When the target clear degree component is more than first color component, the target clear degree component is defined as First object color component, the first object color component are to divide in the multiple color of object component with first color Color of object component corresponding to amount.
Alternatively, methods described also includes:
When the target clear degree component is not more than first color component, first color component is defined as The first object color component.
Alternatively, methods described also includes:
If the corresponding pixel points of the color component of first pixel and the word to be drawn are pre-configured with Difference is not present in color component, and second pixel is drawn using the color value of first pixel on the target base map Point.
Alternatively, the transparency component for obtaining first pixel, including:
Determine the average value of multiple color components of first pixel;
The average value is defined as to the transparency component of first pixel.
Alternatively, it is described true according to the transparency component of the target base map and the transparency component of first pixel The fixed target clear degree component, including:
The transparency component of transparency component and first pixel based on the target base map, according to target clear Degree component calculation formula determines the target clear degree component, and the target clear degree component calculation formula is:TargetA= (1-(1-textA/255)*(1-backA/255))*255;
Wherein, the TargetA is the target clear degree component, and the textA is the transparent of first pixel Component is spent, the backA is the transparency component of the target base map.
Alternatively, the multiple color component includes:Red color component, green color component and blue color component.
Second aspect, there is provided a kind of Word-Drawing device, including:
First drafting module, for the color value being pre-configured with of each pixel using word to be drawn, by institute Word-Drawing to be drawn is stated on interim base map, each word is made up of multiple pixels, and the color value includes transparency Component and multiple color components, the transparency component of all pixels point and color component are 0 in the interim base map, described to treat The word of drafting is to wait to draw to the word on target base map;
Comparison module, the color component and the text to be drawn of the first pixel on the interim base map The color component being pre-configured with of the corresponding pixel points of word whether there is difference, and first pixel is described interim to be plotted in Any pixel point on base map;
Determining module, if for the color component of the first pixel on base map temporarily and the word to be drawn The color components being pre-configured with of corresponding pixel points have differences, determine the target color values of the second pixel, the target The transparency of color component of the color value based on first pixel and the target base map obtains, and second pixel is The pixel corresponding with first pixel of the word to be drawn;
Second drafting module, for using the target color values to draw the second pixel on the target base map.
Alternatively, the contrast of the target color values and the target base map is less than the color value of first pixel With the contrast of the target base map.
Alternatively, the target color values include:Target clear degree component, the determining module, including:
First acquisition submodule, for obtaining the transparency component of the target base map;
Second acquisition submodule, for obtaining the transparency component of first pixel, first pixel it is saturating Lightness component determines according to the color component of first pixel;
First determination sub-module, for the transparent of the transparency component according to the target base map and first pixel Degree component determines the target clear degree component.
Alternatively, the target color values include:Multiple color of object components,
The determining module, in addition to:
Judging submodule, for judging whether the target clear degree component is more than the first color component, first face Colouring component is any color component in multiple color components of first pixel;
Second determination sub-module, described in when the target clear degree component is more than first color component, inciting somebody to action Target clear degree component is defined as first object color component, and the first object color component is the multiple color of object point Color of object component corresponding with first color component in amount.
Alternatively, the determining module also includes:
3rd determination sub-module, for when the target clear degree component is not more than first color component, by institute State the first color component and be defined as the first object color component.
Alternatively, described device also includes:
3rd drafting module, if the corresponding picture of color component and the word to be drawn for first pixel Difference is not present in the color component being pre-configured with of vegetarian refreshments, and the color value of first pixel is used on the target base map Draw second pixel.
Alternatively, second acquisition submodule, is specifically used for:
Determine the average value of multiple color components of first pixel;
The average value is defined as to the transparency component of first pixel.
Alternatively, first determination sub-module, is specifically used for:
The transparency component of transparency component and first pixel based on the target base map, according to target clear Degree component calculation formula determines the target clear degree component, and the target clear degree component calculation formula is:TargetA= (1-(1-textA/255)*(1-backA/255))*255;
Wherein, the TargetA is the target clear degree component, and the textA is the transparent of first pixel Component is spent, the backA is the transparency component of the target base map.
Alternatively, the multiple color component includes:Red color component, green color component and blue color component.
The third aspect, there is provided a kind of storage medium, instruction is stored with the storage medium, when the storage medium exists When being run on computer so that the computer performs any described Word-Drawing method of first aspect.
Fourth aspect, there is provided a kind of terminal, including memory, processor and be stored on the memory and can locate The computer program that runs on reason device, described in the computing device during computer program, realize that first aspect is any described Word-Drawing method.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
Word-Drawing method and device, terminal and storage medium provided in an embodiment of the present invention, pass through more interim base map On the color component of the first pixel whether deposited with the color component being pre-configured with of the corresponding pixel points of word to be drawn In difference, when both have differences, the transparency of color component and target base map based on the first pixel, it is determined that waiting to draw Word pixel corresponding with the first pixel target color values, draw the using target color values on target base map Two pixels, relative to correlation technique, it is determined that when the target color values of pixel of word are drawn, consider first The influence of the color component and target base map of pixel so that the color for the word drawn out and expected color are closer, carry The degree of accuracy of the color of the high word drawn out.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of flow chart of Word-Drawing method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of another Word-Drawing method provided in an embodiment of the present invention;
Fig. 3 is a kind of method flow diagram of target color values for determining the second pixel provided in an embodiment of the present invention;
Fig. 4 is to be drawn out using the Word-Drawing method of correlation technique according to the color value being pre-configured with target base map Word schematic diagram;
Fig. 5 is in target base map using Word-Drawing method provided in an embodiment of the present invention according to the color value being pre-configured with On the schematic diagram of word drawn out;
Fig. 6 is a kind of structural representation of Word-Drawing device provided in an embodiment of the present invention;
Fig. 7 is a kind of structural representation of determining module provided in an embodiment of the present invention;
Fig. 8 is the structural representation of another Word-Drawing device provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
In some application scenarios, in order to lift the display effect of the image of display, it usually needs at the target bottom of image The word with certain transparency and color is drawn in figure, such as:When making poster, it is necessary to draw figuratum target bottom Some words are drawn in figure, to lift the display effect of poster.In correlation technique, having using GDI and Word-Drawing function When having drafting word in the target base map of certain transparency and color, due to not considering shadow of the target base map to the word of drafting To ring, there is certain difference in color and the expected color of the word that may cause to draw out in target base map, such as:Use GDI and Word-Drawing function are when drawing the word of black on the white object base map with certain transparency, the text drawn out The profile of black occurs in word, because the profile of the black is not the content of initially desired drafting, therefore, the word drawn out Color and expected color there is certain difference.For the problem, the embodiments of the invention provide a kind of Word-Drawing Method.Fig. 1 is a kind of flow chart of Word-Drawing method provided in an embodiment of the present invention, as shown in figure 1, this method can wrap Include:
Step 101, using word to be drawn each pixel the color value being pre-configured with, by word to be drawn It is plotted on interim base map.
Wherein, each word is made up of multiple pixels, and color value includes transparency component and multiple color components, temporarily The transparency component of all pixels point and color component are 0 in base map, and word to be drawn is to wait to draw to target base map Word.
The respective pixel of the color component of the first pixel in step 102, more interim base map and word to be drawn The color component being pre-configured with of point whether there is difference.
Wherein, the first pixel is any pixel point being plotted on interim base map.
If step 103, the color component of the first pixel on interim base map and the corresponding pixel points of word to be drawn The color component being pre-configured with have differences, determine the target color values of the second pixel.
Wherein, the transparency of color component of the target color values based on the first pixel and target base map obtains, the second picture Vegetarian refreshments is the pixel corresponding with the first pixel of word to be drawn.
Step 104, draw the second pixel using target color values on target base map.
In summary, Word-Drawing method provided in an embodiment of the present invention, the first pixel on more interim base map is passed through The color component of point and the color component being pre-configured with of the corresponding pixel points of word to be drawn whether there is difference, at both When having differences, the transparency of color component based on the first pixel and target base map, it is determined that word to be drawn with the The target color values of pixel corresponding to one pixel, the second pixel, phase are drawn using target color values on target base map For correlation technique, it is determined that when the target color values of pixel of word are drawn, the face of the first pixel has been considered The influence of colouring component and target base map so that the color for the word drawn out and expected color are closer, improve and draw out Word color the degree of accuracy.
Fig. 2 is the flow chart of another Word-Drawing method provided in an embodiment of the present invention, as shown in Fig. 2 this method can With including:
Step 201, using word to be drawn each pixel the color value being pre-configured with, by word to be drawn It is plotted on interim base map.
Wherein, the color value of pixel can include transparency component and multiple color components, and the plurality of color component can With including:Red color component, green color component and blue color component, there can also be the group of other components in practical application Conjunction mode, such as red component and yellow color component, or red color component, green color component, blue color component and white Colouring component, the embodiment of the present invention are not construed as limiting to this, and the transparency component of all pixels point and color component can in interim base map To be 0, so can largely reduce influences on the color value for being plotted in pixel on interim base map.
Illustratively, it is assumed that the color value being pre-configured with of certain pixel of word to be drawn is (255,0,0), then can adopt The pixel is plotted on interim base map with color value (255,0,0).
Step 202, acquisition are plotted in the color value of the first pixel on interim base map.
When drawing the first pixel on interim base map, first pixel is typically plotted in the neighbour for the pixel drawn In domain, the color value of the pixel drawn may produce certain influence, the influence to the color value of the first pixel Be usually expressed as making the color of the first pixel drawn out brighter so that the color value for the first pixel drawn out relative to The color value being pre-configured with is less than normal, i.e., the color component of the first pixel may exist poor with the color component being pre-configured with It is different, therefore, interim base map is plotted in, it is necessary to first obtain before the pixel of word to be drawn is plotted on target base map On the first pixel color value, then in the color value of the first pixel on more interim base map multiple color components with The color component being pre-configured with of the corresponding pixel points of word to be drawn whether there is difference, be determined such as further according to comparative result Where with the first pixel corresponding pixel of to be drawn word is drawn on target base map.
The respective pixel of the color component of the first pixel in step 203, more interim base map and word to be drawn The color component being pre-configured with of point whether there is difference.
When any color component of the first pixel is corresponding with being pre-configured with for the corresponding pixel points of word to be drawn When color component is unequal, you can think the advance of the color component of the first pixel and the corresponding pixel points of word to be drawn The color component of configuration has differences, and now, performs step 204;When the first pixel all colours component with it is to be drawn During the equal correspondent equal of the color components being pre-configured with of the corresponding pixel points of word, you can think that difference is not present in both, now, Perform step 206.
Illustratively, it is assumed that the color value of the first pixel is (128,128,2), the corresponding pixel points of word to be drawn The color component being pre-configured with is (255,0,0), when the red color component of color value is compared, the first pixel it is red Color color component is 128, and the red color component being pre-configured with of the corresponding pixel points of word to be drawn is 255, it is known that the The color component of one pixel and the color component being pre-configured with of the corresponding pixel points of word to be drawn have differences, then hold Row step 204.
If step 204, the color component of the first pixel on interim base map and the corresponding pixel points of word to be drawn The color component being pre-configured with have differences, determine the target color values of the second pixel.
Because the transparency that target color values are color component and target base map based on the first pixel obtains, because This, obtained target color values have considered the influence of the color component and target base map of the first pixel, itself and target bottom The contrast of figure is less than the color value of the first pixel and the contrast of target base map.Alternatively, target color values can include: Target clear degree component.Specifically, as shown in figure 3, determining the process of the target color values of the second pixel, can include:
Step 2041, the transparency component for obtaining target base map.
Because Word-Drawing method provided in an embodiment of the present invention is by Word-Drawing to the target bottom for having drawn image On figure, and the transparency component of the pixel in the image of the target base map for having drawn image and color component are Know, therefore, the mode such as transparency component that can be by detecting pixel obtains the transparency component of target base map.Illustratively, Assuming that the transparency component of the target base map obtained is 191.
Step 2042, the transparency component for obtaining the first pixel.
Alternatively, the transparency component of the first pixel can determine according to the color component of the first pixel, specifically, The average value of the plurality of color component can be determined according to multiple color components of the first pixel, it is then, the average value is true It is set to the transparency component of the first pixel.
Illustratively, it is assumed that the color value of the first pixel is (128,128,2), can obtain the average value of 3 color components For (128+128+2)/3=86, then average value 86 can be defined as to the transparency component of the first pixel, that is, the first picture obtained The transparency component of vegetarian refreshments is 86.
Step 2043, target clear determined according to the transparency component of target base map and the transparency component of the first pixel Spend component.
Specifically, the transparency component of transparency component that can be based on target base map and the first pixel, according to target Transparency component calculation formula determines target clear degree component, and the target clear degree component calculation formula is:TargetA=(1- (1-textA/255)*(1-backA/255))*255。
Wherein, TargetA is target clear degree component, and textA is the transparency component of the first pixel, and back A are mesh The transparency component of base number of a tender figure.
Illustratively, it is assumed that the transparency component backA of target base map is 191, the transparency component textA of the first pixel For 86, then target clear degree component TargetA=(1- (1-86/255) * (1-191/255)) * 255=213.
Step 2044, judge whether target clear degree component is more than the first color component.
Wherein, the first color component is any color component in multiple color components of the first pixel, be that is to say, this One color component can be any one in red color component, green color component or blue color component.
It is alternatively possible to determine the target face of the second pixel jointly according to target clear degree component and the first color component Colour, the target color values of the determination collectively constitute the mesh of the second pixel with the target clear degree component determined in step 2043 Mark color value.Specifically, it can be determined that whether target clear degree component is more than the first color component, when target clear degree component is big When the first color component, step 2045 is performed, when target clear degree component is not more than the first color component, performs step 2046。
Illustratively, it is assumed that the first color component is 128, and target clear degree component is 213, and target clear degree component is more than the One color component, then perform step 2045.
Step 2045, when target clear degree component is more than the first color component, target clear degree component is defined as One color of object component.
Wherein, first object color component is color of object corresponding with the first color component in multiple color of object components Component.
When target clear degree component is more than the first color component, illustrate target clear degree component closer to being pre-configured with Color component, therefore, the target clear degree component can be defined as first object color component, to reduce the word drawn out The difference of color and expected color.
Illustratively, it is assumed that the first color component is 128, and target clear degree component is 213, and target clear degree component is more than the Target clear degree component, then can be defined as first object color component by one color component, i.e. first object color component is 213。
From the foregoing, it will be observed that the color component being pre-configured with of certain pixel of word to be drawn is 255, interim bottom is plotted in Corresponding first color component of the first pixel on figure is 128, and corresponding first object color component is 213, relative to The first color component being plotted on interim base map, the closer color component being pre-configured with of the first object color component, when When pixel is plotted on target base map using the color component, the color for the word drawn out can be reduced with being pre-configured with Color difference.
Step 2046, when target clear degree component is not more than the first color component, the first color component is defined as One color of object component.
When target clear degree component is not more than the first color component, illustrate the first color component closer to being pre-configured with Color component, therefore, first color component can be defined as first object color component, to reduce the face for the word drawn out Color and the difference of expected color.
Illustratively, it is assumed that the first color component is 228, and target clear degree component is 213, and target clear degree component is less than the One color component, then the first color component can be defined as to first object color component, i.e. first object color component is 228.
In practical application, it is determined that the process of the target color values of the second pixel, can only include step 2041 to step Rapid 2043, it that is to say, target only can be determined according to the transparency component of target base map and the transparency component of the first pixel Transparency component, multiple color components of the target clear degree component of the determination and the first pixel are then defined as the second picture The target color values of vegetarian refreshments, to reduce the difference of the color for the word drawn out and expected color to a certain extent.
In practical application, step 2044 can be performed both by each color component of the first pixel to 2046, it is of the invention Embodiment simply illustrates by taking the first color component as an example, the color of object component of other color components in the first pixel Determination process may be referred to the determination process of first object color component, the embodiment of the present invention is not repeated this.
Step 205, draw the second pixel using target color values on target base map.
The target face of the second pixel is determined in the transparency of the color component according to the first pixel and target base map After colour, the second pixel can be drawn according to the target color values of the determination.
Illustratively, it is assumed that on the target base map (its color value is (0,0,0)) of white, each picture of word to be drawn The color being pre-configured with of vegetarian refreshments is black (its color value is (255,255,255)), using the Word-Drawing of correlation technique The schematic diagram for the word that method is drawn out according to the color value being pre-configured with target base map refer to Fig. 4, using the present invention The schematic diagram for the word that the Word-Drawing method that embodiment provides is drawn out according to the color value being pre-configured with target base map Fig. 5 is refer to, can be obtained according to Fig. 4 and Fig. 5 contrast, is occurred on the word drawn out using the Word-Drawing method of correlation technique The shade of one layer of black, and the color for the word drawn and the color value that is pre-configured with differ greatly, the embodiment of the present invention Almost there is no shade on the word that the Word-Drawing method of offer is drawn out, and the color for the word drawn and the face that is pre-configured with The difference of colour is smaller, therefore, the color for the word drawn out using Word-Drawing method provided in an embodiment of the present invention with it is pre- The color of phase is closer, improves the degree of accuracy of the color for the word drawn out.
If the corresponding pixel points of the color component of step 206, the first pixel and word to be drawn are pre-configured with Difference is not present in color component, and the second pixel is drawn using the color value of the first pixel on target base map.
The color component being pre-configured with of the corresponding pixel points of the color component of first pixel and word to be drawn is not Have differences, that is to say, the color component of the first pixel and the face being pre-configured with of the corresponding pixel points of word to be drawn Colouring component correspondent equal, when drawing word according to the color component, influence of the target base map to the word of drafting can reduce To minimum, it is therefore possible to use the color value of the first pixel directly draws the second pixel on target base map.
In practical application, each pixel that can treat the word of drafting is performed both by step 201 to 206, and the present invention is real Apply example simply to illustrate by taking the first pixel as an example, the drawing process of other pixels of word to be drawn may be referred to the The drawing process of one pixel, the embodiment of the present invention are not repeated this.
In summary, Word-Drawing method provided in an embodiment of the present invention, the first pixel on more interim base map is passed through The color component of point and the color component being pre-configured with of the corresponding pixel points of word to be drawn whether there is difference, at both When having differences, the transparency of color component based on the first pixel and target base map, it is determined that word to be drawn with the The target color values of pixel corresponding to one pixel, the second pixel, phase are drawn using target color values on target base map For correlation technique, it is determined that when the target color values of pixel of word are drawn, the face of the first pixel has been considered The influence of colouring component and target base map so that the color for the word drawn out and expected color are closer, improve and draw out Word color the degree of accuracy.
It should be noted that the sequencing of Word-Drawing method and step provided in an embodiment of the present invention can be carried out suitably Adjustment, step according to circumstances can also accordingly be increased and decreased.Any one skilled in the art the invention discloses Technical scope in, the method that can readily occur in change should be all included within the scope of the present invention, therefore no longer superfluous State.
The embodiments of the invention provide a kind of Word-Drawing device, as shown in fig. 6, the device 600 can include:
First drafting module 601, will for the color value being pre-configured with of each pixel using word to be drawn On interim base map, each word is made up of Word-Drawing to be drawn multiple pixels, color value include transparency component and Multiple color components, the transparency component of all pixels point and color component are 0 in interim base map, and word to be drawn is treats Draw to the word on target base map.
Comparison module 602, for the color component for comparing the first pixel on interim base map and word to be drawn The color component being pre-configured with of corresponding pixel points whether there is difference, and the first pixel is any being plotted on interim base map Pixel.
Determining module 603, if the color component of the first pixel and pair of word to be drawn on interim base map Answer the color component being pre-configured with of pixel to have differences, determine the target color values of the second pixel, target color values base Obtained in the transparency of the color component and target base map of the first pixel, the second pixel is word to be drawn with first Pixel corresponding to pixel.
Second drafting module 604, for using target color values to draw the second pixel on target base map.
In summary, Word-Drawing device provided in an embodiment of the present invention, by the more interim base map of comparison module It is poor that the color component of first pixel and the color component being pre-configured with of the corresponding pixel points of word to be drawn whether there is It is different, when both have differences, the transparency of color component of the determining module based on the first pixel and target base map, it is determined that treating The target color values of the pixel corresponding with the first pixel of the word of drafting, the second drafting module use on target base map Target color values draw the second pixel, relative to correlation technique, it is determined that the target color values of the pixel of word to be drawn When, considered the influence of the color component and target base map of the first pixel so that the color for the word drawn out with it is pre- The color of phase is closer, improves the degree of accuracy of the color for the word drawn out.
Alternatively, the contrast of target color values and target base map is less than the color value and target base map of the first pixel Contrast.
Alternatively, target color values include:Target clear degree component, as shown in fig. 7, determining module 603, can include:
First acquisition submodule 6031, for obtaining the transparency component of target base map.
Second acquisition submodule 6032, for obtaining the transparency component of the first pixel, the transparency of the first pixel Component determines according to the color component of the first pixel.
First determination sub-module 6033, for the transparency component according to target base map and the transparency of the first pixel point Amount determines target clear degree component.
Alternatively, target color values include:Multiple color of object components, as shown in fig. 7, determining module 603, can also be wrapped Include:
Judging submodule 6034, for judging whether target clear degree component is more than the first color component, the first color point Measure any color component in multiple color components for the first pixel.
Second determination sub-module 6035, for when target clear degree component is more than the first color component, by target clear Degree component is defined as first object color component, and first object color component is to divide in multiple color of object components with the first color Color of object component corresponding to amount.
Alternatively, as shown in fig. 7, determining module 603, can also include:
3rd determination sub-module 6036, for when target clear degree component is not more than the first color component, by the first face Colouring component is defined as first object color component.
Alternatively, as shown in figure 8, device 600 can also include:
3rd drafting module 605, if the corresponding pixel points of the color component and word to be drawn for the first pixel The color component being pre-configured with difference is not present, on target base map using the first pixel color value draw the second pixel Point.
Alternatively, the second acquisition submodule 6032, specifically can be used for:
Determine the average value of multiple color components of the first pixel.
Average value is defined as to the transparency component of the first pixel.
Alternatively, the first determination sub-module 6033, specifically can be used for:
The transparency component of transparency component and the first pixel based on target base map, according to target clear degree component meter Calculate formula and determine target clear degree component, target clear degree component calculation formula is:TargetA=(1- (1-textA/255) * (1-backA/255))*255。
Wherein, TargetA is target clear degree component, and textA is the transparency component of the first pixel, and back A are mesh The transparency component of base number of a tender figure.
Alternatively, multiple color components include:Red color component, green color component and blue color component.
In summary, Word-Drawing device provided in an embodiment of the present invention, by the more interim base map of comparison module It is poor that the color component of first pixel and the color component being pre-configured with of the corresponding pixel points of word to be drawn whether there is It is different, when both have differences, the transparency of color component of the determining module based on the first pixel and target base map, it is determined that treating The target color values of the pixel corresponding with the first pixel of the word of drafting, the second drafting module use on target base map Target color values draw the second pixel, relative to correlation technique, it is determined that the target color values of the pixel of word to be drawn When, considered the influence of the color component and target base map of the first pixel so that the color for the word drawn out with it is pre- The color of phase is closer, improves the degree of accuracy of the color for the word drawn out.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description, The specific work process of module and submodule, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
The embodiment of the present invention additionally provides a kind of storage medium, and instruction is stored with the storage medium, when the storage medium When running on computers so that computer performs the Word-Drawing method that above method embodiment provides.
The embodiment of the present invention additionally provides a kind of terminal, including memory, and processor and storage are on a memory and can be The computer program run on processor, described in computing device during computer program, realize what above method embodiment provided Word-Drawing method.
The embodiment of the present invention additionally provides a kind of computer program product for including instruction, when it runs on computers When so that computer performs the Word-Drawing method that above method embodiment provides.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc., it should be included in the scope of the protection.

Claims (20)

  1. A kind of 1. Word-Drawing method, it is characterised in that including:
    Using the color value being pre-configured with of each pixel of word to be drawn, the Word-Drawing to be drawn is being faced When base map on, each word is made up of multiple pixels, and the color value includes transparency component and multiple color components, described The transparency component of all pixels point and color component are 0 in interim base map, and the word to be drawn is to wait to draw to mesh Word on base number of a tender figure;
    Compare the color component and the corresponding pixel points of the word to be drawn of the first pixel on the interim base map The color component being pre-configured with whether there is difference, and first pixel is any pixel being plotted on the interim base map Point;
    If the color component of the first pixel on the interim base map is pre- with the corresponding pixel points of the word to be drawn The color component first configured has differences, and determines the target color values of the second pixel, and the target color values are based on described the The transparency of the color component of one pixel and the target base map obtains, and second pixel is the word to be drawn Pixel corresponding with first pixel;
    On the target base map the second pixel is drawn using the target color values.
  2. 2. according to the method for claim 1, it is characterised in that the contrast of the target color values and the target base map Less than the contrast of the color value and the target base map of first pixel.
  3. 3. according to the method for claim 2, it is characterised in that the target color values include:Target clear degree component, institute The target color values for determining the second pixel are stated, including:
    Obtain the transparency component of the target base map;
    The transparency component of first pixel is obtained, the transparency component of first pixel is according to first pixel The color component of point determines;
    The target clear is determined according to the transparency component of the transparency component of the target base map and first pixel Spend component.
  4. 4. according to the method for claim 3, it is characterised in that the target color values include:Multiple color of object components,
    The target color values for determining the second pixel, in addition to:
    Judge whether the target clear degree component is more than the first color component, first color component is first pixel Any color component in multiple color components of point;
    When the target clear degree component is more than first color component, the target clear degree component is defined as first Color of object component, the first object color component be the multiple color of object component in first color component pair The color of object component answered.
  5. 5. according to the method for claim 4, it is characterised in that methods described also includes:
    When the target clear degree component is not more than first color component, first color component is defined as described First object color component.
  6. 6. according to the method for claim 1, it is characterised in that methods described also includes:
    If the color component of first pixel and the color being pre-configured with of the corresponding pixel points of the word to be drawn Difference is not present in component, and second pixel is drawn using the color value of first pixel on the target base map.
  7. 7. the method according to claim 4 or 5, it is characterised in that the transparency for obtaining first pixel point Amount, including:
    Determine the average value of multiple color components of first pixel;
    The average value is defined as to the transparency component of first pixel.
  8. 8. according to the method for claim 3, it is characterised in that the transparency component and institute according to the target base map The transparency component for stating the first pixel determines the target clear degree component, including:
    The transparency component of transparency component and first pixel based on the target base map, according to target clear degree point Amount calculation formula determines the target clear degree component, and the target clear degree component calculation formula is:TargetA=(1- (1- textA/255)*(1-backA/255))*255;
    Wherein, the TargetA is the target clear degree component, and the textA is the transparency point of first pixel Amount, the backA are the transparency component of the target base map.
  9. 9. according to the method for claim 1, it is characterised in that the multiple color component includes:It is red color component, green Color color component and blue color component.
  10. A kind of 10. Word-Drawing device, it is characterised in that including:
    First drafting module, for the color value being pre-configured with of each pixel using word to be drawn, treated described On interim base map, each word is made up of the Word-Drawing of drafting multiple pixels, and the color value includes transparency component With multiple color components, the transparency component of all pixels point and color component are 0 in the interim base map, described to wait to draw Word be to wait to draw to the word on target base map;
    Comparison module, the color component and the word to be drawn of the first pixel on the interim base map The color component being pre-configured with of corresponding pixel points whether there is difference, and first pixel is to be plotted in the interim base map On any pixel point;
    Determining module, if the color component of the first pixel and pair of the word to be drawn on the interim base map Answer the color component being pre-configured with of pixel to have differences, determine the target color values of the second pixel, the color of object The transparency of color component of the value based on first pixel and the target base map obtains, and second pixel is described The pixel corresponding with first pixel of word to be drawn;
    Second drafting module, for using the target color values to draw the second pixel on the target base map.
  11. 11. device according to claim 10, it is characterised in that the contrast of the target color values and the target base map Degree is less than the color value of first pixel and the contrast of the target base map.
  12. 12. device according to claim 11, it is characterised in that the target color values include:Target clear degree component, The determining module, including:
    First acquisition submodule, for obtaining the transparency component of the target base map;
    Second acquisition submodule, for obtaining the transparency component of first pixel, the transparency of first pixel Component determines according to the color component of first pixel;
    First determination sub-module, for the transparency component according to the target base map and the transparency of first pixel point Amount determines the target clear degree component.
  13. 13. device according to claim 12, it is characterised in that the target color values include:Multiple color of objects point Amount,
    The determining module, in addition to:
    Judging submodule, for judging whether the target clear degree component is more than the first color component, first color point Measure any color component in multiple color components for first pixel;
    Second determination sub-module, for when the target clear degree component is more than first color component, by the target Transparency component is defined as first object color component, and the first object color component is in the multiple color of object component Color of object component corresponding with first color component.
  14. 14. device according to claim 13, it is characterised in that the determining module also includes:
    3rd determination sub-module, for when the target clear degree component is not more than first color component, by described One color component is defined as the first object color component.
  15. 15. device according to claim 10, it is characterised in that described device also includes:
    3rd drafting module, if the corresponding pixel points of the color component and the word to be drawn for first pixel The color component being pre-configured with difference is not present, on the target base map using first pixel color value draw Second pixel.
  16. 16. the device according to claim 13 or 14, it is characterised in that second acquisition submodule, be specifically used for:
    Determine the average value of multiple color components of first pixel;
    The average value is defined as to the transparency component of first pixel.
  17. 17. device according to claim 12, it is characterised in that first determination sub-module, be specifically used for:
    The transparency component of transparency component and first pixel based on the target base map, according to target clear degree point Amount calculation formula determines the target clear degree component, and the target clear degree component calculation formula is:TargetA=(1- (1- textA/255)*(1-backA/255))*255;
    Wherein, the TargetA is the target clear degree component, and the textA is the transparency point of first pixel Amount, the backA are the transparency component of the target base map.
  18. 18. device according to claim 10, it is characterised in that the multiple color component includes:Red color component, Green color component and blue color component.
  19. 19. a kind of storage medium, instruction is stored with the storage medium, it is characterised in that when the storage medium is calculating When being run on machine so that any described Word-Drawing method in the computer perform claim requirement 1 to 9.
  20. 20. a kind of terminal, including memory, processor and the calculating that can be run on the memory and on a processor is stored in Machine program, it is characterised in that described in the computing device during computer program, realize any described in claim 1 to 9 Word-Drawing method.
CN201710508903.4A 2017-06-28 2017-06-28 Character drawing method and device, terminal and storage medium Active CN107358637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710508903.4A CN107358637B (en) 2017-06-28 2017-06-28 Character drawing method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710508903.4A CN107358637B (en) 2017-06-28 2017-06-28 Character drawing method and device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN107358637A true CN107358637A (en) 2017-11-17
CN107358637B CN107358637B (en) 2020-09-25

Family

ID=60272610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710508903.4A Active CN107358637B (en) 2017-06-28 2017-06-28 Character drawing method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107358637B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753851A (en) * 2008-12-17 2010-06-23 华为终端有限公司 Method for replacing background, method for synthesizing virtual scene, as well as relevant system and equipment
CN101908216A (en) * 2010-07-20 2010-12-08 中兴通讯股份有限公司 Method and device for realizing vector fonts
CN103136169A (en) * 2011-11-29 2013-06-05 中兴通讯股份有限公司 Method and device of displaying characters
CN104919399A (en) * 2013-01-23 2015-09-16 朴宰贤 Device and method for changing color of text displayed on display device
CN105957125A (en) * 2016-05-20 2016-09-21 广东欧珀移动通信有限公司 Icon character processing method and mobile terminal
CN106126140A (en) * 2016-06-16 2016-11-16 北京金山安全软件有限公司 Method and device for rendering characters and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753851A (en) * 2008-12-17 2010-06-23 华为终端有限公司 Method for replacing background, method for synthesizing virtual scene, as well as relevant system and equipment
CN101908216A (en) * 2010-07-20 2010-12-08 中兴通讯股份有限公司 Method and device for realizing vector fonts
CN103136169A (en) * 2011-11-29 2013-06-05 中兴通讯股份有限公司 Method and device of displaying characters
WO2013078788A1 (en) * 2011-11-29 2013-06-06 中兴通讯股份有限公司 Text display method and apparatus
CN104919399A (en) * 2013-01-23 2015-09-16 朴宰贤 Device and method for changing color of text displayed on display device
CN105957125A (en) * 2016-05-20 2016-09-21 广东欧珀移动通信有限公司 Icon character processing method and mobile terminal
CN106126140A (en) * 2016-06-16 2016-11-16 北京金山安全软件有限公司 Method and device for rendering characters and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林生佑: "基于感知颜色空间的透明度估计方法", 《计算机工程》 *

Also Published As

Publication number Publication date
CN107358637B (en) 2020-09-25

Similar Documents

Publication Publication Date Title
US10388004B2 (en) Image processing method and apparatus
KR101138852B1 (en) Smart clipper for mobile displays
CN103903587B (en) A kind of method and device for handling image data
WO2013081415A1 (en) Method and system for generating animated art effects on static images
US20210004940A1 (en) Method and device for inpainting image
CN110996174B (en) Video image quality enhancement method and related equipment thereof
WO2020000546A1 (en) Method and apparatus for enhancing image color
CN106033619B (en) Picture verification code generation method, device and system
US10770027B2 (en) Image color cast compensation method and device, and display device
CN110618852B (en) View processing method, view processing device and terminal equipment
CN113923474B (en) Video frame processing method, device, electronic equipment and storage medium
US20230237946A1 (en) Display Effect Enhancement Method, Apparatus, and Device
US20230325963A1 (en) Image processing method and apparatus for mobile terminal, and storage medium and terminal
US20120328188A1 (en) Method and apparatus for detecting and compensating for backlight frame
US10210826B2 (en) Sub-pixel rendering method for delta RGBW panel and delta RGBW panel with sub-pixel rendering function
WO2020224459A1 (en) Image processing method and device, terminal and storage medium
CN107358637A (en) Word-Drawing method and device, terminal and storage medium
WO2022160914A1 (en) Effect processing method and apparatus, and device and storage medium
CN111653232B (en) LED screen color gamut calibration method and device
CN112053277B (en) Method, device, equipment and storage medium for changing image skin
US11765305B2 (en) Method for processing image storage medium and apparatus for the same
CN113225543B (en) Method, device and terminal for projection display and non-transitory storage medium
CN112580638B (en) Text detection method and device, storage medium and electronic equipment
WO2022160915A1 (en) Text illumination effect processing method, apparatus, device, and storage medium
CN109509161B (en) Image enhancement device and image enhancement method

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
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220406

Address after: 4119, 41st floor, building 1, No.500, middle section of Tianfu Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610000

Patentee after: Chengdu kugou business incubator management Co.,Ltd.

Address before: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right