Summary of the invention
In view of the above problems, it proposes on the application overcomes the above problem or at least be partially solved in order to provide one kind
State the generation method of the picture of problem, the generating means of picture and computer equipment, computer readable storage medium.
According to the one aspect of the application, a kind of generation method of picture is provided, the picture includes multiple data elements
Element, which comprises
Obtain the data element placement rule for Target Photo and multiple target data elements;
Element layout's rule, multiple target data elements and at least one graphic template based on the data, generate extremely
A few Target Photo.
Optionally, the data element placement rule obtained for Target Photo and multiple target data element packets
It includes:
The reference picture that user submits is parsed, data element placement rule and multiple target data elements are obtained.
Optionally, the rule of element layout based on the data, multiple target data elements and at least one picture
Template, generating at least one Target Photo includes:
Adjustment is laid out to the data element in the graphic template using the data element placement rule, is generated extremely
A few Target Photo.
Optionally, same class data element constitutes a data elements groups, and the data element placement rule includes as follows
It is at least one: the placement rule of each data element of placement rule, the data elements groups between data elements groups.
Optionally, described that the data element in the graphic template is laid out using the data element placement rule
Adjustment, generating at least one Target Photo includes:
According to the placement rule of each data element of data elements groups in the data element placement rule, to each data element
Each data element is laid out adjustment in plain group;
According to the placement rule in the data element placement rule between data elements groups, each data elements groups are carried out
Distributing adjustment.
Optionally, the data element placement rule further includes the placement rule of the data element of type of service, described to adopt
Adjustment is laid out to the data element in the graphic template with the data element placement rule, generates at least one target
Picture further include:
Increase the graphic template data element of type of service, or the number to the type of service in the graphic template
Adjustment is laid out according to element.
Optionally, described that the data element in the graphic template is laid out using the data element placement rule
Adjustment, generates at least one Target Photo further include:
Determine the display effect data of each data element;
It rejects the display effect data and does not meet the data element that setting display requires.
Optionally, before the rejecting display effect data do not meet the data element that setting display requires, institute
It states and adjustment is laid out to the data element in the graphic template using the data element placement rule, generate at least one
Picture further include:
Determine the display weight of each data element;
The rejecting display effect data do not meet the data element that setting display requires
The display effect data, which are rejected, according to the display weight does not meet the data element that setting display requires.
Optionally, the method also includes:
Obtain at least one target size of Target Photo;
In the element layout based on the data rule, multiple target data elements and at least one graphic template,
Before generating at least one Target Photo, the method also includes:
Graphic template is chosen according to the target size;
Selected graphic template is adjusted according to the target size.
Optionally, in the rule of element layout based on the data, multiple target data elements and at least one figure
Piece template, before generating at least one Target Photo, the method also includes:
Screening meets at least one graphic template described in picture evaluation rule from multiple graphic templates.
Optionally, in the rule of element layout based on the data, multiple target data elements and at least one figure
Piece template, before generating at least one Target Photo, the method also includes:
Multiple pictures are clustered according at least one picture attribute;
The identical picture attribute for extracting all kinds of pictures generates at least one described picture mould according to the identical picture attribute
Plate.
Optionally, in the rule of element layout based on the data, multiple target data elements and at least one figure
Piece template, after generating at least one Target Photo, the method also includes:
Screening meets the Target Photo of picture evaluation rule from least one Target Photo of generation.
Optionally, the adjustment includes at least one of content adjustment, size adjusting and position adjustment.
Correspondingly, present invention also provides a kind of generating means of picture, the picture includes multiple data elements, described
Device includes:
Module is obtained, for obtaining the data element placement rule for being used for Target Photo and multiple target data elements;
Image generating module, for the rule of element layout based on the data, multiple target data elements and at least one
A graphic template generates at least one Target Photo.
Optionally, the acquisition module includes:
Picture analyzing sub-module obtains data element placement rule and more for parsing the reference picture of user's submission
A target data element.
Optionally, the image generating module includes:
Picture generates submodule, for using the data element placement rule to the data element in the graphic template
It is laid out adjustment, generates at least one Target Photo.
Optionally, same class data element constitutes a data elements groups, and the data element placement rule includes as follows
It is at least one: the placement rule of each data element of placement rule, the data elements groups between data elements groups.
Optionally, the picture generation submodule includes:
Element adjustment unit, for the cloth according to each data element of data elements groups in the data element placement rule
Office's rule, is laid out adjustment to each data element in each data elements groups;
Element group adjustment unit, for being advised according to the layout in the data element placement rule between data elements groups
Then, adjustment is laid out to each data elements groups.
Optionally, the data element placement rule further includes the placement rule of the data element of type of service, the figure
Piece generates submodule further include:
Layout adjusting unit, for the data element to graphic template increase type of service, or to the picture mould
The data element of type of service in plate is laid out adjustment.
Optionally, the picture generates submodule further include:
Data determination unit, for determining the display effect data of each data element;
Element culling unit does not meet the data element that setting display requires for rejecting the display effect data.
Optionally, the picture generates submodule further include:
Weight determining unit, in the data element rejected the display effect data and do not meet setting display requirement
Before element, the display weight of each data element is determined;
The element culling unit includes:
Element rejects subelement, does not meet setting display for rejecting the display effect data according to the display weight
It is required that data element.
Optionally, described device further include:
Dimension acquisition module, for obtaining at least one target size of Target Photo;
Described device further include:
Template chooses module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, chooses graphic template according to the target size;
Target adjustment module, for being adjusted according to the target size to selected graphic template.
Optionally, described device further include:
Template filter module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template, before generating at least one Target Photo, screening meets picture evaluation rule from multiple graphic templates
At least one described graphic template then.
Optionally, described device further include:
Picture cluster module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, carries out multiple pictures according at least one picture attribute
Cluster;
Template generation module is generated for extracting the identical picture attribute of all kinds of pictures according to the identical picture attribute
At least one described graphic template.
Optionally, described device further include:
Picture screening module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template after generating at least one Target Photo, screens from least one Target Photo of generation and meets
The Target Photo of picture evaluation rule.
Optionally, the adjustment includes at least one of content adjustment, size adjusting and position adjustment.
Correspondingly, present invention also provides a kind of computer equipments, including memory, processor and storage are on a memory
And the computer program that can be run on a processor, which is characterized in that the processor is realized when executing the computer program
Such as the method for above-mentioned one or more.
Correspondingly, present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, special
Sign is, the method such as above-mentioned one or more is realized when which is executed by processor.
According to the embodiment of the present application, the data element placement rule and multiple number of targets of Target Photo are used for by obtaining
According to element, element layout's rule, multiple target data elements and at least one graphic template, are generated at least based on the data
One Target Photo so that when generating picture, overcome picture size and the ratio of width to height can not customized problem, avoid
Limited several sizes are confined to come the problem of generating picture, without being adjusted manually to the data element of picture, so that it may
The generation of the picture of arbitrary dimension is realized, so that saving user makes computing resource and the working time consumed by picture.
Above description is only the general introduction of technical scheme, in order to better understand the technological means of the application,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects, features and advantages of the application can
It is clearer and more comprehensible, below the special specific embodiment for lifting the application.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
To make those skilled in the art more fully understand the application, below to this application involves concept be illustrated:
May include multiple data elements in picture, data element include picture element, text element etc. or other
The applicable form of meaning, the embodiment of the present application is without limitation, for example, picture can be advertising pictures.Picture can have one kind
Or a variety of data elements, various data elements can have one or more.For example, the data element of composition picture as shown in Figure 1
Element schematic diagram, according to the component content of picture picture can be divided into background data element, official documents and correspondence data element (main title,
Subtitle, auxiliary title etc.), master map data element, tag data elements, LOGO (LOGOtype, trade mark/logo) data element
Parts such as (footmarks), are denoted as data element.
Picture from target data element, data element placement rule, the synthesis of picture template, is denoted as Target Photo.
For generating the data element of picture, it is denoted as target data element.
In a kind of embodiment of the application, optionally, the reference that target data element can be submitted by parsing user
Picture obtains, and Target Photo can be to be generated according to the reference picture that user submits, and can have in the reference picture that user submits
Multiple data elements therefrom extract all or part of data element, as generation Target Photo by parsing reference picture
Target data element.
Wherein, picture template defines the position of each data element and size in picture, can specifically use data element
The positions and dimensions of the boundary rectangle frame of element are come come the positions and dimensions for indicating data element or any other applicable mode
The layout pattern of data element on picture is defined, the embodiment of the present application is without limitation.For example, picture mould as shown in Figure 2
The schematic layout pattern of version, x in figureiIt is scale parameter, indicates the wide or high ratio of the segment length and picture, so that it is determined that each
Position and size of a data element in picture.Picture template can obtain or can pass through statistics according to input setting
The position of each data element designed in a large amount of pictures and size, it is determining to design same or similar position and ruler with most of
It is very little then to obtain or any other applicable mode, the embodiment of the present application are without limitation.
Graphic template can be obtained according to the statistical result of the size of common picture, the size point of picture as shown in Figure 3
Picture is divided into 4 sections: (0,1), (1,3), (3,7), (7,24) according to the ratio of width to height by the schematic diagram of cloth.In each section,
It can be found that the relative position of each data element and size meet certain general rule in picture, it is based on this feature, point
Not Wei each section one general graphic template is set, determine the layout of each data element.
In a kind of embodiment of the application, optionally, graphic template can also be generated according to multiple pictures, comprising: be pressed
Multiple pictures are clustered according at least one picture attribute, the identical picture attribute of all kinds of pictures are extracted, according to described identical
Picture attribute generates at least one described graphic template.
Picture attribute includes the size of picture, the position of data element and size or any other applicable in picture
Attribute, the embodiment of the present application are without limitation.For example, picture attribute is the ratio of width to height of picture.Using clustering algorithm according to extremely
A kind of few picture attribute clusters multiple pictures, is divided into the multiple classes being made of similar picture, extracts all kinds of pictures
Identical picture attribute generates at least one graphic template according to identical picture attribute.
Wherein, data element placement rule define positional relationship in picture between data element, dimension scale relationship,
Spacing ratio relationship, the selection rule etc. of data element or any other applicable mode define data element on picture
Placement rule, the embodiment of the present application is without limitation.For example, the placement rule being aligned between data element as shown in Figure 4
Schematic diagram, be laid out that neat picture is often more popular with users, the alignment thereof of layout includes: align center, left-justify, the right side
Alignment or any other applicable alignment thereof, the embodiment of the present application are without limitation.
In a kind of embodiment of the application, optionally, what data element placement rule can be submitted by parsing user
Reference picture as template obtains, and multiple data elements have placement rule in the reference picture that user submits, and passes through parsing
Reference picture therefrom extracts the placement rule of data element in reference picture, as the data element cloth for generating Target Photo
Office's rule, to guarantee that the layout style of the picture generated is consistent with the template of input.
Same class data element may be constructed a data elements groups, and specifically, a data elements groups can be by same
At least one data element of class is constituted.For example, multiple lteral data elements are same class, a data elements groups are constituted, or
The multiple image data elements of person are same class, constitute a data elements groups, or be in multiple data elements of same figure layer
Same class constitutes a data elements groups, or in multiple data elements of same display area is same class, constitutes a number
According to element group.It can specifically set according to actual needs and how constitute a data elements groups, the embodiment of the present application does not do this
Limitation.
The data element placement rule of picture generally has the characteristics that visual balance, visual balance specifically include that symmetrical flat
Weighing apparatus, radioactive equilibrium and crystallization equilibrium.Symmetrical balance is using an apparent balance mode of the center line as normal line, center line
The right and left be in mirror symmetry.Radioactive equilibrium is the balance mode dissipated around centered on a focus, it is however generally that,
The layout of radioactive equilibrium has a visual focus, is center the most attracting in entire composition, keeps the sight of onlooker quick
It is attracted on a point, therefore radioactive equilibrium has vision guide.Crystallization equilibrium is a kind of asymmetric vision on the whole
The eyes of balance, onlooker will not be attracted by some specific part, but the vision for making onlooker have a kind of whole machine balancing is general
It includes, is opposite with radioactive equilibrium.
In a kind of embodiment of the application, optionally, data element placement rule includes following at least one: data element
The placement rule of each data element of placement rule, the data elements groups between plain group.
Placement rule between data elements groups defines positional relationship, dimension scale in picture between data elements groups
Relationship, spacing ratio relationship etc. specifically can indicate data using the positions and dimensions of the boundary rectangle frame of data elements groups
The positions and dimensions of element group or any other applicable mode are advised to define the layout on picture between data elements groups
Then, the embodiment of the present application is without limitation.For example, the reference picture submitted for user, wherein multiple lteral datas
Element one data elements groups " group of text " of composition, one data elements groups " picture group " of multiple image data elements compositions, one
A background data element constitutes a data elements groups " background group ", and the regional location where group of text is lt (xt,yt,wt,
ht), the regional location where picture group is le (xe,ye,we,he), the size of background data element is (w, h), then group of text with
The spacing of picture group is Δ dx=xe-(xt+wt), the wide ratio of spacing and background isAs background group, text
Placement rule between group, picture group.
There is different placement rules between inhomogeneous data elements groups, it can be according to data element in data elements groups
Classification determine placement rule, for example, tag data elements with respect to the placement rule of " picture group " include tag data elements with
The dimension scale relationship of " picture group ", position of the tag data elements with respect to " picture group " regional center.Footmark data element phase
Placement rule to " group of text " includes the size of footmark data element and the dimension scale relationship of " group of text ", footmark data element
The position of element opposite " background group ".
The placement rule of each data element of data elements groups defines each data element for including in data elements groups
Between positional relationship, dimension scale relationship, spacing ratio relationship etc. or any other applicable mode define data element
Placement rule in plain group between data element, the embodiment of the present application are without limitation.The size of data element is that have one
Fixed proportionate relationship, it needs to retain the proportionate relationship of size between data element under different sizes, guarantees design style
Consistency, dimension scale relationship includes data element in the dimension scale and same data elements groups of data element and picture
Dimension scale between element.The schematic diagram of the placement rule of spacing, data between the data element of data elements groups as shown in Figure 5
Spacing between element will affect the aesthetics of layout, the spacing of data element in addition to related to the size of entire picture, also and
Adjacent data element is related.
Different data elements groups have different placement rules, for example, in " picture group " size of data element and
Data element can characterize the design feature of picture with respect to the position of " picture group " regional center.By calculating available " number
According to the dimension scale between element i " and " data element j ":
By calculating the position that can also obtain data element with respect to " picture group " regional center.Data element in " group of text "
The alignment thereof of element, dimension scale, spacing ratio can characterize the design feature of picture.Assuming that there are three numbers in " group of text " region
According to element xti, i=1,2,3, for text, the height of data element is directly related with font size, utilizes data element
The ratio of height can be with the size relationship between characterize data element.Data element xtiWith data element xtjHeight ratio
It is expressed asData element xtiWith data element xtjSpacing be expressed asData element
The ratio of spacing and " group of text " region height be expressed as
It is illustrated by taking the generating process of Target Photo as an example below.
For example, the schematic diagram of the generating process of Target Photo as shown in FIG. 6.First input as master module picture with
And the target size of customized setting.Then, picture of the parsing as master module, then, according to the classification and cloth of data element
Data element is grouped by office's feature, obtains data elements groups.The placement rule for calculating data element, as generation Target Photo
Data element placement rule.Then, the ratio of width to height of target size is calculated, picture corresponding with the ratio of width to height of target size is chosen
Template.Data element and data elements groups are laid out according to graphic template, determine the position of data element and data elements groups
It sets.Data element is adjusted according to data element placement rule later.
Since lteral data element and region shared by tag data elements are there may be overlapping, first according to label data
The size and positional relationship of element and background data element determine size and the position of tag data elements, it is also necessary to according to mark
The size of data element is signed to determine whether to retain the tag data elements.Determine tag data elements group the band of position it
Afterwards, need to be adjusted lteral data element region, guarantee tag data elements group region not with text data
The overlapping of element group region.After the position for determining tag data elements and text data element group, according to data element
Placement rule is adjusted lteral data element.
Then, according to the size and spacing ratio between the lteral data element in the data elements groups of lteral data element composition
Example relationship, calculates size and the position of each lteral data element, and determine whether to protect according to the size of lteral data element
Stay the lteral data element.After size and position that lteral data element has been determined, according to data element placement rule logarithm
It is adjusted according to the position in region shared by element group.
Correspondingly, according to image data element composition data elements groups in image data element between size and position
Relationship, calculates size and the position of each image data element, and determines whether to retain according to the size of image data element
The image data element.After size and position that image data element has been determined, according to data element placement rule to data
The position in region shared by element group is adjusted.
Then according to corresponding two data elements of lteral data element in data element placement rule and image data element
Spaced relationship between plain group calculates the spacing in region shared by two data elements groups, and spacing is excessive in order to prevent, is arranged one
Spacing threshold, when the spacing in the region shared by two data elements groups is greater than spacing threshold, using spacing threshold as spacing.According to
Symmetry principle, in picture the ratio of width to height in the section of (1,7), using bilateral symmetry principle, by lteral data element and image data
Element is symmetrically placed on the basis of the horizontal axis of background data element, and the spacing of the two is the spacing calculated.In picture
The ratio of width to height is symmetrically placed on the basis of the vertical central axis of background data element using principle symmetrical above and below in the section of (0,1).
In picture the ratio of width to height in the section of (7,24), then lteral data element and image data element or so are placed, and the two is made
For entirety, it is centrally placed in the centre of picture.
After lteral data element and image data element has been determined, according to tag data elements and image data element
Positions and dimensions relationship calculates position and the size of tag data elements, and is determined whether according to the size of tag data elements
Retain the tag data elements, determines final size and the position of tag data elements.
In some specific application scenarios or advertising campaign, the rule to certain data element specified layouts is needed
(for example the mark of advertising campaign must necessarily be placed in the upper left corner) completes the entirety of picture in the case where the binding of this and business scenario
After layout, these data elements are finally added, or carry out the adjustment of positions and dimensions to data element in picture.
By the above process, generates and obtain the Target Photo of corresponding target size.
According to one embodiment of the application, e-commerce platform is used to recommend to have a large amount of exhibition on the page of trading object
Show position, seller user can choose some display location, and the picture comprising trading object is added to selected displaying position
It sets.Wherein, different display locations has different sizes requirement, for example, the width of the display area of different display locations
And Gao Butong.This application provides a kind of generting machanisms of picture, can apply on the generating platform of picture, the generation of picture
Platform can be based on data element placement rule, multiple target data elements and at least one graphic template, generate at least one
Target Photo is shown by a Target Photo in the display location of a variety of pages later, overcomes the size and width of picture
Height than can not customized problem, avoid be confined to limited several sizes come the problem of generating picture, do not need manually weigh
Multiple operation can realize the generation of the picture of more sizes, and the application is applicable in but is not limited to above-mentioned application scenarios.
Referring to Fig. 7, a kind of flow chart of the generation method embodiment of picture according to the embodiment of the present application one is shown, it should
Method can specifically include following steps:
Step 101, data element placement rule and the multiple target data elements for Target Photo are obtained.
In the embodiment of the present application, in order to generate Target Photo, need to obtain data element placement rule and multiple targets
Data element, data element placement rule and multiple target data elements can be obtained and submitting respectively, can also be passed through
It submits and obtains together.
For example, the generating platform of picture can provide data element placement rule and multiple target datas member to user
The submission entrance of element submits data element placement rule and multiple target data elements in the submission entrance for user, or
Person can provide the submission entrance of picture to user, for parsing data element placement rule and more from the picture of submission
A target data element or any other applicable mode obtain data element placement rule and multiple target datas member
Element, the embodiment of the present application are without limitation.
Step 102, element layout's rule, multiple target data elements and at least one picture mould based on the data
Plate generates at least one Target Photo.
In the embodiment of the present application, data element placement rule, multiple target data elements and at least one figure are based on
The Target Photo of piece template, generation can be there are many size.One graphic template, which can correspond to, generates one or more sizes
Target Photo.Target Photo includes all or part in the multiple target data elements obtained, specifically can be according to data element
Plain placement rule or graphic template or setting display require determination, and the embodiment of the present application is without limitation.
Picture template defines the position of each data element and size in picture, and data element placement rule defines figure
Positional relationship, dimension scale relationship, spacing ratio relationship, the selection rule of data element in piece between data element etc., two
Person can determination data element positions and dimensions.The data element configured in combined data element layout rule and graphic template
Position, the size etc. of element, are synthesized to obtain final Target Photo.
In one implementation, first according to graphic template determine total data element or partial data element position and
Size is adjusted further according to positions and dimensions of the data element placement rule to total data element or partial data element,
Generate Target Photo.In another implementation, total data element or part are first determined according to data element placement rule
The positions and dimensions of data element, further according to graphic template to the positions and dimensions of total data element or partial data element into
Row adjustment, generates Target Photo.In another implementation, first by data element in data element placement rule and graphic template
The definition of the positions and dimensions of element merges, and for different definition using one of definition, determines further according to the two
Positions and dimensions generate Target Photo.
According to the embodiment of the present application, data element placement rule and multiple target data elements by acquisition picture,
Element layout's rule, multiple target data elements and at least one graphic template based on the data, generate at least one mesh
Mark on a map piece so that when generating picture, overcome picture size and the ratio of width to height can not customized problem, avoid and be confined to
Limited several sizes are come the problem of generating picture, without being adjusted manually to the data element of picture, so that it may realize and appoint
The generation of the picture for size of anticipating, so that saving user makes computing resource and the working time consumed by picture.
Referring to Fig. 8, a kind of flow chart of the generation method embodiment of picture according to the embodiment of the present application two is shown, it should
Method can specifically include following steps:
Step 201, the reference picture that parsing user submits obtains data element placement rule and multiple target datas member
Element.
When in the embodiment of the present application, to make to generate Target Photo according to target data element, it is not easy to data element occur
There is the case where sawtooth in the distortion of element, and can require the size for the reference picture submitted is one of common picture biggish
Size, such as 2000 pixels in this way when generating Target Photo, are mainly reduced and are cut to data element multiplied by 500 pixels
The case where cutting out, being less prone to the poor display effects such as distortion and sawtooth.
Step 202, at least one target size of Target Photo is obtained.
In the embodiment of the present application, target size is the size of Target Photo, can be obtained in picture for information,
It can submit and obtain respectively, the embodiment of the present application is without limitation.
Step 203, graphic template is chosen according to the target size.
In the embodiment of the present application, there are many graphic templates, every kind of graphic template can correspond to the picture of multiple sizes,
Target size can have multiple, and multiple target sizes can choose a graphic template, can also choose multiple graphic templates.
For example, being divided into 4 sections: (0,1), (1,3), (3,7), (7,24) according to the ratio of width to height of picture.For each area
Between be correspondingly arranged a graphic template, determine the layout of each data element.It is fallen into according to the ratio of width to height of the target size of calculating
Section, choose corresponding graphic template.
Step 204, selected graphic template is adjusted according to the target size.
In the embodiment of the present application, graphic template can only define the positions and dimensions between data element, can also determine
Justice has the size of an initial entire picture.To make the picture generated meet target size, first according to target size pair
Selected graphic template is adjusted.A kind of implementation is, the position between the data element defined for graphic template and
Size is adjusted according to target size, the positions and dimensions between data element after being adjusted;Another implementation
To have the graphic template of the size of initial entire picture to definition, being adjusted according to target size, and accordingly adjust data
Positions and dimensions between element, obtain the graphic template or any other applicable implementation of target size, and the application is real
It is without limitation to apply example.
Step 205, tune is laid out to the data element in the graphic template using the data element placement rule
It is whole, generate at least one Target Photo.
In the embodiment of the present application, the positions and dimensions first defined according to graphic template, determine the layout of data element, then
Adjustment is laid out to the data element in graphic template using data element placement rule, generates at least one Target Photo.
In a kind of embodiment of the application, optionally, the adjustment includes content adjustment, size adjusting and position adjustment
At least one of.Content adjustment includes the addition and deletion or any other applicable to data element content of data element
Adjustment, the embodiment of the present application is without limitation;Size adjusting includes the adjustment of the size of each dimension of data element, or
Any other applicable adjustment to data element size, the embodiment of the present application are without limitation;Position adjustment includes data
The adjustment of element present position, the adjustment of data elements groups present position or any other applicable to data element position
Adjustment, the embodiment of the present application is without limitation.
It is optionally, described to use the data element placement rule to the picture in a kind of embodiment of the application
Data element in template is laid out adjustment, and generating at least one Target Photo includes: to be laid out to advise according to the data element
The then placement rule of each data element of middle data elements groups is laid out adjustment to each data element in each data elements groups;
According to the placement rule in the data element placement rule between data elements groups, tune is laid out to each data elements groups
It is whole.
The placement rule of each data element of data elements groups, including data element are defined in data element placement rule
Positional relationship, dimension scale relationship, spacing ratio relationship in group between each data element etc..According to each data of data elements groups
The placement rule of element is laid out adjustment to each data element in each data elements groups.
Data element placement rule also defines the placement rule between data elements groups, including between data elements groups
Positional relationship, dimension scale relationship, spacing ratio relationship etc., according to the placement rule between data elements groups, to each data element
Plain group is laid out adjustment.
In a kind of embodiment of the application, optionally, data element placement rule further includes the data element of type of service
The placement rule of element, it is described that tune is laid out to the data element in the graphic template using the data element placement rule
Whole, generating at least one Target Photo can also include: the data element for increasing the graphic template type of service, or to institute
The data element for stating the type of service in graphic template is laid out adjustment.
The data element of type of service includes the data element that will have certain predicable, including in electronic commerce affair
" activity " mark or the mark in " shop " etc., for example, the identification data elements of " double 11 advertising campaigns ".Data element cloth
Office's rule there is also defined the placement rule of the data element of type of service, the positions and dimensions of the data element including type of service
Deng.
In one implementation, the data element of type of service is not belonging to target data element, according to type of service
The placement rule of data element increases to the data element of type of service in graphic template, and determining and target data element
Positions and dimensions relationship.
In another implementation, the data element of type of service belongs to target data element, according to type of service
The placement rule of data element determines the data element of the type of service in target data element, adjusts business in graphic template
The positions and dimensions of the data element of type.
It is optionally, described to use the data element placement rule to the picture in a kind of embodiment of the application
Data element in template is laid out adjustment, and each data element can also be comprised determining that by generating at least one Target Photo
Display effect data;It rejects the display effect data and does not meet the data element that setting display requires.
When being laid out adjustment, the data element in picture will do it scaling, and data element can be because zooming in or out out
Now obscure, flash situations such as, in order to guarantee the display effect of picture, need to do not meet display require data reject.
Display effect of the display effect data for characterize data element, area, height including data element etc., or
Any other applicable data, the embodiment of the present application are without limitation.For example, for the number of tag data elements, picture category
According to element, LOGO data element etc., if the area of data element does not meet setting display and requires less than 900 (pixels),
It is no longer shown under the target size.For text class data element, first, in accordance with each lteral data in the reference picture of submission
The height of element, calculates the importance of data element, the bigger lteral data element of font, and importance is also higher.
In a kind of embodiment of the application, optionally, it is aobvious that setting is not met in the rejecting display effect data
Before showing the data element of requirement, it is described using the data element placement rule to the data element in the graphic template into
Row distributing adjustment generates at least one Target Photo further include: determines the display weight of each data element;Described in the rejecting
It includes: to reject the display effect according to the display weight that display effect data, which do not meet the data element that setting display requires,
Data do not meet the data element that setting display requires.
It shows that weight is used for the importance of characterize data element, display power generally can be determined by the size of data element
Weight, bigger data element show that weight is also higher or any other applicable mode determines that display weight, the application are implemented
Example is without limitation.For example, when being laid out adjustment to lteral data element, according to the data element of lteral data element composition
Element organizes the size in shared region, calculates the size of each lteral data element, then traverses all lteral data elements, if
There is the height of lteral data element less than 12 (pixels), then according to the importance of lteral data element, by the text that importance is minimum
Digital data element is rejected, then recalculates the size of each lteral data element, recycles this process, until without lteral data member
Until the height of element is less than 12 (pixels).
According to the embodiment of the present application, the reference picture submitted by parsing user, obtain data element placement rule and
Multiple target data elements, and at least one target size of Target Photo is obtained, it is chosen scheme according to the target size later
Piece template is adjusted selected graphic template according to the target size, finally using data element layout rule
Adjustment then is laid out to the data element in the graphic template, generates at least one Target Photo, so that generating target
When picture, overcome picture size and the ratio of width to height can not customized problem, avoid be confined to limited several sizes come
The problem of generating picture, without being adjusted manually to the data element of picture, so that it may realize the life of the picture of arbitrary dimension
At so that saving user makes computing resource and the working time consumed by picture, and due to data element placement rule
It is that the reference picture submitted from user parses to obtain with target data element, so that there is the Target Photo generated user to submit
The layout characteristics of reference picture.
Referring to Fig. 9, a kind of flow chart of the generation method embodiment of picture according to the embodiment of the present application three is shown, it should
Method can specifically include following steps:
Step 301, data element placement rule and the multiple target data elements for Target Photo are obtained.
Step 302, screening meets at least one graphic template described in picture evaluation rule from multiple graphic templates.
In the embodiment of the present application, picture evaluation rule is used to evaluate picture or whether graphic template is able to satisfy needs, packet
Include the Rule of judgment of the relationships such as position, size, the spacing being directed between data element setting, according to the picture sample instruction manually evaluated
Practise the sorter model for judging picture classification or any other applicable side for judging whether to meet picture evaluation rule
Formula, the embodiment of the present application are without limitation.
For example, meeting the graphic template of picture evaluation rule by sorter model screening.It is defeated when sorter model training
The feature entered is position and the size of each data elements groups, and preparing a large amount of positive negative sample respectively, (positive sample, satisfaction are manually commented
Provisioning request, the graphic template that can be used normally;Negative sample is unsatisfactory for manually evaluating, the graphic template not being available), it uses
The mode of random forest carrys out training pattern, obtains the sorter model for judging the layout quality of graphic template.Meanwhile passing through
Computer exhaustive computations go out the graphic template of different layouts, and the picture for meeting picture evaluation rule is then filtered out using model
Template.
Step 303, element layout's rule, multiple target data elements and at least one picture mould based on the data
Plate generates at least one Target Photo.
Step 304, the Target Photo for meeting picture evaluation rule is screened from least one Target Photo of generation.
In the embodiment of the present application, this step implementation may refer to the description of step 302 in the embodiment of the present application, this
Place does not repeat separately.
According to the embodiment of the present application, data element placement rule and multiple target data elements by acquisition picture,
Screening meets at least one graphic template described in picture evaluation rule from multiple graphic templates, based on the data element cloth
Office's rule, multiple target data elements and at least one graphic template, generate at least one Target Photo, at least from generation
Screening meets the Target Photo of picture evaluation rule in one Target Photo, so that overcoming the ruler of picture when generating picture
Very little and the ratio of width to height can not customized problem, avoid and be confined to limited several sizes come the problem of generating picture, without hand
It is dynamic that the data element of picture is adjusted, so that it may the generation of the picture of arbitrary dimension to be realized, to save user's production
Computing resource and working time consumed by picture, and graphic template and Target Photo carry out screening and may insure to automatically generate
Picture availability.
Referring to Fig.1 0, show a kind of structural frames of the generating means embodiment of picture according to the embodiment of the present application four
Figure, can specifically include:
Module 401 is obtained, for obtaining the data element placement rule and multiple target datas member that are used for Target Photo
Element;
Image generating module 402, for the rule of element layout based on the data, multiple target data elements and at least
One graphic template, generates at least one Target Photo.
In a kind of embodiment of the application, optionally, the acquisition module includes:
Picture analyzing sub-module obtains data element placement rule and more for parsing the reference picture of user's submission
A target data element.
In a kind of embodiment of the application, optionally, the image generating module includes:
Picture generates submodule, for using the data element placement rule to the data element in the graphic template
It is laid out adjustment, generates at least one Target Photo.
In a kind of embodiment of the application, optionally, same class data element constitutes a data elements groups, the number
It include following at least one according to element layout's rule: each number of placement rule, the data elements groups between data elements groups
According to the placement rule of element.
In a kind of embodiment of the application, optionally, the picture generates submodule and includes:
Element adjustment unit, for the cloth according to each data element of data elements groups in the data element placement rule
Office's rule, is laid out adjustment to each data element in each data elements groups;
Element group adjustment unit, for being advised according to the layout in the data element placement rule between data elements groups
Then, adjustment is laid out to each data elements groups.
In a kind of embodiment of the application, optionally, the data element placement rule further includes the number of type of service
According to the placement rule of element, the picture generates submodule further include:
Layout adjusting unit, for the data element to graphic template increase type of service, or to the picture mould
The data element of type of service in plate is laid out adjustment.
In a kind of embodiment of the application, optionally, the picture generates submodule further include:
Data determination unit, for determining the display effect data of each data element;
Element culling unit does not meet the data element that setting display requires for rejecting the display effect data.
In a kind of embodiment of the application, optionally, the picture generates submodule further include:
Weight determining unit, in the data element rejected the display effect data and do not meet setting display requirement
Before element, the display weight of each data element is determined;
The element culling unit includes:
Element rejects subelement, does not meet setting display for rejecting the display effect data according to the display weight
It is required that data element.
In a kind of embodiment of the application, optionally, described device further include:
Dimension acquisition module, for obtaining at least one target size of Target Photo;
Described device further include:
Template chooses module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, chooses graphic template according to the target size;
Target adjustment module, for being adjusted according to the target size to selected graphic template.
In a kind of embodiment of the application, optionally, described device further include:
Template filter module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template, before generating at least one Target Photo, screening meets picture evaluation rule from multiple graphic templates
At least one described graphic template then.
In a kind of embodiment of the application, optionally, described device further include:
Picture cluster module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, carries out multiple pictures according at least one picture attribute
Cluster;
Template generation module is generated for extracting the identical picture attribute of all kinds of pictures according to the identical picture attribute
At least one described graphic template.
In a kind of embodiment of the application, optionally, described device further include:
Picture screening module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template after generating at least one Target Photo, screens from least one Target Photo of generation and meets
The Target Photo of picture evaluation rule.
In a kind of embodiment of the application, optionally, the adjustment includes content adjustment, size adjusting and position adjustment
At least one of.
According to the embodiment of the present application, data element placement rule and multiple target data elements by acquisition picture,
Element layout's rule, multiple target data elements and at least one graphic template based on the data, generate at least one mesh
Mark on a map piece so that when generating picture, overcome picture size and the ratio of width to height can not customized problem, avoid and be confined to
Limited several sizes are come the problem of generating picture, without being adjusted manually to the data element of picture, so that it may realize and appoint
The generation of the picture for size of anticipating, so that saving user makes computing resource and the working time consumed by picture.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
Embodiment of the disclosure can be implemented as using any suitable hardware, firmware, software, or and any combination thereof into
The system of the desired configuration of row.Figure 11, which is schematically shown, can be used for realizing showing for each embodiment described in the disclosure
Example property system (or device) 500.
For one embodiment, Figure 11 shows exemplary system 500, the system have one or more processors 502,
It is coupled to the system control module (chipset) 504 of at least one of (one or more) processor 502, is coupled to and be
The system storage 506 for control module 504 of uniting is coupled to the nonvolatile memory (NVM) of system control module 504/deposit
Storage equipment 508 is coupled to one or more input-output apparatus 510 of system control module 504, and is coupled to and is
The network interface 512 for control module 506 of uniting.
Processor 502 may include one or more single or multiple core processors, processor 502 may include general processor or
Any combination of application specific processor (such as graphics processor, application processor, Baseband processor etc.).In some embodiments,
System 500 can be as the browser described in the embodiment of the present application.
In some embodiments, system 500 may include with instruction one or more computer-readable mediums (for example,
System storage 506 or NVM/ store equipment 508) and mutually merge with the one or more computer-readable medium and be configured as
Execute instruction the one or more processors 502 to realize module thereby executing movement described in the disclosure.
For one embodiment, system control module 504 may include any suitable interface controller, with to (one or
It is multiple) at least one of processor 502 and/or any suitable equipment or component that communicate with system control module 504 mentions
For any suitable interface.
System control module 504 may include Memory Controller module, to provide interface to system storage 506.Storage
Device controller module can be hardware module, software module and/or firmware module.
System storage 506 can be used for for example, load of system 500 and storing data and/or instruction.For a reality
Example is applied, system storage 506 may include any suitable volatile memory, for example, DRAM appropriate.In some embodiments
In, system storage 506 may include four Synchronous Dynamic Random Access Memory of Double Data Rate type (DDR4SDRAM).
For one embodiment, system control module 504 may include one or more i/o controllers, with to
NVM/ stores equipment 508 and (one or more) input-output apparatus 510 provides interface.
For example, NVM/ storage equipment 508 can be used for storing data and/or instruction.NVM/ storage equipment 508 may include appointing
It anticipates nonvolatile memory appropriate (for example, flash memory) and/or to may include that any suitable (one or more) is non-volatile deposit
Equipment is stored up (for example, one or more hard disk drives (HDD), one or more CD (CD) drivers and/or one or more
Digital versatile disc (DVD) driver).
NVM/ storage equipment 508 may include a part for the equipment being physically mounted on as system 500
Storage resource or its can by the equipment access without a part as the equipment.For example, NVM/ storage equipment 508 can
It is accessed by network via (one or more) input-output apparatus 510.
(one or more) input-output apparatus 510 can be provided for system 500 interface with other any equipment appropriate
Communication, input-output apparatus 510 may include communication component, audio component, sensor module etc..Network interface 512 can be
System 500 provides interfaces with by one or more network communications, system 500 can according to one or more wireless network standards and/
Or arbitrary standards in agreement and/or agreement are carried out wireless communication with the one or more components of wireless network, such as are accessed
Wireless network based on communication standard, such as WiFi, 2G or 3G or their combination carry out wireless communication.
For one embodiment, at least one of (one or more) processor 502 can be with system control module 504
The logic of one or more controllers (for example, Memory Controller module) is packaged together.For one embodiment, (one
Or multiple) at least one of processor 502 can be encapsulated in the logic of one or more controllers of system control module 504
Together to form system in package (SiP).For one embodiment, at least one of (one or more) processor 502 can
It is integrated on same mold with the logic of one or more controllers of system control module 504.For one embodiment, (one
It is a or multiple) at least one of processor 502 can be integrated with the logic of one or more controllers of system control module 504
To form system on chip (SoC) on same mold.
In various embodiments, system 500 can be, but not limited to be: browser, work station, desk-top calculating equipment or movement
It calculates equipment (for example, lap-top computing devices, handheld computing device, tablet computer, net book etc.).In various embodiments,
System 500 can have more or fewer components and/or different frameworks.For example, in some embodiments, system 500 includes
One or more video cameras, keyboard, liquid crystal display (LCD) screen (including touch screen displays), nonvolatile memory port,
Mutiple antennas, graphic chips, specific integrated circuit (ASIC) and loudspeaker.
Wherein, if display includes touch panel, display screen may be implemented as touch screen displays, be used by oneself with receiving
The input signal at family.Touch panel includes one or more touch sensors to sense the hand on touch, slide, and touch panel
Gesture.The touch sensor can not only sense the boundary of a touch or slide action, but also detect and the touch or sliding
Operate relevant duration and pressure.
The embodiment of the present application also provides a kind of non-volatile readable storage medium, be stored in the storage medium one or
Multiple modules (programs) when the one or more module is used in terminal device, can make the terminal device execute
The instruction (instructions) of various method steps in the embodiment of the present application.
Provide a kind of computer equipment in one example, including memory, processor and storage are on a memory simultaneously
The computer program that can be run on a processor, which is characterized in that the processor is realized such as when executing the computer program
The method of the embodiment of the present application.
A kind of computer readable storage medium is additionally provided in one example, is stored thereon with computer program, it is special
Sign is, one or more methods such as the embodiment of the present application are realized when which is executed by processor.
The embodiment of the present application discloses the generation method and device of a kind of picture, and example 1 includes a kind of generation side of picture
Method, the picture include multiple data elements, which comprises
Obtain the data element placement rule for Target Photo and multiple target data elements;
Element layout's rule, multiple target data elements and at least one graphic template based on the data, generate extremely
A few Target Photo.
Example 2 includes method described in example 1, wherein described to obtain the data element placement rule for being used for Target Photo
And multiple target data elements include:
The reference picture that user submits is parsed, data element placement rule and multiple target data elements are obtained.
Example 3 includes method described in example 1 and/or 2, wherein the element layout based on the data is regular, multiple
Target data element and at least one graphic template, generating at least one Target Photo includes:
Adjustment is laid out to the data element in the graphic template using the data element placement rule, is generated extremely
A few Target Photo.
Example 4 may include method described in 3 one or more of example 1- example, wherein same class data element constitutes one
A data elements groups, the data element placement rule include following at least one: placement rule, institute between data elements groups
State the placement rule of each data element of data elements groups.
Example 5 may include method described in 4 one or more of example 1- example, wherein described to use the data element
Placement rule is laid out adjustment to the data element in the graphic template, generates at least one Target Photo and includes:
According to the placement rule of each data element of data elements groups in the data element placement rule, to each data element
Each data element is laid out adjustment in plain group;
According to the placement rule in the data element placement rule between data elements groups, each data elements groups are carried out
Distributing adjustment.
Example 6 may include method described in 5 one or more of example 1- example, wherein the data element placement rule
It further include the placement rule of the data element of type of service, it is described to use the data element placement rule to the graphic template
Interior data element is laid out adjustment, generates at least one Target Photo further include:
Increase the graphic template data element of type of service, or the number to the type of service in the graphic template
Adjustment is laid out according to element.
Example 7 may include method described in 6 one or more of example 1- example, wherein described to use the data element
Placement rule is laid out adjustment to the data element in the graphic template, generates at least one Target Photo further include:
Determine the display effect data of each data element;
It rejects the display effect data and does not meet the data element that setting display requires.
Example 8 may include method described in 7 one or more of example 1- example, wherein reject the display effect described
It is described to use the data element placement rule to the picture before fruit data do not meet the data element that setting display requires
Data element in template is laid out adjustment, generates at least one picture further include:
Determine the display weight of each data element;
The rejecting display effect data do not meet the data element that setting display requires
The display effect data, which are rejected, according to the display weight does not meet the data element that setting display requires.
Example 9 may include method described in 8 one or more of example 1- example, wherein the method also includes:
Obtain at least one target size of Target Photo;
In the element layout based on the data rule, multiple target data elements and at least one graphic template,
Before generating at least one Target Photo, the method also includes:
Graphic template is chosen according to the target size;
Selected graphic template is adjusted according to the target size.
Example 10 may include method described in 9 one or more of example 1- example, wherein described first based on the data
Plain placement rule, multiple target data elements and at least one graphic template, it is described before generating at least one Target Photo
Method further include:
Screening meets at least one graphic template described in picture evaluation rule from multiple graphic templates.
Example 11 may include method described in 10 one or more of example 1- example, wherein it is described based on the data
Element layout's rule, multiple target data elements and at least one graphic template, before generating at least one Target Photo, institute
State method further include:
Multiple pictures are clustered according at least one picture attribute;
The identical picture attribute for extracting all kinds of pictures generates at least one described picture mould according to the identical picture attribute
Plate.
Example 12 may include method described in 11 one or more of example 1- example, wherein it is described based on the data
Element layout's rule, multiple target data elements and at least one graphic template, after generating at least one Target Photo, institute
State method further include:
Screening meets the Target Photo of picture evaluation rule from least one Target Photo of generation.
Example 13 may include method described in 12 one or more of example 1- example, wherein the adjustment includes content tune
At least one of whole, size adjusting and position adjustment.
Example 14 includes a kind of generating means of picture, and the picture includes multiple data elements, and described device includes:
Module is obtained, for obtaining the data element placement rule for being used for Target Photo and multiple target data elements;
Image generating module, for the rule of element layout based on the data, multiple target data elements and at least one
A graphic template generates at least one Target Photo.
Example 15 includes method described in example 14, wherein the acquisition module includes:
Picture analyzing sub-module obtains data element placement rule and more for parsing the reference picture of user's submission
A target data element.
Example 16 includes method described in example 14 and/or 15, wherein the image generating module includes:
Picture generates submodule, for using the data element placement rule to the data element in the graphic template
It is laid out adjustment, generates at least one Target Photo.
Example 17 may include method described in 16 one or more of example 14- example, wherein same class data element is constituted
One data elements groups, the data element placement rule include following at least one: placement rule between data elements groups,
The placement rule of each data element of the data elements groups.
Example 18 may include method described in 17 one or more of example 14- example, wherein the picture generates submodule
Include:
Element adjustment unit, for the cloth according to each data element of data elements groups in the data element placement rule
Office's rule, is laid out adjustment to each data element in each data elements groups;
Element group adjustment unit, for being advised according to the layout in the data element placement rule between data elements groups
Then, adjustment is laid out to each data elements groups.
Example 19 may include method described in 18 one or more of example 14- example, wherein the data element layout rule
It then further include the placement rule of the data element of type of service, the picture generates submodule further include:
Layout adjusting unit, for the data element to graphic template increase type of service, or to the picture mould
The data element of type of service in plate is laid out adjustment.
Example 20 may include method described in 19 one or more of example 14- example, wherein the picture generates submodule
Further include:
Data determination unit, for determining the display effect data of each data element;
Element culling unit does not meet the data element that setting display requires for rejecting the display effect data.
Example 21 may include method described in 20 one or more of example 14- example, wherein the picture generates submodule
Further include:
Weight determining unit, in the data element rejected the display effect data and do not meet setting display requirement
Before element, the display weight of each data element is determined;
The element culling unit includes:
Element rejects subelement, does not meet setting display for rejecting the display effect data according to the display weight
It is required that data element.
Example 22 may include method described in 21 one or more of example 14- example, wherein described device further include:
Dimension acquisition module, for obtaining at least one target size of Target Photo;
Described device further include:
Template chooses module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, chooses graphic template according to the target size;
Target adjustment module, for being adjusted according to the target size to selected graphic template.
Example 23 may include method described in 22 one or more of example 14- example, wherein described device further include:
Template filter module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template, before generating at least one Target Photo, screening meets picture evaluation rule from multiple graphic templates
At least one described graphic template then.
Example 24 may include method described in 23 one or more of example 14- example, wherein described device further include:
Picture cluster module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template before generating at least one Target Photo, carries out multiple pictures according at least one picture attribute
Cluster;
Template generation module is generated for extracting the identical picture attribute of all kinds of pictures according to the identical picture attribute
At least one described graphic template.
Example 25 may include method described in 24 one or more of example 14- example, wherein described device further include:
Picture screening module, for the element layout based on the data rule, multiple target data elements and
At least one graphic template after generating at least one Target Photo, screens from least one Target Photo of generation and meets
The Target Photo of picture evaluation rule.
Example 26 may include method described in 25 one or more of example 14- example, wherein the adjustment includes content tune
At least one of whole, size adjusting and position adjustment.
Example 27 includes a kind of computer equipment, including memory, processor and storage on a memory and can handled
The computer program run on device, which is characterized in that realized when the processor executes the computer program as example 1- shows
The one or more method of example 13.
Example 28 includes a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the journey
As one or more methods such as example 1- example 13 is realized when sequence is executed by processor.
Although some embodiments are various substitutions, and/or equivalent implementation for the purpose of illustrating and describing
Scheme calculates to reach same purpose and implement the realization for exemplifying and describing, and does not depart from the practical range of the application.This Shen
It please be intended to cover any modification or variation of the embodiment being discussed herein.It is, therefore, apparent that embodiment described herein only by right
It is required that being limited with their equivalent.