CN105549928B - The color matching method and device of display content - Google Patents

The color matching method and device of display content Download PDF

Info

Publication number
CN105549928B
CN105549928B CN201510883422.2A CN201510883422A CN105549928B CN 105549928 B CN105549928 B CN 105549928B CN 201510883422 A CN201510883422 A CN 201510883422A CN 105549928 B CN105549928 B CN 105549928B
Authority
CN
China
Prior art keywords
color
current
display content
brightness
content
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.)
Expired - Fee Related
Application number
CN201510883422.2A
Other languages
Chinese (zh)
Other versions
CN105549928A (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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Alibaba Literature Information 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 Alibaba Literature Information Technology Co Ltd filed Critical Guangzhou Alibaba Literature Information Technology Co Ltd
Priority to CN201510883422.2A priority Critical patent/CN105549928B/en
Publication of CN105549928A publication Critical patent/CN105549928A/en
Application granted granted Critical
Publication of CN105549928B publication Critical patent/CN105549928B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros

Abstract

The invention discloses a kind of color matching method of display content and device.Wherein, this method includes:The current color of display content is read according to reading model conversion instruction;According to pre-defined rule by current color processing generation color of object, wherein, the colourity of color of object and the colourity of current color keep constant;Control display content is shown according to color of object.The present invention solves ocr software after patten transformation is carried out, and the scheme of colour of the new matic mould makes display content and master design difference excessive, causes the technical problem of user's reading experience difference.

Description

The color matching method and device of display content
Technical field
The present invention relates to computer realm, in particular to the color matching method and device of a kind of display content.
Background technology
With the development of mobile terminal and Internet technology, people increasingly get used on mobile phone making using chip time Various contents are read with ocr software.User can select to switch ocr software when using ocr software in different light In default a variety of reading matic moulds, such as Night, dark-background pattern etc., in the case of dark, user Often select reading model switching to Night, the scheme of colour generally use black gray expandable of Night or dark background The colour brightness of the content prospect such as tone, word is higher than background colour, but integral color brightness ratio is relatively low, so contributes to protect user's Eyesight.
Because ocr software interface element is substantially specifiable in the development phase, it is in the former display content of ocr software In the case of the content of pure words, after user's input is converted to the instruction of the new matic mould, existing ocr software is only The scheme of colour of the new matic mould of storage need to be called.For example, the scheme of colour of Night is:Inverse processing or by word Color it is unified replace, or color matching of the content under the new matic mould is determined according to the type of content.
It should be noted that ocr software, which can be also commonly used, in user reads the picture and text such as webpage, e-magazine, electron album The content of mixing, the content of above-mentioned picture and text mixing often require that master shows reading experience that could be best to user, and such as Fruit still uses the scheme of colour after the above-mentioned switching matic mould for the content of above-mentioned picture and text mixing (for example, Night Scheme of colour) it can have the disadvantage that:
(1) inverse is handled, and the content of picture and text mixing is handled by the way of film inverse can cause segment word discoloration (red Color variant font green font), after inverse, identifiability can also be deteriorated picture, the display content after being handled by inverse (especially colourity can change) excessive with the style difference of former display content, influences Consumer's Experience.
(2) color is replaced, i.e., predefined one or more of colors is replaced with into color of object, such as replaced with black bright Grey, still, but only replacing part colours and other colors and ignoring can cause the word not in the range of color of object bright It can not secretly adjust, meanwhile, the color and master content deltas of the display content after replacement color are excessive.
(3) color matching of the display content under the new matic mould is determined according to the type of content, for example word unification is replaced For bright grey, link replaces with purple etc. without exception, although this kind of method solves color reunification, but has lost in original The scheme of colour design of meter is installed with, color after reunification can only be retained under Night, while picture does not process, at night Seem dazzling under pattern.
For above-mentioned ocr software after patten transformation is carried out, the scheme of colour of the new matic mould makes display content and master It is excessive to design difference, the problem of causing user's reading experience difference, not yet proposes effective solution at present.
The content of the invention
The embodiments of the invention provide a kind of color matching method of display content and device, is being entered with least solving ocr software After row mode conversion, the scheme of colour of the new matic mould makes display content and master design difference excessive, causes user to read body Test the technical problem of difference.
One side according to embodiments of the present invention, there is provided a kind of color matching method of display content, including:According to reading Mode switch instruction reads the current color of display content;Current color processing is generated into color of object according to pre-defined rule, its In, the colourity of color of object and the colourity of current color keep constant;Control display content is shown according to color of object.
Another aspect according to embodiments of the present invention, a kind of color matching device of display content is additionally provided, including:Read single Member, for reading the current color of display content according to reading model conversion instruction;Generation unit, for being incited somebody to action according to pre-defined rule Current color processing generation color of object, wherein, the colourity of color of object and the colourity of current color keep constant;Control is single Member, for controlling display content to be shown according to color of object.
In embodiments of the present invention, using the current color that display content is read according to reading model conversion instruction;According to Current color processing is generated color of object by pre-defined rule, wherein, the colourity of color of object and the colourity of current color are kept not Become;Control display content is shown according to color of object.The technique effect of lifting user's reading experience is realized, and then is solved Ocr software after carry out patten transformation, the scheme of colour of the new matic mould makes display content and master to design difference excessive, Cause the technical problem of user's reading experience difference.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, forms the part of the application, this hair Bright schematic description and description is used to explain the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is a kind of hardware configuration frame of the terminal of the color matching method of display content according to embodiments of the present invention Figure;
Fig. 2 is a kind of flow chart of the color matching method of display content according to embodiments of the present invention;And
Fig. 3 is a kind of schematic diagram of the color matching device of display content according to embodiments of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use Data can exchange in the appropriate case, so as to embodiments of the invention described herein can with except illustrating herein or Order beyond those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment Those steps or unit clearly listed, but may include not list clearly or for these processes, method, product Or the intrinsic other steps of equipment or unit.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of the color matching method of display content is additionally provided, it is necessary to illustrate, It can be performed the step of the flow of accompanying drawing illustrates in the computer system of such as one group computer executable instructions, and And although showing logical order in flow charts, in some cases, can be with different from order execution institute herein The step of showing or describing.
The embodiment of the method that the embodiment of the present application one is provided can be in mobile terminal, terminal or similar fortune Calculate and performed in device.Exemplified by running on computer terminals, Fig. 1 is a kind of color matching side of display content of the embodiment of the present invention The hardware block diagram of the terminal of method.As shown in figure 1, terminal 10 can include one or more (in figure only Showing one) (processor 102 can include but is not limited to Micro-processor MCV or PLD FPGA etc. to processor 102 Processing unit), the memory 104 for data storage and the transmitting device 106 for communication function.This area is common Technical staff is appreciated that the structure shown in Fig. 1 is only to illustrate, and it does not cause to limit to the structure of above-mentioned electronic installation.Example Such as, terminal 10 may also include than shown in Fig. 1 more either less components or with different from shown in Fig. 1 Configuration.
Memory 104 can be used for the software program and module of storage application software, such as the display in the embodiment of the present invention Programmed instruction/module corresponding to the color matching method of content, processor 102 are stored in the software journey in memory 104 by operation Sequence and module, so as to perform various function application and data processing, that is, realize the Hole Detection side of above-mentioned application program Method.Memory 104 may include high speed random access memory, may also include nonvolatile memory, as one or more magnetic is deposited Storage device, flash memory or other non-volatile solid state memories.In some instances, memory 104 can further comprise relatively In the remotely located memory of processor 102, these remote memories can pass through network connection to terminal 10.It is above-mentioned The example of network includes but is not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Transmitting device 106 is used to data are received or sent via a network.Above-mentioned network instantiation may include The wireless network that the communication providerses of terminal 10 provide.In an example, transmitting device 106 is fitted including a network Orchestration (Network Interface Controller, NIC), its can be connected by base station with other network equipments so as to Internet is communicated.In an example, transmitting device 106 can be radio frequency (Radio Frequency, RF) module, its For wirelessly being communicated with internet.
Under above-mentioned running environment, this application provides the color matching method of display content as shown in Figure 2.Fig. 2 is basis The flow chart of the color matching method of the display content of the embodiment of the present invention one, this method can include:
Step S24, the current color of display content is read according to reading model conversion instruction.
In above-mentioned steps S24, ocr software can be read after the reading model conversion instruction of user's input is received The current color value of the current display content of the display interface of ocr software is taken, it is necessary to which explanation, above-mentioned current color value can To calculate the HSL components of current color by existing RGB → HSL algorithms, you can generated with being calculated by current color value Three values of the colourity (Hue) of display content, saturation degree (Saturation) and brightness (Lightness).In above-mentioned display The patterns such as word content, image content, decorative thread can be included in appearance.In this programme, it can obtain respectively in display content The above-mentioned mode switch instructions of current color of all patterns may be used to display content in ocr software and read from current Patten transformation is target reading model, and the target reading model can be the matic mould to be prestored in ocr software, every kind of theme Pattern all correspond to different schemes of colour, and above-mentioned target reading model can be Night, and dark-background pattern, light color are carried on the back Scape pattern, it is preferable that above-mentioned target reading model can be Night.
By user exemplified by current reading model changes Night, user is reading web page contents using ocr software In the case of, if residing dark, user can then select the control of the moon shape on the interface of ocr software, the control Part is used to control display content to be transformed into Night from present mode, after user inputs reading model conversion instruction, reads Read the current color that software obtains display content automatically.
It should be noted that in this programme, ocr software can be sentenced automatically by the photosensitive device of mobile phone terminal equipment The light in abscission ring border, after values of light is less than certain threshold value, ocr software automatically generates above-mentioned reading model conversion instruction, i.e., Operated without user, ocr software automatic conversion reading model.
Step S26, according to pre-defined rule by current color processing generation color of object, wherein, the colourity of color of object with The colourity of the current color keeps constant.
Step S28, control display content are shown according to color of object.
In above-mentioned steps S26 into S28, after the current color value of the current display content of ocr software is got, Can be calculated according to pre-defined rule using above-mentioned current color value as parameter, then generate target color values, it is necessary to explanation It is that in this programme, ocr software is after Night is changed, and the brightness of display content can be dimmed, still, in display content Each pattern, the colourity of picture and master be to maintain it is constant.
Still by user exemplified by current reading model changes Night, ocr software can be obtained in current display The current color value color of the patterns such as word, picture, frame, modification line in appearance, then worked as according to predetermined rule with above-mentioned Preceding color value generates target color values new color, then controls display content to be shown according to target color values as parameter Show, the effect that the color matching pattern of display content is worth after conversion before switching is as follows:Display content after conversion in brightness It is dimmed, but the colourity of each pattern (word, picture, frame, modification line) and master design keep constant in display content.
It follows that after display content is changed into Night, in display content the brightness of each pattern become Secretly, the colourity and master of each pattern, picture but in display content are designed without distinguishing.All face i.e. in display content Color can change brightness, both adapted to requirement of the Night to brightness, and also improved use on the premise of colourity keeps constant The viewing experience at family.
In scheme disclosed in the above embodiments of the present application one, if the user desired that conversion reading model (such as change all night Between reading model), user first to ocr software input reading model conversion instruction, then, ocr software is according to reading model The current color of ocr software display content is read in conversion instruction, and then, current color is handled according to pre-defined rule, raw Into color of object, wherein, the colourity of color of object and the colourity of current color keep constant, finally, ocr software control display Content is shown according to color of object, to be converted into Night, is easily noted that, due to after reading model is changed, The brightness of the display content of ocr software is changed, but the colourity of the display content of ocr software and conversion reading model Display content before keeps constant, therefore, the scheme provided by the embodiment of the present invention, it is possible to achieve keeping colourity Under the premise of, the change of display content brightness is completed, the viewing experience for improving user is so not only realized, overcomes existing turn The defects of scheme of reading model makes the colourity of display content and too big master difference is changed, moreover, in the mistake of conversion reading model Cheng Zhong, all patterns (including picture) in display content by predetermined rule uniformly realize the replacement of color, and (colourity is not Become), prior art is also overcomed the color of the scheme of colour adjustment member display content of the new matic mould the defects of, because This, it is ensured that generate the security of web application.Thus, the scheme of above-described embodiment one that the application provides solves reading For software after patten transformation is carried out, the scheme of colour of the new matic mould makes display content and master design difference excessive, causes to use The technical problem of family reading experience difference.
In a kind of alternative embodiment that the application provides, above-mentioned display content can include word content, in display In the case of holding for word content, step S26, current color is handled according to pre-defined rule, generates the step of color of object Suddenly can include:
Step S261, component calculating is carried out to the current color of word content, generate the present intensity, current of word content Colourity and current saturation degree.
, can be according to existing RGB after the color value color of word content is read in above-mentioned steps S261 → HSL algorithms (i.e. above-mentioned component calculate) calculate current color value color the HSL components i.e. present intensity of word content, Current chroma and current saturation degree.
Step S262, object brightness is obtained according to present intensity according to predetermined mapping relations.
In above-mentioned steps S262, the present intensity newL of above-mentioned word content can be substituted into predetermined mapping relations and come Object brightness newL is obtained, above-mentioned predetermined mapping relations can be a mapping function, and each present intensity value, which substitutes into, reflects An object brightness can all be obtained, it is necessary to illustrate by penetrating function, in the case where being converted into Night from present mode, on The present intensity of above-mentioned word content can be less than by stating object brightness, in the case where being converted into day mode from present mode, on The present intensity of above-mentioned word content can be more than by stating object brightness.
Step S263, color of object is generated according to object brightness, current chroma and current saturation degree.
, can be according to word content after the object brightness of word content is calculated in above-mentioned steps S263 The current saturation degree of object brightness, the current chroma of word content and word content calculates mesh by HSL → RGB algorithms Color value new color are marked, then the replacement color using new color as word content.
In a kind of alternative embodiment that the application provides, in the case where display content is word content, step S26, The step of being handled according to pre-defined rule current color, generating color of object can include:
Step S264, component calculating is carried out to the current color of word content, generate the present intensity, current of word content Colourity and current saturation degree.
Step S265, object brightness is obtained according to present intensity according to predetermined mapping relations.
Above-mentioned steps S264 to step S265 scheme is identical with above-mentioned steps S261 to step S262 scheme.
Step S266, read the saturation degree of the color of the theme color matching pattern of storage.
, can be in ocr software be read after the object brightness of word content is got in above-mentioned steps S266 The saturation degree of the color of the theme color matching pattern of storage is, it is necessary to which explanation, above-mentioned theme color matching pattern is selected by user Conversion after target topic pattern, in this programme, can first obtain the face of the foreground in above-mentioned target topic pattern Colour, then the color value of the foreground in target topic pattern target topic mould is calculated by RGB → HSL algorithms The saturation degree of foreground in formula.
Step S267, in the case where current saturation degree is less than the saturation degree of the color of theme color matching pattern, according to target The saturation degree generation color of object of the color of brightness, current chroma and theme color matching pattern.
, can be to the current saturation degree in above-mentioned steps S264 and above-mentioned mesh in this programme in above-mentioned steps S267 The saturation degree of foreground in the mark matic mould is compared, if current saturation degree is less than the prospect of target topic color matching pattern The saturation degree of color, then this programme then uses the foreground of the target topic color matching pattern of the color of target topic color matching pattern Saturation degree, object brightness newL, the current chroma of word content generate above-mentioned target color values new color to calculate.
It should be noted that the foreground in view of target topic pattern may not be ater or grey, designer is It can be that foreground increases a small colour cast to adapt to different background, if lightpink theme text color is the dark-grey of slightly biased pink colour Color.Therefore above-mentioned amendment scheme is added in this programme, i.e. the saturation degree of raw content is less than the prospect color saturation of target topic When, it can be assumed that these are not notable close to black or pure white style characteristics, and the saturation degree of display content should be made close or waited In the saturation degree of the foreground of target topic pattern.
In a kind of alternative embodiment that the application provides, display content can include image content, be in display content In the case of image content, step S26, current color is handled according to pre-defined rule, generate color of object the step of can With including:
Step S268, component calculating is carried out to the current color of image content, generate the present intensity, current of image content Colourity and current saturation degree.
In above-mentioned steps S268, if display content is image content, then this programme can be read in image content Any one pixel map or polar plot as independent illustration, and hash the color for extracting the partial pixel point in picture, enter The above-mentioned component of row calculates.It should be noted that this programme can by hash extract picture in partial pixel point color come Calculate present intensities of the average value avgL of the brightness of picture as picture.
Step S269, object brightness is obtained according to present intensity according to predetermined mapping relations.
Step S2610, in the case where the object brightness of image content is less than present intensity, according to object brightness, currently Colourity and current saturation degree generation color of object.
In above-mentioned steps S269 into step S2610, the present intensity of above-mentioned image content can be substituted into above-mentioned mapping Function, to obtain the object brightness of picture, if in the case that the object brightness of picture is less than the present intensity avgL of picture, Illustrate pattern of the reading model after changing into Night or into dark-background, then then according to object brightness, current color Degree and current saturation degree generation color of object, the appropriate brightness for reducing picture in the case where keeping picture colourity constant, with Meet the requirement of night reading model.
Step S2611, in the case where the object brightness of image content is more than present intensity, color of object and current color Keep constant.
In above-mentioned steps S2611, if the object brightness of image content is more than present intensity avgL, illustrate, change Reading model afterwards is light pattern either day mode, in this programme, it is contemplated that Consumer's Experience, in the mould of light background Under formula, the brightness of picture should not adjust, and therefore, under new theme color matching pattern, the color of picture before conversion with keeping It is constant.
It should be noted that if the operating rate of mobile phone terminal is slower, the colour switching that picture is related in this programme can Directly to be changed according to target topic pattern, it is not necessary to carry out above-mentioned hash sample calculation.
In a kind of alternative embodiment that the application provides, above-mentioned mapping relations can be set as follows:
Step S1:The original brightness section of default display content.
In above-mentioned steps S1, this programme can preset an original brightness section, it is preferable that can preset display content For white gravoply, with black engraved characters, the brightness value srcFL of the foreground of display content can be preset as 0.0, the background colour brightness value of display content 1.0 can be preset as, then the value of above-mentioned original brightness section [srcFL, srcBL] can be preset as [0.0,1,0].
Step S2:Read the brightness section of the color matching pattern of storage.
In above-mentioned steps S2, the brightness section for the color matching pattern that ocr software is stored, above-mentioned color matching mould can be read Formula can be the brightness section of target topic pattern, in this programme, can read foreground, the background colour of target topic pattern Or tiling background picture, and calculate the brightness value of the foreground of above-mentioned target topic pattern and the background colour of target topic pattern Brightness value, the brightness section of the color matching pattern of ocr software storage is then [dstFL, dstBL], it is preferable that [dstFL, dstBL] Value can be [0.625,0].
It should be noted that if target topic pattern includes the background picture of tiling, in this programme, then hash extracts The color of the partial pixel point of picture simultaneously calculates background colour of multiple pixel color averages as background picture.
Step S3:The mapping between the brightness section of original brightness section and pattern of matching colors is obtained by Linear Mapping to close System.
In above-mentioned steps S3, Linear Mapping can be used, passes through original brightness section [srcFL, srcBL] and color matching mould The brightness section [dstFL, dstBL] of formula is worth to a mapping relations (mapping function), it is preferable that [0.0,1,0] with [0.625,0] mapping function f (x)=0.625* (1-x) can be obtained using Linear Mapping.It should be noted that pass through Above-mentioned mapping, the content (such as most of word) close to black (brightness close to 0) in original text, will be connect by brightness value after mapping Nearly 0.625, and close to the word or lines of white in original text, in the mapped will be close to black.In original text in peony background Yellow text dosage and subtracts dark respectively in the mapped, not only maintain original colourity, and original preceding background luminance difference is still To embody.
In a kind of alternative embodiment that the application provides, in step S28, control display content is carried out according to color of object Be shown in control display content shown according to color of object after, the present embodiment provide method can also include:
Step S29, establishes mapping table, for storing mapping relations between current color and color of object and/or original Mapping relations between the brightness section of brightness section and pattern of matching colors.
In above-mentioned steps S29, for same color, unique color value is mapped as under unifying theme, thus it is above-mentioned Mapping table can cache to transformation results, and reduction computes repeatedly.
Below exemplified by ocr software SQ, this programme is described under the application scenarios of reality:
SQ novels be a flag net magnanimity novel by book based on online reading device.Body is preferably read in order to obtain Test, SQ softwares provide more sets theme scheme of colour (containing 3 kinds of dark themes) and a set of night theme in the daytime.SQ software supports The local books of the forms such as ePub, chm are read, such books are described using Html and CSS, can support abundant typesetting pattern Description, and include the complicated pattern unit such as picture and text mixing, polar plot, mathematical formulae.SQ softwares it is also required to provide the masters such as PDF original The parsing of formula document is with rendering.In this scenario, it can be used for application content and the scheme of color matching mode adaptive in SQ softwares Typesetting, the engine Athena rendered can preferably support above-mentioned picture and text and the correct of complicated typesetting content to show, and covered with more Theme scheme of colour merges.The a variety of subject schemes (pattern containing night) stored in SQ novel softwares be provided previously by text color, Tile background picture.This programme can be using text color as target topic foreground color, and precalculate and store and be each Prospect colour brightness, colourity and saturation degree (HSL) component under the kind matic mould, during application this programme related algorithm also not It must compute repeatedly.The designer of software gives the background colour calculated with tiling background picture after hashing point sampling simultaneously, Can be as the background colour of target topic.
Based on the introduction of above-mentioned SQ novels, SQ novels can be as follows in the scheme of progress patten transformation:
(1) original brightness section is preset.
Specifically, because display content can be online books, can also be the local books that user uploads, belong to nonspecific Content, so this programme can be unified to preset when making using white gravoply, with black engraved characters as original reference brightness, therefore foreground brightness value SrcFL is 0.0, and background colour brightness value srcBL is 1.0, therefore content brightness section [srcFL, srcBL] is [0.0,1.0];Need It is noted that for the word of the word of not specified color, black in the contents such as ePub, chm, and plain text (TXT) class The content of type, such as online novel, without performing complicated calculating, strategy is quickly directly handled according to this motion, directly using master Inscribe architecture perspective color, background colour is drawn.
(2) brightness section of target topic pattern is obtained, according to original brightness section, the brightness section of target topic pattern Mapping function is calculated.
Specifically, by taking night pattern as an example, foreground is shallower grey, and background colour is black, therefore object brightness area Between [dstFL, dstBL] be [0.625,0], using Linear Mapping, can obtain the mapping function of brightness value for f (x)= 0.625*(1-x);Content (such as big portion close to black (brightness close to 0) in i.e. original text is can be seen that from above-mentioned mapping function Single cent word), will be close to 0.625 by brightness value after mapping, and will be connect in the mapped close to the word or lines of white in original text Nearly black.Yellow text in original text in peony background dosage and subtracts dark respectively in the mapped, not only maintains original color Degree, original preceding background luminance difference still emerge from.
(3) the current color value of reading content is obtained, and calculates the HSL components of current reading content.
Specifically, this programme can obtain the color value color of any one pattern in reading content, be calculated as current bright Degree, current chroma and current saturation degree (HSL) component.
(4) target color values of reading content are worth to according to the current color of reading content, it is affected with target color values For the replacement color of reading content.
Specifically, this programme can substitute into the present intensity value that the current color value by reading content is calculated Mapping function is stated, the object brightness newL after being mapped, and by object brightness newL combinations current chroma and current saturation degree Component, new color value new color is calculated as replacement color, then this programme realizes keeps constant premise in colourity Under, the brightness and target color matching pattern that make reading content are adapted.
It should be noted that it is at most for being related to the patterns such as word, decorative thread, background colour in content that this programme, which is applied, The conversion of middle color value.For ePub, CHM etc., color is defined generally described in CSS style sheet, and is used when drawing.Examine Considering color replacement does not influence typesetting logic, therefore replaces and only performed when drawing, and does not change in the CSS being resolved to It is worth, without typesetting again after replacing color theme.
To sum up, the ocr software content in this programme and the method for color matching mode adaptive, can fine solution webpage Colour match and adjustment problem Deng a variety of color matching patterns of picture and text mixing content-adaptive (particularly night pattern), can be preferably The collocation of the desired typesetting content of contents producer and background in colourity, comparison of light and shade etc. is kept, while adapts to difference and matches somebody with somebody Color scheme particularly night pattern provides the user more preferable reading experience for color, the adjustment demand of brightness.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but a lot In the case of the former be more preferably embodiment.Based on such understanding, technical scheme is substantially in other words to existing The part that technology contributes can be embodied in the form of software product, and the computer software product is stored in a storage In medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone, calculate Machine, server, or network equipment etc.) method that performs each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, a kind of display content for being used to implement the color matching method of above-mentioned display content is additionally provided Color matching device, as shown in figure 3, the device includes:
Reading unit 32, for reading the current color of display content according to reading model conversion instruction.
In above-mentioned reading unit 32, ocr software, can after the reading model conversion instruction of user's input is received To read the current color value of the current display content of the display interface of ocr software, it is necessary to explanation, above-mentioned current color Value can calculate the HSL components of current color by existing RGB → HSL algorithms, you can be calculated by current color value Generate three values of the colourity (Hue) of display content, saturation degree (Saturation) and brightness (Lightness).It is above-mentioned aobvious The patterns such as word content, image content, decorative thread can be included by showing in content.In this programme, it can obtain respectively in display The current color of all patterns in appearance.In this programme, the current face of all patterns in display content can be obtained respectively The display content that the above-mentioned mode switch instruction of color may be used in ocr software is converted to target from current reading model and read Pattern, the target reading model can be the matic mould to be prestored in ocr software, and every kind of matic mould all correspond to different Scheme of colour, above-mentioned target reading model can be Night, dark-background pattern, light background pattern, it is preferable that above-mentioned Target reading model can be Night.
By user exemplified by current reading model changes Night, user is reading web page contents using ocr software In the case of, if residing dark, user can then select the control of the moon shape on the interface of ocr software, the control Part is used to control display content to be transformed into Night from present mode.Reading model conversion instruction supporting is inputted in user, is read Read the current color that software obtains display content automatically.
It should be noted that in this programme, ocr software can be sentenced automatically by the photosensitive device of mobile phone terminal equipment The light in abscission ring border, after values of light is less than certain threshold value, ocr software automatically generates above-mentioned reading model conversion instruction, i.e., Operated without user, ocr software automatic conversion reading model.
Generation unit 34, for current color processing to be generated into color of object according to pre-defined rule, wherein, the mesh Mark the colourity of color and keep constant with the colourity of the current color.
Control unit 36, for controlling display content to be shown according to color of object.
In above-mentioned generation unit 34 and control unit 36, the current face of the current display content of ocr software is being got After colour, it can be calculated according to pre-defined rule using above-mentioned current color value as parameter, then generate target color values, needed It is noted that in this programme, for ocr software after Night is changed, the brightness of display content can be dimmed, still, shows Show each pattern in content, picture and master colourity be to maintain it is constant.
Still by user exemplified by current reading model changes Night, ocr software can be obtained in current display The current color value color of the patterns such as word, picture, frame, modification line in appearance, then worked as according to predetermined rule with above-mentioned Preceding color value generates target color values new color, then controls display content to be shown according to target color values as parameter Show, the effect that the color matching pattern of display content is worth after conversion before switching is as follows:Display content after conversion in brightness It is dimmed, but the colourity of each pattern (word, picture, frame, modification line) keeps constant in display content.
It follows that after display content is changed into Night, in display content the brightness of each pattern become Secretly, the colourity and master of each pattern, picture but in display content are designed without distinguishing.All face i.e. in display content Color can change brightness, both adapted to requirement of the Night to brightness, and also improved use on the premise of colourity keeps constant The viewing experience at family.
In scheme disclosed in the above embodiments of the present application two, if the user desired that conversion reading model (such as change all night Between reading model), user first to ocr software input reading model conversion instruction, then, ocr software is according to reading model The current color of ocr software display content is read in conversion instruction, and then, current color is handled according to pre-defined rule, raw Into color of object, wherein, the colourity of color of object and the colourity of current color keep constant, finally, ocr software control display Content is shown according to color of object, to be converted into Night, is easily noted that, due to after reading model is changed, The brightness of the display content of ocr software is changed, but the colourity of the display content of ocr software and conversion reading model Display content before keeps constant, therefore, the scheme provided by the embodiment of the present invention, it is possible to achieve keeping colourity Under the premise of, the change of display content brightness is completed, the viewing experience for improving user is so not only realized, overcomes existing turn The defects of scheme of reading model makes the colourity of display content and too big master difference is changed, moreover, in the mistake of conversion reading model Cheng Zhong, all patterns (including picture) in display content by predetermined rule uniformly realize the replacement of color, and (colourity is not Become), prior art is also overcomed the color of the scheme of colour adjustment member display content of the new matic mould the defects of, because This, it is ensured that generate the security of web application.Thus, the scheme of above-described embodiment two that the application provides solves reading For software after patten transformation is carried out, the scheme of colour of the new matic mould makes display content and master design difference excessive, causes to use The technical problem of family reading experience difference.
In a kind of alternative embodiment that the application provides, display content includes word content, wherein, generation unit 34 can With including:First computing module, for carrying out component calculating to the current color of word content, generate the current bright of word content Degree, current chroma and current saturation degree;First mapping block, for being obtained according to predetermined mapping relations according to present intensity Object brightness;First generation module, for generating color of object according to object brightness, current chroma and current saturation degree.
In a kind of alternative embodiment that the application provides, display content includes word content, wherein, generation unit 34 can With including:Second computing module, for carrying out component calculating to the current color of word content, generate the current bright of word content Degree, current chroma and current saturation degree;Second mapping block, for being obtained according to predetermined mapping relations according to present intensity Object brightness;First read module, the saturation degree of the color of the theme color matching pattern for reading storage;Second generation module, In the case of saturation degree for the color for being less than theme color matching pattern in current saturation degree, according to object brightness, current chroma And the saturation degree generation color of object of the color of theme color matching pattern.
In a kind of alternative embodiment that the application provides, display content includes image content, wherein, generation unit 34 can With including:3rd computing module, for carrying out component calculating to the current color of image content, generate the current bright of image content Degree, current chroma and current saturation degree;3rd mapping block, for being obtained according to predetermined mapping relations according to present intensity Object brightness;3rd generation module, it is bright according to target in the case of being less than present intensity in the object brightness of image content Degree, current chroma and current saturation degree generation color of object;Control module, work as being more than in the object brightness of image content In the case of preceding brightness, control targe color keeps constant with current color.
In a kind of alternative embodiment that the application provides, said apparatus also includes mapping generation unit, wherein, mapping life Also include into unit:Presetting module, for presetting the original brightness section of display content;Second read module, deposited for reading The brightness section of the color matching pattern of storage;Map generation module, for obtaining original brightness section and color matching mould by Linear Mapping Mapping relations between the brightness section of formula.
In a kind of alternative embodiment that the application provides, said apparatus can also include:Memory cell, work as storing Mapping relations and/or original brightness section between preceding color and color of object and the mapping between the brightness section for pattern of matching colors Relation.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in some embodiment The part of detailed description, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, others can be passed through Mode is realized.Wherein, device embodiment described above is only schematical, such as the division of the unit, is only A kind of division of logic function, can there is an other dividing mode when actually realizing, for example, multiple units or component can combine or Person is desirably integrated into another system, or some features can be ignored, or does not perform.Another, shown or discussed is mutual Between coupling or direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module Connect, can be electrical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer Equipment (can be personal computer, server or network equipment etc.) perform each embodiment methods described of the present invention whole or Part steps.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can be with store program codes Medium.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (12)

  1. A kind of 1. color matching method of display content, it is characterised in that including:
    The current color of ocr software display content is read according to reading model conversion instruction;
    The display content includes word content, carries out component calculating to the current color of the word content, generates the text Present intensity, current chroma and the current saturation degree of word content;
    Object brightness is obtained according to the present intensity according to predetermined mapping relations;
    Read the saturation degree of the color of the theme color matching pattern of storage;
    It is bright according to the target in the case of the saturation degree for being less than the color of theme color matching pattern in the current saturation degree The saturation degree of the color of degree, the current chroma and theme color matching pattern generates the color of object, wherein, the mesh Mark the colourity of color and keep constant with the colourity of the current color;
    The display content is controlled to be shown according to the color of object.
  2. 2. according to the method for claim 1, it is characterised in that
    Preset the original brightness section of the display content;
    Read the brightness section of the theme color matching pattern of storage;
    The mapping obtained by Linear Mapping between the brightness section of the original brightness section and the color matching pattern is closed System.
  3. 3. according to the method for claim 2, it is characterised in that enter controlling the display content according to the color of object After row display, methods described also includes:
    Mapping table is established, for storing mapping relations between the current color and the color of object and/or described original The mapping relations between the brightness section of brightness section and the color matching pattern.
  4. A kind of 4. color matching method of display content, it is characterised in that including:
    The current color of ocr software display content is read according to reading model conversion instruction;
    The display content includes image content, carries out component calculating to the current color of the image content, generates the figure Present intensity, current chroma and the current saturation degree of piece content;
    Object brightness is obtained according to the present intensity according to predetermined mapping relations;
    The image content object brightness be less than the present intensity in the case of, according to the object brightness, it is described work as Preceding colourity and the current saturation degree generate the color of object;
    In the case where the object brightness of the image content is more than the present intensity, the color of object and the current face Color keeps constant;
    The display content is controlled to be shown according to the color of object.
  5. 5. the color matching method of display content according to claim 4, it is characterised in that
    Preset the original brightness section of the display content;
    Read the brightness section of the theme color matching pattern of storage;
    The mapping obtained by Linear Mapping between the brightness section of the original brightness section and the color matching pattern is closed System.
  6. 6. according to the method for claim 5, it is characterised in that enter controlling the display content according to the color of object After row display, methods described also includes:
    Mapping table is established, for storing mapping relations between the current color and the color of object and/or described original The mapping relations between the brightness section of brightness section and the color matching pattern.
  7. A kind of 7. color matching device of display content, it is characterised in that including:
    Reading unit, for reading the current color of display content according to reading model conversion instruction;
    Generation unit, for including current color processing generation color of object, the display content according to pre-defined rule Word content, wherein, the generation unit includes:
    Second computing module, for carrying out component calculating to the current color of the word content, generate the word content Present intensity, current chroma and current saturation degree;
    Second mapping block, for obtaining object brightness according to the present intensity according to predetermined mapping relations;
    First read module, the saturation degree of the color of the theme color matching pattern for reading storage;
    Second generation module, the situation of the saturation degree of the color for being less than theme color matching pattern in the current saturation degree Under, the saturation degree generation mesh for the color of pattern of being matched colors according to the object brightness, the current chroma and the theme Color is marked, wherein, the colourity of the colourity of the color of object and the current color keeps constant;
    Control unit, for controlling the display content to be shown according to the color of object.
  8. 8. the device according to right wants 7, it is characterised in that described device also includes mapping generation unit, wherein, it is described to reflect Penetrating generation unit also includes:
    Presetting module, for presetting the original brightness section of the display content;
    Second read module, the brightness section of the color matching pattern for reading storage;
    Map generation module, for obtaining the brightness section in the original brightness section and the color matching pattern by Linear Mapping Between the mapping relations.
  9. 9. device according to claim 8, it is characterised in that described device also includes:
    Memory cell, for storing mapping relations between the current color and the color of object and/or described original bright The mapping relations spent between section and the brightness section of the color matching pattern.
  10. A kind of 10. color matching device of display content, it is characterised in that including:
    Reading unit, for reading the current color of display content according to reading model conversion instruction;
    Generation unit, for including current color processing generation color of object, the display content according to pre-defined rule Image content, wherein, the generation unit includes:
    3rd computing module, for carrying out component calculating to the current color of the image content, generate the image content Present intensity, current chroma and current saturation degree;
    3rd mapping block, for obtaining object brightness according to the present intensity according to predetermined mapping relations;
    3rd generation module, in the case of being less than the present intensity in the object brightness of the image content, according to institute State object brightness, the current chroma and the current saturation degree and generate the color of object;
    Control module, in the case of being more than the present intensity in the object brightness of the image content, control the mesh Mark color and keep constant with the current color;
    Control unit, for controlling the display content to be shown according to the color of object.
  11. 11. the device according to right wants 10, it is characterised in that described device also includes mapping generation unit, wherein, it is described Mapping generation unit also includes:
    Presetting module, for presetting the original brightness section of the display content;
    Second read module, the brightness section of the color matching pattern for reading storage;
    Map generation module, for obtaining the brightness section in the original brightness section and the color matching pattern by Linear Mapping Between the mapping relations.
  12. 12. device according to claim 11, it is characterised in that described device also includes:
    Memory cell, for storing mapping relations between the current color and the color of object and/or described original bright The mapping relations spent between section and the brightness section of the color matching pattern.
CN201510883422.2A 2015-12-02 2015-12-02 The color matching method and device of display content Expired - Fee Related CN105549928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510883422.2A CN105549928B (en) 2015-12-02 2015-12-02 The color matching method and device of display content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510883422.2A CN105549928B (en) 2015-12-02 2015-12-02 The color matching method and device of display content

Publications (2)

Publication Number Publication Date
CN105549928A CN105549928A (en) 2016-05-04
CN105549928B true CN105549928B (en) 2017-11-14

Family

ID=55829131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510883422.2A Expired - Fee Related CN105549928B (en) 2015-12-02 2015-12-02 The color matching method and device of display content

Country Status (1)

Country Link
CN (1) CN105549928B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106873959B (en) * 2016-07-12 2020-05-19 阿里巴巴集团控股有限公司 Software interface color matching method and device
CN106327434A (en) * 2016-08-08 2017-01-11 深圳智眸科技有限公司 Color filtering method and color filtering device
US10331167B2 (en) * 2016-08-16 2019-06-25 Rakuten Kobo, Inc. Systems and methods for automated screen color temperature control
CN106648579A (en) * 2016-09-12 2017-05-10 北京量科邦信息技术有限公司 Method and system of native app switching between night mode and day mode
CN106598436B (en) * 2016-12-21 2018-07-20 掌阅科技股份有限公司 Display methods, device and the terminal device of e-book label
CN107861675A (en) * 2017-09-21 2018-03-30 海南智媒云图科技股份有限公司 A kind of method and device of intelligence switching Night
CN109994037B (en) * 2017-12-29 2021-12-14 杭州海康威视系统技术有限公司 Method, device, terminal and storage medium for generating electronic map
CN110097614A (en) * 2018-01-29 2019-08-06 苏州宝时得电动工具有限公司 Hue evaluation method, intelligent typesetting method and apparatus, computer equipment
CN110198437B (en) * 2018-02-27 2021-11-05 腾讯科技(深圳)有限公司 Image processing method and device, storage medium and electronic device
CN111367600A (en) * 2018-12-26 2020-07-03 沈阳美行科技有限公司 Application software display color adjusting method and device and vehicle-mounted equipment
CN110083430B (en) * 2019-04-30 2022-03-29 成都映潮科技股份有限公司 System theme color changing method, device and medium
CN111090368B (en) * 2019-12-30 2021-09-14 北京奇艺世纪科技有限公司 Color matching method and device for determining page characters
CN111222301A (en) * 2020-01-07 2020-06-02 天津麒麟信息技术有限公司 3D character drawing method, system, readable storage medium and device
CN112463150B (en) * 2020-10-16 2023-06-13 苏州浪潮智能科技有限公司 Font and background color adjusting method, device, equipment and readable medium
CN112492106A (en) * 2020-11-27 2021-03-12 北京高途云集教育科技有限公司 Page theme switching method and device, computer equipment and storage medium
CN113360155A (en) * 2021-06-23 2021-09-07 平安普惠企业管理有限公司 Front-end interface background color matching method, device, equipment and storage medium
CN114449242A (en) * 2022-01-25 2022-05-06 北京小米移动软件有限公司 Display control method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102810306A (en) * 2012-07-26 2012-12-05 广东欧珀移动通信有限公司 Method for automatically controlling brightness of display screen wallpaper
CN103179453A (en) * 2011-12-26 2013-06-26 中国电信股份有限公司 Method and system for providing content data to terminal
CN104252327A (en) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 Reading mode start method and device
CN105718229A (en) * 2014-12-05 2016-06-29 珠海金山办公软件有限公司 Text display effect switching method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9542907B2 (en) * 2013-06-09 2017-01-10 Apple Inc. Content adjustment in graphical user interface based on background content

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179453A (en) * 2011-12-26 2013-06-26 中国电信股份有限公司 Method and system for providing content data to terminal
CN102810306A (en) * 2012-07-26 2012-12-05 广东欧珀移动通信有限公司 Method for automatically controlling brightness of display screen wallpaper
CN104252327A (en) * 2013-06-27 2014-12-31 腾讯科技(深圳)有限公司 Reading mode start method and device
CN105718229A (en) * 2014-12-05 2016-06-29 珠海金山办公软件有限公司 Text display effect switching method and device

Also Published As

Publication number Publication date
CN105549928A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105549928B (en) The color matching method and device of display content
CN106201535B (en) The method and apparatus that toolbar background color is converted with the domain color of picture
CN108476292A (en) Unified more image interfusion methods
CN105812674B (en) A kind of color correct method, monitoring method and the device of signal lamp
CN103050090B (en) Method and device for adjusting display brightness of mobile terminal application
CN108206917A (en) The method and device of image procossing, storage medium, electronic device
CN104978186B (en) A kind of rendering intent and device of interface skin
CN109147005B (en) Self-adaptive dyeing method and system for infrared image, storage medium and terminal
CN105578094A (en) Image edge fusion processing system
CN104200794B (en) Image regulating method and display
CN101978682B (en) Image correction apparatus, and image correction method
CN107391150A (en) The adaptive variation of mobile terminal topic tone and system
CN110377860A (en) A kind of page color method of adjustment, device and electronic equipment
CN107346167A (en) The method and device of a kind of display control
CN111857912A (en) Interface processing method and device, electronic equipment and computer readable storage medium
CN108597474A (en) Image processing equipment, image processing method and computer-readable medium
CN109416831A (en) The inexpensive color expansion module of color for expanded images
CN108335260A (en) A kind of scene of game image processing method, device, storage medium and electronic device
CN107408401A (en) The user's sliding block for simplifying adjustment for image
JP4203808B2 (en) Image processing device
CN102696069B (en) Electronic device
CN104935784A (en) Image processing apparatus and image processing method
CN110704052B (en) Service platform color configuration method and device, storage medium and electronic device
CN110020645A (en) A kind of image processing method and device, a kind of calculating equipment and storage medium
CN106803232A (en) A kind of digital picture painting methods and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200604

Address after: 310051 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping B radio square 13 storey tower

Patentee before: GUANGZHOU ALIBABA LITERATURE INFORMATION TECHNOLOGY Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20171114