Summary of the invention
Fundamental purpose of the present invention is to provide a kind of picture to add the method and apparatus of watermark, to solve the problem for operation more complicated during picture interpolation watermark.
To achieve these goals, according to an aspect of the present invention, a kind of method that picture adds watermark is provided.The method of adding watermark according to picture of the present invention comprises: obtain pending picture and watermark data; Judge whether to receive the parameter of pending picture being added to watermark; If do not receive the parameter of pending picture being added to watermark, then call the first default parameters, and according to the first default parameters, watermark data is added on pending picture; If receive the parameter of pending picture being added to watermark, then judge whether the parameter received is the whole parameters processed pending picture, wherein, when the parameter judging to receive is the whole parameter processed pending picture, according to the parameter received, watermark data is added in pending picture; When the parameter judging to receive is the partial parameters processed pending picture, then parameter call second default parameters for not receiving, utilizes partial parameters and the second default parameters to be added in pending picture by watermark data.
Further, before judging whether to receive the parameter to pending picture interpolation watermark, method also comprises: judge that watermark data is text watermark data or picture watermark data; When watermark data is text watermark data, send the first information that the word attribute parameter of text watermark and the location parameter of text watermark are set, and receive the first interpolation parameter of response first information; When watermark data is picture watermark data, send the second information that the picture attribute parameter of picture watermark and the location parameter of picture watermark are set, and receive the second interpolation parameter of response second information.
Further, when the parameter judging to receive is the partial parameters processed pending picture, parameter call second default parameters then for not receiving, utilizes partial parameters and the second default parameters watermark data to be added to pending picture and comprises: the 3rd default parameters obtaining the location parameter of word attribute parameter and text watermark; Judge whether the 3rd default parameters is modified; If the 3rd default parameters is modified, then the parameter be modified in the 3rd default parameters adds parameter as first, and the parameter be not modified in the 3rd default parameters is as the second default parameters; And utilize the first interpolation parameter and the second default parameters to be added in pending picture by text watermark.
Further, when the parameter judging to receive is the partial parameters processed pending picture, parameter call second default parameters then for not receiving, utilizes partial parameters and the second default parameters watermark data to be added to pending picture and comprises:
Obtain the 4th default parameters of the location parameter of picture attribute parameter and picture watermark;
Judge whether the 4th default parameters is modified; If the 4th default parameters is modified, then the parameter be modified in the 4th default parameters adds parameter as second, and the parameter be not modified in the 4th default parameters is as the second default parameters; And utilize the second interpolation parameter and the second default parameters picture watermark to be added in pending picture.
Further, after receiving the parameter to pending picture interpolation watermark, method also comprises: whether prompting will add parameter that watermark adopts and save as the instruction of custom parameter template to pending picture, wherein, the parameter adopted comprises partial parameters and the second default parameters, or all parameter saves as custom parameter template; If receive the instruction parameter of employing being saved as custom parameter template, be then obtained from the preservation title of defined parameters template; According to preservation title, the parameter of employing is saved as custom parameter template, wherein, when again adding watermark data to pending picture, calling custom parameter template and to utilize the parameter in custom parameter template, watermark data being added in pending picture.
Further, the first default parameters and the second default parameters are all or part of parameter in parameter preset template, and wherein, parameter preset template is non-custom parameter template.
Further, before judging whether to receive the parameter to pending picture interpolation watermark, method also comprises: the stored position information receiving the picture after the process obtained after adding watermark data to pending picture.
To achieve these goals, according to a further aspect in the invention, the device that a kind of picture adds watermark is provided.The device adding watermark according to picture of the present invention comprises: the first acquiring unit, for obtaining pending picture and watermark data; First judging unit, receives the parameter of described pending picture being added to watermark for judging whether; Adding device, for when not receiving the parameter to described pending picture interpolation watermark, calling the first default parameters, and adding on described pending picture according to described first default parameters by described watermark data; Second judging unit, for when receiving the parameter to described pending picture interpolation watermark, judge whether the parameter received is the whole parameters processed described pending picture, wherein, described second judging unit comprises the first interpolation module, during for being the whole parameter processed described pending picture in the parameter judging to receive, according to the parameter received, described watermark data is added in described pending picture; Second adds module, during for being the partial parameters processed described pending picture in the parameter judging to receive, parameter call second default parameters then for not receiving, utilizes described partial parameters and described second default parameters to be added in described pending picture by described watermark data.
Further, described device also comprises: the 3rd judging unit, for before judging whether to receive the parameter to described pending picture interpolation watermark, judges that described watermark data is text watermark data or picture watermark data; First Tip element, for when described watermark data is described text watermark data, send the first information that the word attribute parameter of text watermark and the location parameter of described text watermark are set, and receive the first interpolation parameter of described first information of response; Second Tip element, for when described watermark data is described picture watermark data, send the second information of the location parameter of picture attribute parameter and the described picture watermark that picture watermark is set, and receive the second interpolation parameter of described second information of response.
Further, described adding device comprises: the first acquisition module, for obtaining the 3rd default parameters of the location parameter of described word attribute parameter and described text watermark; First judge module, for judging whether described 3rd default parameters is modified; First determination module, for when described 3rd default parameters is modified, the parameter be modified in described 3rd default parameters adds parameter as described first, and the parameter be not modified in described 3rd default parameters is as described second default parameters; And the 3rd adds module, for utilizing described first interpolation parameter and described second default parameters, described text watermark is added in described pending picture.
Further, described adding device comprises: the second acquisition module, for obtaining the 4th default parameters of the location parameter of described picture attribute parameter and described picture watermark; Second judge module, for judging whether described 4th default parameters is modified; Second determination module, for when described 4th default parameters is modified, the parameter be modified in described 4th default parameters is added parameter as described second, and the parameter be not modified in described 4th default parameters is as described second default parameters; And the 3rd adds module, for utilizing described second interpolation parameter and described second default parameters, described picture watermark is added in described pending picture.
Further, described device also comprises: the 3rd Tip element, for after receiving the parameter to described pending picture interpolation watermark, whether prompting will add parameter that watermark adopts and save as the instruction of custom parameter template to described pending picture, wherein, the parameter of described employing comprises described partial parameters and described second default parameters, or described whole parameter saves as custom parameter template; Second acquisition unit, for receiving the instruction parameter of described employing being saved as described custom parameter template, is then obtaining the preservation title of described custom parameter template; Storage unit, for the parameter of described employing being saved as described custom parameter template according to described preservation title, wherein, when again adding watermark data to described pending picture, calling described custom parameter template and to utilize the parameter in described custom parameter template, described watermark data being added in described pending picture.
Further, described device also comprises: receiving element, for before judging whether to receive the parameter to described pending picture interpolation watermark, receive the stored position information of the picture after the process obtained after described watermark data is added to described pending picture.
Pass through the present invention, when adding watermark data to pending picture, if receive the parameter of user, the parameter then utilizing user to provide adds watermark data to pending picture, if do not receive the parameter of user, the first default parameters pre-set then is utilized to be added to by watermark data on pending picture, wherein, when the parameter received is not enough to watermark data to add on pending picture, for parameter call second parameter do not received, watermark data adds in pending picture by the parameter that utilization receives and the second parameter, that is, when parameter required for being added to by watermark data on pending picture is not received, utilize default parameters to add watermark, thus do not receive parameter or the parameter that receives not full-time, can both be that pending picture adds watermark, and then avoid parameter is arranged one by one, reach and be reduced to the effect that picture adds the complexity of the operation of watermark.
Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in instructions of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged in the appropriate case, so as embodiments of the invention described herein can with except here diagram or describe those except order implement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Embodiments provide a kind of method that picture adds watermark.
Fig. 1 is the process flow diagram adding the method for watermark according to the picture of the embodiment of the present invention.As shown in the figure, the method for this picture interpolation watermark comprises the steps:
Step S102, obtains pending picture and watermark data.
Step S104, judges whether to receive the parameter of pending picture being added to watermark.
Step S106, if do not receive the parameter of pending picture being added to watermark, then calls the first default parameters, and is added on pending picture by watermark data according to the first default parameters.
Step S108, if receive the parameter of pending picture being added to watermark, then judges whether the parameter received is the whole parameters processed pending picture.
Watermark data, when the parameter judging to receive is the whole parameter processed pending picture, adds in pending picture according to the parameter received by step S110.
Step S112, when the parameter judging to receive is the partial parameters processed pending picture, then parameter call second default parameters for not receiving, utilizes partial parameters and the second default parameters to be added in pending picture by watermark data.
When adding watermark data to pending picture, if receive the parameter of user, the parameter then utilizing user to provide adds watermark data to pending picture, if do not receive the parameter of user, the first default parameters pre-set then is utilized to be added to by watermark data on pending picture, wherein, when the parameter received is not enough to watermark data to add on pending picture, for parameter call second parameter do not received, watermark data adds in pending picture by the parameter that utilization receives and the second parameter, that is, when parameter required for being added to by watermark data on pending picture is not received, utilize default parameters to add watermark, thus do not receive parameter or the parameter that receives not full-time, can both be that pending picture adds watermark, and then avoid parameter is arranged one by one, reach and be reduced to the effect that picture adds the complexity of the operation of watermark.
Before judging whether to receive the parameter to pending picture interpolation watermark, receive the stored position information of the picture after the process obtained after watermark data is added to pending picture.Just stored position information was received before watermark data is added to pending picture, after obtaining the picture after processing, can directly according to the picture after stored position information specimens preserving, thus avoid the prompting again sending input stored position information, simplify the operation steps of adding picture watermark, also improve Consumer's Experience simultaneously.
Particularly, watermark data comprises text watermark data and picture watermark data.Text watermark data are exactly the data of the text watermark for picture interpolation, and picture watermark data is exactly the data of the picture watermark for picture interpolation.Determine that the watermark data received is text watermark data or picture watermark data by the mark receiving watermark data.Such as, picture watermark data carries the prefix of keyword: Model_PW_ is self-defined, and text watermark data carry the prefix of keyword: Model_TW_ is self-defined.
Alternatively, before judging whether to receive the parameter to pending picture interpolation watermark, the method also comprises: judge that watermark data is text watermark data or picture watermark data.When watermark data is text watermark data, send the first information that the word attribute parameter of text watermark and the location parameter of text watermark are set, and receive the first interpolation parameter of response first information.When watermark data is picture watermark data, send the second information that the picture attribute parameter of picture watermark and the location parameter of picture watermark are set, and receive the second interpolation parameter of response second information.
Because watermark data comprises text watermark data and picture watermark data, and it is different with the parameter required for picture watermark data to add text watermark data, then need first to judge that watermark data is text watermark data or picture watermark data, and corresponding parameter is set according to judged result prompting.Text watermark data are sent to the first information that the word attribute parameter of text watermark, the location parameter of text watermark are set, picture watermark data is sent to the second information that the picture attribute parameter of picture watermark, the location parameter of picture watermark are set.
Text watermark parameter comprises: watermark word, character script (as refined in black matrix, the Song typeface, regular script, Microsoft black etc.), text color (can color code, as blue #000off#).The location parameter of text watermark comprises: the nine grids position (1-9) of text watermark, the side-play amount of text watermark.Wherein, the nine grids position of text watermark is the nine grids position of pending picture, as shown in Figure 2.The side-play amount of text watermark is the amount of text watermark skew nine grids, and the location parameter of the text watermark added in parameter by first determines the position of the watermark of interpolation, is determined the pattern of the watermark of interpolation by the first text watermark parameter of adding in parameter.
Picture watermark parameters comprises: the address of watermark picture, the transparency etc. of watermark picture.The location parameter of picture watermark comprises: the nine grids position of picture watermark and the side-play amount of picture watermark.Similarly, the location parameter of the picture watermark added in parameter by second determines the position of the watermark of interpolation, is determined the pattern of the watermark of interpolation by the second picture watermark parameters of adding in parameter.
Below respectively interpolation text watermark and picture watermark are described.
Add text watermark:
Alternatively, when the parameter judging to receive is the partial parameters processed pending picture, parameter call second default parameters then for not receiving, utilizes partial parameters and the second default parameters watermark data to be added to pending picture and comprises: the 3rd default parameters obtaining the location parameter of word attribute parameter and text watermark.Judge whether the 3rd default parameters is modified.If the 3rd default parameters is modified, then the parameter be modified in the 3rd default parameters adds parameter as first, and the parameter be not modified in the 3rd default parameters is as the second default parameters.And utilize the first interpolation parameter and the second default parameters to be added in pending picture by text watermark.
Before sending first information of location parameter of word attribute parameter and the text watermark that text watermark is set, and after receive response first information first adds parameter, obtain the 3rd default parameters pre-set, 3rd default parameters comprises whole parameters of adding text watermark, if the parameter of receiving, the parameter received can be utilized to carry out the interpolation of text watermark, if do not receive parameter, then utilize the 3rd default parameters also can add text watermark.Such as, 3rd default parameters comprise watermark word for " maintaining secrecy ", character script be black matrix, text color is blueness, the nine grids position of text watermark is 5, side-play amount is x/50/y/0, then according to the 3rd default parameters " maintaining secrecy " is 5 according to the nine grids that the style setting of blue black matrix is pending picture and side-play amount is the position of x/50/y/0.
If the 3rd default parameters is modified, namely the first interpolation parameter is received, such as, the the first interpolation parameter received is character script " Microsoft is refined black ", text color is black, then " maintaining secrecy " is 5 according to the nine grids that black, the refined black style setting of Microsoft are pending picture and side-play amount is the position of x/50/y/0.That is, when the 3rd default parameters is modified, the parameter be modified is the first interpolation parameter, and the parameter be not modified is the second default parameters, utilizes the first interpolation parameter and the second default parameters to be added in pending picture by watermark word.
Batch for the ease of watermark word adds, first interpolation parameter and the second default parameters are saved as the first parameterized template, when needing to add the watermark word of same pattern in the same position of multiple pending picture, directly call the first parameterized template, the parameter of the first parameterized template is utilized to add watermark word, avoid parameters one by one, not only reduce the complexity of adding water mark operation, the efficiency of adding text watermark can also be improved.
Add picture watermark:
Alternatively, when the parameter judging to receive is the partial parameters processed pending picture, parameter call second default parameters then for not receiving, utilizes partial parameters and the second default parameters watermark data to be added to pending picture and comprises: the 4th default parameters obtaining the location parameter of picture attribute parameter and picture watermark.Judge whether the 4th default parameters is modified.If the 4th default parameters is modified, then the parameter be modified in the 4th default parameters adds parameter as second, and the parameter be not modified in the 4th default parameters is as the second default parameters.And utilize the first interpolation parameter and the second default parameters to be added in pending picture by text watermark.
Before sending first information of location parameter of word attribute parameter and the text watermark that text watermark is set, and after receive response first information first adds parameter, obtain the 4th default parameters pre-set, 4th default parameters comprises whole parameters of adding picture watermark, if the parameter of receiving, the parameter received can be utilized to carry out the interpolation of picture watermark, if do not receive parameter, then utilize the 4th default parameters also can add text watermark.Such as, 4th default parameters comprises that watermark picture is rabbit picture, the transparency of picture is 80%, the nine grids position of picture watermark is 9, side-play amount is x/50/y/0, then according to the 4th default parameters rabbit picture is 9 according to the nine grids that the style setting of transparency 80% is pending picture and side-play amount is the position of x/50/y/0.
If the 4th default parameters is modified, namely receive the second interpolation parameter, such as, receive second to add parameter be that rabbit picture is 5 and side-play amount is the position of x/50/y/0 according to the style setting of transparency 80% in the nine grids of pending picture.That is, when the 4th default parameters is modified, the parameter be modified is the second interpolation parameter, and the parameter be not modified is the second default parameters, utilizes the second interpolation parameter and the second default parameters to be added in pending picture by watermark picture.
Batch for the ease of watermark picture adds, the parameter that can receive and the parameter called save as custom parameter template, so that directly call this custom parameter template when carrying out the interpolation of same watermark data, avoid repeating to arrange the parameter of adding watermark data.Particularly, whether prompting will add parameter that watermark adopts and save as the instruction of custom parameter template to pending picture, wherein, the parameter of employing comprises partial parameters and the second default parameters, or all parameter saves as custom parameter template; If receive the instruction parameter of employing being saved as custom parameter template, be then obtained from the preservation title of defined parameters template; According to preservation title, the parameter of employing is saved as custom parameter template, wherein, when again adding watermark data to pending picture, calling custom parameter template and to utilize the parameter in custom parameter template, watermark data being added in pending picture.
If utilize the whole parameters received to be added to by watermark data in pending picture, then whole parameter is saved as custom parameter template, if adopt partial parameters and the second default parameters to be added to by watermark data in pending picture, then partial parameters and the second default parameters are saved as custom parameter template, multiple self-defined template can be distinguished for self-defined template arranges preservation title.When needing to add the watermark picture of same pattern in the same position of multiple pending picture, such as, when the logo of interpolation company is on multiple pending picture, can directly call custom parameter template, the parameter of custom parameter template is utilized to add watermark data, avoid as parameters one by one when each pending picture adds watermark data, and the custom parameter template of needs can be found rapidly by preserving title, not only reduce the complexity of adding water mark operation, the efficiency of adding text watermark can also be improved.
Such as: picture watermark is added to certain pictures
Require: watermark picture address http://misc.360buyimg.com/lib/img/e/logo-201305.png, transparency: 50, lower right, position: 9, watermark side-play amount: x/10/y/10.
Prompting user arranges Key and is: Model_PW_style1, the name of the custom parameter template namely stored is called Model_PW_style1.Parameter for custom parameter template-setup is:
url/http://misc.360buyimg.com/lib/img/e/logo-201305.png/transparency/50/location/9/x/10/y/10
Wherein, url/http: //misc.360buyimg.com/lib/img/e/logo-201305.png is the address of watermark picture, and transparency/50 is transparency, and location/9/x/10/y/10 is nine grids position is 9, and side-play amount is x/10/y/10.
When needs reuse this custom parameter template interpolation watermark data, directly can call name and be called that the template of Model_PW_style1 carries out the interpolation of watermark data.
Such as: text watermark is added to certain pictures
Require: watermark word: study hard, font: black matrix, color: blue, nine grids position: the lower right corner, side-play amount: x/10y/10
Prompting user arranges Key and is: Model_TW_style1, the name of the first parameterized template namely stored is called Model_TW_style1.The parameter arranged for the first parameterized template is:
Text/ studies hard/font/ black matrix/color/#0000ff/location/9/x/10/y/10
Wherein, text/ studies hard as watermark word is " studying hard ", and font/ black matrix is character script is black, and color/#0000ff is text color is blue, location/9/x/10/y/10 is the point of addition of watermark word is 9 of nine grids, and side-play amount is x/10/y/10.
When the identical picture of process or when adopting identical parameter, directly can call Model_TW_style1, directly to utilize the parameter in Model_TW_style1, pending picture be processed.
After the preservation position of the picture namely after the title and process of the acquisition address of pending picture, the template of employing, automatically can carry out to pending picture the process adding watermark, and the picture after specimens preserving is to assigned address.Simple parameter just can be used to replace complicated parameter logistics by a configuration file like this, simply, efficiently as requested picture and text watermark process be carried out to picture.As long as particularly facilitate the address of the picture behind the address and specimens preserving of revising pending picture just passable when especially making same treatment to a collection of picture, reduce the complexity of operation, thus improve the efficiency of adding watermark data.
In addition, the first default parameters and the second default parameters are all or part of parameter in parameter preset template, and wherein, parameter preset template is non-custom parameter template.
Because custom parameter template comprises the parameter artificially revised, when calling the parameter in custom parameter template and being pending picture interpolation watermark data as the first default parameters or the second default parameters, the watermark data mistake of adding may be caused, therefore, first default parameters and the second default parameters are the parameter in parameter preset template, and parameter preset template is the template pre-set, instead of custom parameter template.It should be noted that, here the first default parameters and the second default parameters can be whole parameter in parameter preset template or partial parameters, if do not receive parameter, the whole parameters in parameter preset template can be called, if the parameter of have received, so can select the parameter do not received from parameter preset template, coordinate the parameter received to add watermark data to pending picture.
The embodiment of the present invention additionally provides the device that a kind of picture adds watermark.The device that the picture that the method that the picture of the embodiment of the present invention adds watermark can be provided by the embodiment of the present invention adds watermark performs, and the picture that the device that the picture of the embodiment of the present invention adds watermark also may be used for performing the embodiment of the present invention and provides adds the method for watermark.
Fig. 3 is the schematic diagram adding the device of watermark according to the picture of the embodiment of the present invention.As shown in the figure, the device of this picture interpolation watermark comprises: the first acquiring unit 10, first judging unit 20, adding device 30 and the second judging unit 40.
First acquiring unit 10 is for obtaining pending picture and watermark data;
First judging unit 20 receives the parameter of pending picture being added to watermark for judging whether;
Adding device 30, for when not receiving the parameter to pending picture interpolation watermark, calling the first default parameters, and adding on pending picture according to the first default parameters by watermark data;
Second judging unit 40 is for when receiving the parameter to pending picture interpolation watermark, judge whether the parameter received is the whole parameters processed pending picture, wherein, second judging unit comprises the first interpolation module, during for being the whole parameter processed pending picture in the parameter judging to receive, according to the parameter received, watermark data is added in pending picture; Second adds module, during for being the partial parameters processed pending picture in the parameter judging to receive, parameter call second default parameters then for not receiving, utilizes partial parameters and the second default parameters to be added in pending picture by watermark data.
When adding watermark data to pending picture, if receive the parameter of user, the parameter then utilizing user to provide adds watermark data to pending picture, if do not receive the parameter of user, the first default parameters pre-set then is utilized to be added to by watermark data on pending picture, wherein, when the parameter received is not enough to watermark data to add on pending picture, for parameter call second parameter do not received, watermark data adds in pending picture by the parameter that utilization receives and the second parameter, that is, when parameter required for being added to by watermark data on pending picture is not received, utilize default parameters to add watermark, thus do not receive parameter or the parameter that receives not full-time, can both be that pending picture adds watermark, and then avoid parameter is arranged one by one, reach and be reduced to the effect that picture adds the complexity of the operation of watermark.
Particularly, watermark data comprises text watermark data and picture watermark data.Text watermark data are exactly the data of the text watermark for picture interpolation, and picture watermark data is exactly the data of the picture watermark for picture interpolation.Determine that the watermark data received is text watermark data or picture watermark data by the mark receiving watermark data.Such as, picture watermark data carries the prefix of keyword: Model_PW_ is self-defined, and text watermark data carry the prefix of keyword: Model_TW_ is self-defined.
Alternatively, the 3rd judging unit, for before judging whether to receive the parameter to pending picture interpolation watermark, judges that watermark data is text watermark data or picture watermark data; First Tip element, for when watermark data is text watermark data, sends the first information arranging the word attribute parameter of text watermark and the location parameter of text watermark, and receives the first interpolation parameter of response first information; Second Tip element, for when watermark data is picture watermark data, sends the second information arranging the picture attribute parameter of picture watermark and the location parameter of picture watermark, and receives the second interpolation parameter of response second information.
Because watermark data comprises text watermark data and picture watermark data, and it is different with the parameter required for picture watermark data to add text watermark data, then need first to judge that watermark data is text watermark data or picture watermark data, and corresponding parameter is set according to judged result prompting.Text watermark data are sent to the first information that the word attribute parameter of text watermark, the location parameter of text watermark are set, picture watermark data is sent to the second information that the picture attribute parameter of picture watermark, the location parameter of picture watermark are set.
Text watermark parameter comprises: watermark word, character script (as refined in black matrix, the Song typeface, regular script, Microsoft black etc.), text color (can color code, as blue #000off#).The location parameter of text watermark comprises: the nine grids position (1-9) of text watermark, the side-play amount of text watermark.Wherein, the nine grids position of text watermark is the nine grids position of pending picture, as shown in Figure 2.The side-play amount of text watermark is the amount of text watermark skew nine grids, and the location parameter of the text watermark added in parameter by first determines the position of the watermark of interpolation, is determined the pattern of the watermark of interpolation by the first text watermark parameter of adding in parameter.
Picture watermark parameters comprises: the address of watermark picture, the transparency etc. of watermark picture.The location parameter of picture watermark comprises: the nine grids position of picture watermark and the side-play amount of picture watermark.Similarly, the location parameter of the picture watermark added in parameter by second determines the position of the watermark of interpolation, is determined the pattern of the watermark of interpolation by the second picture watermark parameters of adding in parameter.
Below respectively interpolation text watermark and picture watermark are described.
Add text watermark:
Call adding device and add text watermark, wherein, adding device comprises: the first acquisition module, for obtaining the 3rd default parameters of the location parameter of word attribute parameter and text watermark; First judge module, for judging whether the 3rd default parameters is modified; First determination module, for when the 3rd default parameters is modified, the parameter be modified in the 3rd default parameters adds parameter as first, and the parameter be not modified in the 3rd default parameters is as the second default parameters; And the 3rd adds module, is added in pending picture by text watermark for utilizing the first interpolation parameter and the second default parameters.
Before sending first information of location parameter of word attribute parameter and the text watermark that text watermark is set, and after receive response first information first adds parameter, obtain the 3rd default parameters pre-set, 3rd default parameters comprises whole parameters of adding text watermark, if the parameter of receiving, the parameter received can be utilized to carry out the interpolation of text watermark, if do not receive parameter, then utilize the 3rd default parameters also can add text watermark.Such as, 3rd default parameters comprise watermark word for " maintaining secrecy ", character script be black matrix, text color is blueness, the nine grids position of text watermark is 5, side-play amount is x/50/y/0, then according to the 3rd default parameters " maintaining secrecy " is 5 according to the nine grids that the style setting of blue black matrix is pending picture and side-play amount is the position of x/50/y/0.
If the 3rd default parameters is modified, namely the first interpolation parameter is received, such as, the the first interpolation parameter received is character script " Microsoft is refined black ", text color is black, then " maintaining secrecy " is 5 according to the nine grids that black, the refined black style setting of Microsoft are pending picture and side-play amount is the position of x/50/y/0.That is, when the 3rd default parameters is modified, the parameter be modified is the first interpolation parameter, and the parameter be not modified is the second default parameters, utilizes the first interpolation parameter and the second default parameters to be added in pending picture by watermark word.
Batch for the ease of watermark word adds, first interpolation parameter and the second default parameters are saved as the first parameterized template, when needing to add the watermark word of same pattern in the same position of multiple pending picture, directly call the first parameterized template, the parameter of the first parameterized template is utilized to add watermark word, avoid parameters one by one, not only reduce the complexity of adding water mark operation, the efficiency of adding text watermark can also be improved.
Add picture watermark:
Call adding device and add picture watermark, wherein, adding device comprises: the second acquisition module, for obtaining the 4th default parameters of the location parameter of picture attribute parameter and picture watermark; Second judge module, for judging whether the 4th default parameters is modified; Second determination module, for when the 4th default parameters is modified, the parameter be modified in the 4th default parameters is added parameter as second, and the parameter be not modified in the 4th default parameters is as the second default parameters; And the 3rd adds module, is added in pending picture by text watermark for utilizing the first interpolation parameter and the second default parameters.
Before sending first information of location parameter of word attribute parameter and the text watermark that text watermark is set, and after receive response first information first adds parameter, obtain the 4th default parameters pre-set, 4th default parameters comprises whole parameters of adding picture watermark, if the parameter of receiving, the parameter received can be utilized to carry out the interpolation of picture watermark, if do not receive parameter, then utilize the 4th default parameters also can add text watermark.Such as, 4th default parameters comprises that watermark picture is rabbit picture, the transparency of picture is 80%, the nine grids position of picture watermark is 9, side-play amount is x/50/y/0, then according to the 4th default parameters rabbit picture is 9 according to the nine grids that the style setting of transparency 80% is pending picture and side-play amount is the position of x/50/y/0.
If the 4th default parameters is modified, namely receive the second interpolation parameter, such as, receive second to add parameter be that rabbit picture is 5 and side-play amount is the position of x/50/y/0 according to the style setting of transparency 80% in the nine grids of pending picture.That is, when the 4th default parameters is modified, the parameter be modified is the second interpolation parameter, and the parameter be not modified is the second default parameters, utilizes the second interpolation parameter and the second default parameters to be added in pending picture by watermark picture.
Batch for the ease of watermark picture adds, the parameter that can receive and the parameter called save as custom parameter template, so that directly call this custom parameter template when carrying out the interpolation of same watermark data, avoid repeating to arrange the parameter of adding watermark data.Particularly, this device also comprises: the 3rd Tip element, for after receiving the parameter to pending picture interpolation watermark, whether prompting will add parameter that watermark adopts and save as the instruction of custom parameter template to pending picture, wherein, the parameter adopted comprises partial parameters and the second default parameters, or all parameter saves as custom parameter template; Second acquisition unit, for receive the parameter of employing is saved as the instruction of custom parameter template time, be obtained from the preservation title of defined parameters template; Storage unit, for the parameter of employing being saved as custom parameter template according to preservation title, wherein, when again adding watermark data to pending picture, calling custom parameter template and to utilize the parameter in custom parameter template, watermark data being added in pending picture.
If utilize the whole parameters received to be added to by watermark data in pending picture, then whole parameter is saved as custom parameter template, if adopt partial parameters and the second default parameters to be added to by watermark data in pending picture, then partial parameters and the second default parameters are saved as custom parameter template, multiple self-defined template can be distinguished for self-defined template arranges preservation title.When needing to add the watermark picture of same pattern in the same position of multiple pending picture, such as, when the logo of interpolation company is on multiple pending picture, directly call custom parameter template, the parameter of custom parameter template is utilized to add watermark data, avoid, for parameters one by one when each pending picture adds watermark data, not only reducing the complexity of adding water mark operation, the efficiency of adding text watermark can also being improved.
Such as: picture watermark is added to certain pictures
Require: watermark picture address http://misc.360buyimg.com/lib/img/e/logo-201305.png, transparency: 50, lower right, position: 9, watermark side-play amount: x/10/y/10.
Prompting user arranges Key and is: Model_PW_style1, the name of the custom parameter template namely stored is called Model_PW_style1.Parameter for custom parameter template-setup is:
url/http://misc.360buyimg.com/lib/img/e/logo-201305.png/transparency/50/location/9/x/10/y/10
Wherein, url/http: //misc.360buyimg.com/lib/img/e/logo-201305.png is the address of watermark picture, and transparency/50 is transparency, and location/9/x/10/y/10 is nine grids position is 9, and side-play amount is x/10/y/10.
When needs reuse this custom parameter template interpolation watermark data, directly can call name and be called that the template of Model_PW_style1 carries out the interpolation of watermark data.
Such as: text watermark is added to certain pictures
Require: watermark word: study hard, font: black matrix, color: blue, nine grids position: the lower right corner, side-play amount: x/10y/10
Prompting user arranges Key and is: Model_TW_style1, the name of the first parameterized template namely stored is called Model_TW_style1.The parameter arranged for the first parameterized template is:
Text/ studies hard/font/ black matrix/color/#0000ff/location/9/x/10/y/10
Wherein, text/ studies hard as watermark word is " studying hard ", and font/ black matrix is character script is black, and color/#0000ff is text color is blue, location/9/x/10/y/10 is the point of addition of watermark word is 9 of nine grids, and side-play amount is x/10/y/10.
When the identical picture of process or when adopting identical parameter, directly can call Model_TW_style1, directly to utilize the parameter in Model_TW_style1, pending picture be processed.
After the preservation position of the picture namely after the title and process of the acquisition address of pending picture, the template of employing, automatically can carry out to pending picture the process adding watermark, and the picture after specimens preserving is to assigned address.Simple parameter just can be used to replace complicated parameter logistics by a configuration file like this, simply, efficiently as requested picture and text watermark process be carried out to picture.As long as particularly facilitate the address of the picture behind the address and specimens preserving of revising pending picture just passable when especially making same treatment to a collection of picture, reduce the complexity of operation, thus improve the efficiency of adding watermark data.
In the above-described embodiments, device also comprises: receiving element, for before judging whether to receive the parameter to pending picture interpolation watermark, receives the stored position information of the picture after the process obtained after adding watermark data to pending picture.
Set the stored position information of the picture after process in advance, can picture easily after stores processor after watermark is added to pending picture.Just stored position information is received before watermark data is added to pending picture, after obtaining the picture after processing, can directly according to the picture after stored position information specimens preserving, thus avoid the prompting again sending input stored position information, simplify the operation steps of adding picture watermark, also improve Consumer's Experience simultaneously.
In addition, the first default parameters and the second default parameters are all or part of parameter in parameter preset template, and wherein, parameter preset template is non-custom parameter template.
Because custom parameter template comprises the parameter artificially revised, when calling the parameter in custom parameter template and being pending picture interpolation watermark data as the first default parameters or the second default parameters, the watermark data mistake of adding may be caused, therefore, first default parameters and the second default parameters are the parameter in parameter preset template, and parameter preset template is the template pre-set, instead of custom parameter template.It should be noted that, here the first default parameters and the second default parameters can be whole parameter in parameter preset template or partial parameters, if do not receive parameter, the whole parameters in parameter preset template can be called, if the parameter of have received, so can select the parameter do not received from parameter preset template, coordinate the parameter received to add watermark data to pending picture.
The picture that the present embodiment provides adds water mark method and as independent running software, also can be arranged in the software of picture processing as plug-in unit.
If the integrated unit in above-described embodiment using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in the storage medium that above computer can read.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in storage medium, comprises all or part of step of some instructions in order to make one or more computer equipment (can be personal computer, server or the network equipment etc.) perform each embodiment method of the present invention.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.