Method and device for acquiring visual effect of document

文档序号:1073179 发布日期:2020-10-16 浏览:18次 中文

阅读说明:本技术 一种文档视觉效果的获取方法和装置 (Method and device for acquiring visual effect of document ) 是由 王茜 胡娟 刘堃 庄湧 于 2019-04-02 设计创作,主要内容包括:本申请提出一种文档视觉效果的获取方法和装置,所述方法包括:获取所述文档中多个元素间的层叠关系;基于所述层叠关系,获取全部元素的配色属性信息。获取所述文档中多个元素间的层叠关系;根据所述层叠关系,获得相应层叠中的元素的配色属性。本发明能够在视觉上清楚的界定有层叠关系的多个元素,优化了文档显示的视觉效果。(The application provides a method and a device for acquiring a visual effect of a document, wherein the method comprises the following steps: acquiring a stacking relation among a plurality of elements in the document; and acquiring color matching attribute information of all the elements based on the stacking relation. Acquiring a stacking relation among a plurality of elements in the document; and obtaining the color matching attributes of the elements in the corresponding stack according to the stacking relation. The invention can clearly define a plurality of elements with the laminated relation visually, and optimizes the visual effect of document display.)

1. A method for acquiring a visual effect of a document is characterized by comprising the following steps:

acquiring a stacking relation among a plurality of elements in the document;

and acquiring color matching attribute information of all the elements based on the stacking relation.

2. The method of claim 1, wherein: the obtaining of the stacking relationship among the plurality of elements in the document includes:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

3. The method of claim 2, wherein: based on the stacking relationship, obtaining color matching attribute information of all the elements, including:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

4. The method of claim 3, wherein: the color feature information includes: saturation, hue, brightness, color collocation relationship, color matching design category, document logic relationship category.

5. The method of any of claims 1 to 4, wherein: the method is also preceded by:

and setting color characteristic information, and setting a color matching relationship, a color matching design category and a document logic relationship category for the target color.

6. The method of claim 5, wherein: the color matching relationship comprises at least one of the following:

the combination relationship of a plurality of colors at the same level;

a discernable relationship of a color composition of a back level object to a color composition of a front level object;

a stacked display relationship of a plurality of colors;

similarity relationships between the plurality of colors;

a contrast relationship between the plurality of colors.

7. An apparatus for obtaining a visual effect of a document, comprising:

the stacking relation obtaining module is used for obtaining the stacking relation among a plurality of elements in the document;

and the extraction module is used for acquiring the color matching attribute information of all the elements based on the stacking relation.

8. The apparatus of claim 7, wherein the stacking relation obtaining module obtains the stacking relation between the plurality of elements in the document, and comprises:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

9. The apparatus of claim 8, wherein: the extracting module obtains color matching attribute information of all the elements based on the stacking relationship, and comprises the following steps:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

10. The apparatus of any of claims 7 to 9, wherein: further comprising:

and the setting module is used for setting color characteristic information and setting color matching relationship, color matching design category and document logic relationship category for the target color.

Technical Field

The invention relates to the field of document visual effect editing, in particular to a method and a device for acquiring a document visual effect.

Background

In an office environment, a user wants to display the information to participants in a mode of combining pictures and texts when performing activities such as advertising and product demonstration, and often uses playable files which are made by adding some special-effect dynamic display effects to demonstration manuscripts, briefings, characters, pictures and the like for displaying. The software frequently used includes PowerPoint, Office, etc., and in the process of editing display content, a user can edit colors, outlines, sizes, etc. of various objects, and in the process of color matching, as shown in fig. 1-2, the most common way is to preset theme colors according to color matching styles, and when making display content, the user can select colors from the set theme colors and also can customize the colors, wherein the theme colors are equivalent to defining a group of lattices, each lattice has a number, each number corresponds to a color of the theme, and different color matching styles are different colors filled in different lattices. The display interface of a document generally includes various elements, such as a title box and a content box, and the content box may include various types of content: such as text, background images. In the application of an actual document, a plurality of elements on a document display interface may be displayed in an overlapping manner. At present, no scheme for extracting color matching from the existing presentation document (template) influences the user experience.

Disclosure of Invention

The application provides a method and a device for acquiring a visual effect of a document, aiming at the defects of the existing color matching method, and realizing automatic color matching of acquired display content.

The technical scheme is as follows:

a method for acquiring a document visual effect comprises the following steps:

acquiring a stacking relation among a plurality of elements in the document;

and acquiring color matching attribute information of all the elements based on the stacking relation.

Preferably, the obtaining of the stacking relationship among the plurality of elements in the document includes:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

Preferably, obtaining color matching attribute information of all the elements based on the stacking relationship includes:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

Preferably, the color feature information includes: saturation, hue, brightness, color collocation relationship, color matching design category, document logic relationship category.

Preferably, the method further comprises, before:

and setting color characteristic information, and setting a color matching relationship, a color matching design category and a document logic relationship category for the target color.

Preferably, the color matching relationship includes at least one of:

the combination relationship of a plurality of colors at the same level;

a discernable relationship of a color composition of a back level object to a color composition of a front level object;

a stacked display relationship of a plurality of colors;

similarity relationships between the plurality of colors;

a contrast relationship between the plurality of colors.

The invention also provides a device for acquiring the visual effect of the document, which comprises:

the stacking relation obtaining module is used for obtaining the stacking relation among a plurality of elements in the document;

and the extraction module is used for acquiring the color matching attribute information of all the elements based on the stacking relation.

Preferably, the acquiring a stacking relationship among a plurality of elements in the document by the stacking relationship acquiring module includes:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

Preferably, the extracting module obtains color matching attribute information of all the elements based on the stacking relationship, and includes:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

Preferably, the apparatus further comprises:

and the setting module is used for setting color characteristic information and setting color matching relationship, color matching design category and document logic relationship category for the target color.

Compared with the prior art, the application has the following beneficial effects:

compared with the prior art, the invention comprises the following steps: acquiring a stacking relation among a plurality of elements in the document; and obtaining the color matching attributes of the elements in the corresponding stack according to the stacking relation. The invention can clearly define a plurality of elements with the laminated relation visually, and optimizes the visual effect of document display. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

Drawings

FIG. 1 is a schematic representation of a style of color matching of the prior art;

FIG. 2 is a diagram illustrating the display of theme colors according to the prior art;

FIG. 3 is a flowchart of a method for obtaining a visual effect of a document according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram of an apparatus for acquiring a document visual effect according to an embodiment of the present invention.

Detailed Description

The technical solutions of the present application will be described in more detail below with reference to the accompanying drawings and embodiments.

It should be noted that, if not conflicted, the embodiments and the features of the embodiments can be combined with each other and are within the scope of protection of the present application. Additionally, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.

As shown in fig. 3, an embodiment of the present invention further provides a method for acquiring a document visual effect, including:

s101, acquiring a stacking relation among a plurality of elements in the document;

and S102, obtaining color matching attribute information of all the elements based on the stacking relation.

The plurality of inter-element stacking relationships comprises: elements do not overlap with each other, there is partial overlap of elements, elements completely overlap, elements contain but do not overlap (e.g., visually contained elements penetrate contained elements, lie on contained elements);

the document may comprise a slide document; the elements may include title boxes, content in content boxes in the document.

In this embodiment of the present invention, the acquiring a stacking relationship between multiple elements in a document in step S101 includes:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

The stacking relation among different elements is solidified and written into the document, for example, the document with slides is written into the document, so that the existing functions of the document program can be enriched, and the user experience of the document program is optimized; the stacking relation among different elements is written into the editable document, so that a user can adjust the stacking relation among the elements as required, and the use is flexible and convenient.

The stacking relationship written in the document can be calculated by a document maker (such as a template designer and a document user) according to the stacking and perspective effects of the elements.

In this embodiment of the present invention, in step S102, obtaining color matching attribute information of all elements based on the stacking relationship includes:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

The embodiment of the invention extracts the colors appearing in the demonstration document (template). And identifying the extracted color according to a set rule. For example, the red color of the mark is warm and vivid.

In an embodiment of the present invention, the color feature information includes: saturation, hue, brightness, color collocation relationship, color matching design category, document logic relationship category.

In the embodiment of the present invention, the color feature information includes the following components:

"color" in a color scheme refers to color values, regardless of the recording method (4 common color recording systems, RGB, HSL, HSV, CMYK), for example, the RGB system represents a color by saturation, hue, and lightness, and the RGB system represents (255,255,255) black.

After the color value is determined, whether the color value represents a warm color or a cold color, a lively color or a dull color and a brightness range are determined accordingly.

"color matching relationships" in color schemes include, but are not limited to:

the colors are suitable to be used in groups, the colors are mutually visible, the colors are suitable to be displayed in a stacked mode, the colors are in similar relation, and the colors are in contrast relation.

Wherein, "the colors are mutually visible" means that the color composition of the object at the later stage and the color composition of the object at the earlier stage satisfy the distinguishable condition: when the resolvable condition is satisfied, the display content is determined to be visually resolvable, and when the resolvable condition is not satisfied, the display content is determined to be visually indistinguishable.

Wherein the resolvable conditions comprise: and comparing the RGB color composition of the rear-stage object with the RGB color composition of the front-stage object, wherein the comparison result is greater than or equal to a resolution threshold value.

In the embodiment of the present invention, the three components of the RGB color components of the rear-stage object may be subtracted from the three components of the RGB color components of the front-stage object to obtain three difference values, the sum of squares of the three difference values is obtained to obtain a comparison result, when the comparison result is greater than or equal to a preset resolution threshold, the rear-stage object and the front-stage object are considered to satisfy the resolvable condition, that is, the rear-stage object and the front-stage object are visually resolvable, and when the comparison result is less than the preset resolution threshold, the resolvable condition is considered to be not satisfied, that is, the rear-stage object and the front-stage object are visually indistinguishable. For example, a gradation resolution of 256, color 1, RGB (255 ), color 2, RGB (199,237,204), comparison of color 1 and color 2 (255-2+(255-237)2+(255-204)2And comparing the comparison result with a preset threshold value to obtain the visual resolution degree of the color 1 and the color 2, and further comparing the visual resolution degree with a resolution threshold value to determine whether the visual resolution can be realized.

The display content can be generally divided into a plurality of visual levels, for example, when 2 visual levels are available, the visual levels can be called background and foreground, and the colors of the objects in the levels can be called background and foreground; the plurality of visual levels may be referred to as a first level and a second level … … in the display order, where two adjacent or alternate levels are provided, a later level may be referred to as a later level of a preceding level, and a preceding level may be referred to as a preceding level of a succeeding level.

In the embodiment of the present invention, the method further includes:

and setting color characteristic information, and setting a color matching relationship, a color matching design category and a document logic relationship category for the target color.

In an embodiment of the present invention, the color matching relationship includes at least one of the following:

the combination relationship of a plurality of colors at the same level;

a discernable relationship of a color composition of a back level object to a color composition of a front level object;

a stacked display relationship of a plurality of colors;

similarity relationships between the plurality of colors;

a contrast relationship between the plurality of colors.

In the embodiment of the invention, a preset color pair is set, and the color pair is two colors meeting the distinguishable condition.

In the embodiment of the present invention, color pairs are preset, and one color may correspond to one or more color pairs, for example, white and black are a pair of preset color pairs, white and dark blue (a specific color is determined by RGB color composition) are a pair of preset color pairs, white and red (a specific color is determined by RGB color composition) are a pair of preset color pairs, for example, the color of the rear stage object is black, and the color of the front stage object is yellow.

The embodiment of the invention also sets a series of colors in advance for better visual effect and aesthetic feeling, wherein the series of colors are a plurality of colors meeting the distinguishable condition. One color may correspond to one or more series colors, for example, red, yellow, and green (the specific color is determined by the composition of RGB colors) are a set of series colors, for example, a plurality of filling boxes are included in the same hierarchy, and after one filling box fills red, other filling boxes may select the series colors to fill, and fill yellow and green.

In embodiments of the present invention, if several colors are suitable for use in a group, a series of rules are extracted in conjunction with the structured definition, such as:

1) in the structured definition, a group is considered a group when used;

2) the colors appearing on the first-level decorations of all slides in the same slide page are regarded as a group;

the colors are mutually visible: the colors appearing on two objects in overlying relationship are visible to each other.

Color appropriate display of stacks: the colors appearing on a plurality of objects in overlying relationship are visible to each other.

The colors are similar, and the colors are identified with characteristics according to a set rule. For example: red and orange are similar relationships.

The colors are in a contrast relationship, and the colors are identified with characteristics according to established rules. For example: red and green are in contrast.

The color matching design category is divided into a main color and an auxiliary color.

Combining the logical structure relationship of the document, the method is divided into: background color, color of the cover plate, color of the font, color of the design effect and color of the decoration:

1) background color: from slide background color, substrate color, background picture;

2) character body color: colors appearing on characters and icons;

3) designing effect color: namely other colors, objects such as background, substrate, mask, characters, icons and the like are removed from the whole document, and the colors appearing in the rest objects;

4) coloring: colors that do not appear in other groups, but only appear on decorations that do not overlay any icons or text;

5) masking color: colors that did not appear in the other groups, but only in the mask.

"monochrome, gradient color," is extracted directly from the attributes of the presentation document.

As shown in fig. 4, an embodiment of the present invention further provides an apparatus for acquiring a document visual effect, including:

a stacking relation obtaining module 100, configured to obtain a stacking relation among multiple elements in the document;

and the extracting module 200 is configured to obtain color matching attribute information of all the elements based on the stacking relationship.

In this embodiment of the present invention, the acquiring a stacking relationship between multiple elements in the document by the stacking relationship acquiring module 100 includes:

acquiring the stacking relation among a plurality of elements from a document for solidifying the stacking relation among the description elements;

or the like, or, alternatively,

and acquiring the stacking relation among the elements from the document of the stacking relation among the editable elements.

In this embodiment of the present invention, the extracting module 200 obtains color matching attribute information of all elements based on the stacking relationship, including:

determining the hierarchy of each element based on the stacking relation;

for an element in the determined hierarchy, marking the hierarchy in which the element is located and color feature information of the element.

In the embodiment of the present invention, the apparatus further includes:

and the setting module is used for setting color characteristic information and setting color matching relationship, color matching design category and document logic relationship category for the target color.

The embodiment of the invention also provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the method for acquiring the visual effect of the document is realized.

The embodiment of the invention also provides a terminal for acquiring the visual effect of the document, which is characterized by comprising the following components:

a memory for storing computer readable instructions;

and the processor is used for executing the computer readable instructions to realize the method for acquiring the document visual effect.

Although the embodiments of the present invention have been described above, the contents thereof are merely embodiments adopted to facilitate understanding of the technical aspects of the present invention, and are not intended to limit the present invention. It will be apparent to persons skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种文档提供方法、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!