CN107437236A - A kind of picture blur processing method and processing device - Google Patents
A kind of picture blur processing method and processing device Download PDFInfo
- Publication number
- CN107437236A CN107437236A CN201610366102.4A CN201610366102A CN107437236A CN 107437236 A CN107437236 A CN 107437236A CN 201610366102 A CN201610366102 A CN 201610366102A CN 107437236 A CN107437236 A CN 107437236A
- Authority
- CN
- China
- Prior art keywords
- label
- picture
- address
- attribute
- size
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
本发明公开了一种图片模糊处理方法及装置,该图片模糊处理方法包括如下步骤:创建多个标签;设置所述标签的样式;获取网页中待处理图片,并将所述待处理图片布满所述标签;以及将所述标签的样式不同的多个标签重叠。本发明通过多个标签的重叠,利用浏览器的渲染引擎渲染出图片的模糊效果,任何使用者均可快速、批量进行图片模糊处理,提升了图片模糊处理的便利性和效率。
The invention discloses a method and device for blurring a picture. The method for blurring a picture comprises the following steps: creating a plurality of labels; setting the style of the labels; the label; and overlapping multiple labels with different styles of the label. The present invention uses the rendering engine of the browser to render the blur effect of the picture through the overlapping of multiple labels, and any user can quickly and batch process the picture blur, thereby improving the convenience and efficiency of the picture blur processing.
Description
技术领域technical field
本发明涉及图片处理领域,具体而言,涉及一种图片模糊处理方法及装置。The present invention relates to the field of image processing, in particular to a method and device for image blurring processing.
背景技术Background technique
人们每天都通过互联网获取信息,每天都会浏览各种各样的网页,其中有大量的图片元素。有的时候,为了营造某种气氛,需要把图片做模糊处理,使其呈现朦胧状。People obtain information through the Internet every day, and browse various web pages every day, which contain a large number of picture elements. Sometimes, in order to create a certain atmosphere, it is necessary to blur the picture to make it appear hazy.
目前图片模糊处理都是使用图片处理软件,例如利用Photoshop进行图片模糊处理。然而,使用图片处理软件对图片进行模糊处理,存在以下缺点:At present, image blurring processing uses image processing software, for example, Photoshop is used for image blurring processing. However, using image processing software to blur images has the following disadvantages:
1、需要使用者掌握图片处理软件,甚至需要较高的美术功底,对于普通使用者并不适用。1. It requires users to master image processing software, and even requires a high level of art skills, which is not suitable for ordinary users.
2、需要人为进行处理费时费力,维护成本较高,且无法满足大量图片模糊处理的需求。2. It is time-consuming and labor-intensive to process manually, the maintenance cost is high, and it cannot meet the needs of blurring a large number of images.
3、使用图片软件处理会产生一个新的图片文件,再将该新图片上传到服务器,供网页使用,这样网页就多一次网络请求。3. A new picture file will be generated by using picture software, and then the new picture will be uploaded to the server for use by the webpage, so that the webpage will have one more network request.
发明内容Contents of the invention
针对现有技术存在的问题,本发明的目的在于提供一种能够对图片进行自动批量处理的图片模糊处理方法及装置。In view of the problems existing in the prior art, the object of the present invention is to provide a method and device for blurring pictures that can automatically process pictures in batches.
根据本发明的一方面,提供一种图片模糊处理方法,包括如下步骤:创建多个标签。设置所述标签的样式。获取网页中待处理图片,并将所述待处理图片布满所述标签。将所述标签的样式不同的多个标签重叠。According to one aspect of the present invention, there is provided a method for blurring a picture, including the following steps: creating multiple labels. Sets the style for said label. Obtain the image to be processed in the webpage, and cover the image to be processed with the label. A plurality of labels having different styles of the above labels are overlapped.
根据本发明的一实施方式,其中所述标签包括尺寸属性和透明属性;所述设置所述标签的样式包括将所述标签的所述尺寸属性设置为预定尺寸。将所述标签的所述透明属性设置为所述标签的预定透明度。According to an embodiment of the present invention, the label includes a size attribute and a transparency attribute; the setting the style of the label includes setting the size attribute of the label to a predetermined size. Setting the transparency property of the label to a predetermined transparency of the label.
根据本发明的一实施方式,其中所述标签为图片标签,所述图片标签包括地址属性;所述获取网页中待处理图片,并将所述待处理图片布满所述标签包括获取网页中待处理图片的地址。将所述图片标签的所述地址属性设置为所述待处理图片的地址。According to an embodiment of the present invention, wherein the label is a picture label, and the picture label includes an address attribute; the acquiring the picture to be processed in the webpage, and covering the picture to be processed with the label includes acquiring the picture to be processed in the webpage The address of the image to be processed. Set the address attribute of the picture tag as the address of the picture to be processed.
根据本发明的一实施方式,其中所述标签包括尺寸属性、背景地址属性和背景尺寸属性;所述获取网页中待处理图片,并将所述待处理图片布满所述标签包括获取所述网页中待处理图片的地址。将所述标签的所述背景地址属性设置为所述待处理图片的地址。将所述标签的所述背景尺寸属性设置为与所述标签的所述尺寸属性相同。According to an embodiment of the present invention, wherein the label includes a size attribute, a background address attribute, and a background size attribute; the acquisition of the picture to be processed in the webpage, and filling the label with the picture to be processed includes obtaining the webpage The address of the image to be processed in . Set the background address attribute of the label as the address of the picture to be processed. Set the background-size property of the label to be the same as the size property of the label.
根据本发明的另一方面,提供一种图片模糊处理装置包括创建模块、设置模块、填充模块和重叠模块;创建模块用于创建标签。设置模块,用于设置所述标签的样式。填充模块用于获取网页中待处理图片,并将所述待处理图片布满所述标签。重叠模块用于将所述标签的样式不同的多个标签重叠。According to another aspect of the present invention, an image blurring processing device is provided, which includes a creation module, a setting module, a filling module and an overlapping module; the creation module is used for creating labels. A setting module for setting the style of the label. The filling module is used to acquire the picture to be processed in the webpage, and fill the label with the picture to be processed. The overlapping module is used for overlapping multiple labels with different label styles.
根据本发明的一实施方式,其中所述标签包括尺寸属性和透明属性;所述设置模块包括第一尺寸设置单元和透明度设置单元;第一尺寸设置单元用于将所述标签的所述尺寸属性设置为预定尺寸。透明度设置单元用于将所述标签的所述透明属性设置为所述标签的预定透明度。According to an embodiment of the present invention, wherein the label includes a size attribute and a transparency attribute; the setting module includes a first size setting unit and a transparency setting unit; the first size setting unit is used to set the size attribute of the label to Set to predetermined size. The transparency setting unit is used to set the transparency attribute of the label to a predetermined transparency of the label.
7、如权利要求5所述的图片模糊处理装置,其特征在于,所述标签为图片标签,所述图片标签包括地址属性;所述填充模块包括:7. The image blur processing device according to claim 5, wherein the label is a picture label, and the picture label includes an address attribute; the filling module includes:
获取单元,用于获取所述网页中待处理图片的地址;以及an acquisition unit, configured to acquire the address of the picture to be processed in the webpage; and
第一地址设置单元,用于将所述图片标签的所述地址属性设置为所述待处理图片的地址。A first address setting unit, configured to set the address attribute of the picture tag as the address of the picture to be processed.
8、如权利要求5所述的图片模糊处理装置,其特征在于,所述标签包括尺寸属性、背景地址属性和背景尺寸属性;所述填充模块包括:8. The image blur processing device according to claim 5, wherein the label includes a size attribute, a background address attribute and a background size attribute; the filling module includes:
获取单元,用于获取所述网页中待处理图片的地址;an acquisition unit, configured to acquire the address of the image to be processed in the webpage;
第二地址设置单元,用于将所述标签的所述背景地址属性设置为所述待处理图片的地址;以及A second address setting unit, configured to set the background address attribute of the label as the address of the picture to be processed; and
第二尺寸设置单元,用于将所述标签的所述背景尺寸属性设置为与所述标签的所述尺寸属性相同。A second size setting unit, configured to set the background size attribute of the label to be the same as the size attribute of the label.
本发明通过多个标签的重叠,利用浏览器的渲染引擎渲染出图片的模糊效果,任何使用者均可快速、批量进行图片模糊处理,提升了图片模糊处理的便利性和效率。The present invention uses the rendering engine of the browser to render the blur effect of the picture through the overlapping of multiple tags, and any user can quickly and batch process the picture blur, thereby improving the convenience and efficiency of the picture blur processing.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本发明。It is to be understood that both the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention.
附图说明Description of drawings
通过参照附图详细描述其示例实施例,本公开的上述和其它目标、特征及优点将变得更加显而易见。The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail example embodiments thereof with reference to the accompanying drawings.
图1示意性示出根据本发明一实施例的图片模糊处理方法的流程图;FIG. 1 schematically shows a flow chart of a method for blurring a picture according to an embodiment of the present invention;
图1A示意性示出图1的图片模糊处理方法中设置标签样式的流程图;Fig. 1A schematically shows the flow chart of setting label style in the image blur processing method of Fig. 1;
图1B示意性示出图1的图片模糊处理方法中将待处理图片布满于标签的一实施例的流程图;Fig. 1B schematically shows a flow chart of an embodiment of filling the label with the image to be processed in the image blur processing method of Fig. 1;
图1C示意性示出图1的图片模糊处理方法中将待处理图片布满于标签的另一实施例的流程图;Fig. 1C schematically shows a flow chart of another embodiment in which the image to be processed is filled with labels in the image blur processing method of Fig. 1;
图2示意性示出根据本发明另一实施例的图片模糊处理方法的流程图;FIG. 2 schematically shows a flow chart of a method for blurring a picture according to another embodiment of the present invention;
图3示意性示出根据本发明一实施例的图片模糊处理装置的结构示意图;FIG. 3 schematically shows a schematic structural view of an image blurring processing device according to an embodiment of the present invention;
图4示意性示出根据本发明另一实施例的图片模糊处理装置的结构示意图;FIG. 4 schematically shows a schematic structural diagram of a picture blurring processing device according to another embodiment of the present invention;
图5示意性示出根据本发明另一实施例的图片模糊处理装置的结构示意图。Fig. 5 schematically shows a schematic structural diagram of an apparatus for image blur processing according to another embodiment of the present invention.
具体实施方式detailed description
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concept of example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted.
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知结构、方法、装置、实现、材料或者操作以避免喧宾夺主而使得本公开的各方面变得模糊。Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details being omitted, or other methods, components, devices, steps, etc. may be adopted. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the present disclosure.
附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and/or processor means and/or microcontroller means.
图1示意性示出根据本发明一实施例的图片模糊处理方法的流程图。本实施例提供的图片模糊处理方法可以应用于各种终端中,例如手机、平板电脑和台式机等,其可以由在终端中内置的软件模块实现。Fig. 1 schematically shows a flow chart of a method for blurring a picture according to an embodiment of the present invention. The image blur processing method provided in this embodiment can be applied to various terminals, such as mobile phones, tablet computers, and desktop computers, and can be implemented by software modules built in the terminals.
如图1所示,本实施例的图片模糊处理方法10包括如下步骤:As shown in Figure 1, the image blur processing method 10 of this embodiment includes the following steps:
步骤S102:创建多个标签。其中,创建的标签为HTML标签,HTML标签的类型可任意选择,例如可以是img(图片标签)、span、div等。其中,多个标签可以批量进行创建,也可以逐一创建,本发明并不以此为限。Step S102: Create multiple tags. Wherein, the created tag is an HTML tag, and the type of the HTML tag can be selected arbitrarily, such as img (picture tag), span, div, etc. Wherein, multiple tags can be created in batches or one by one, and the present invention is not limited thereto.
步骤S104:设置所述标签的样式。其中标签的样式包括标签的尺寸、标签的透明度等参数。标签的尺寸和透明度可以通过设置标签的尺寸属性和透明度属性来进行相应设定。标签的尺寸和透明度可以预先设定,但标签的预定尺寸和预定透明度并不唯一,可以根据模糊效果的实际需要做相应调整。类似于步骤S102,标签的样式设置也可以批量设置或逐一设置。Step S104: Set the style of the label. The style of the label includes parameters such as the size of the label and the transparency of the label. The size and transparency of the label can be set accordingly by setting the size attribute and transparency attribute of the label. The size and transparency of the label can be preset, but the predetermined size and predetermined transparency of the label are not unique, and can be adjusted accordingly according to the actual needs of the blur effect. Similar to step S102, the label style setting can also be set in batches or one by one.
步骤S106:获取网页中待处理图片,并将所述待处理图片布满所述标签。将待处理图片布满标签是指将待处理图片填充于标签的显示区中,不因标签的显示区与待处理图片尺寸的差异,于待处理图片填充至标签的显示区时,在标签的显示区预留白边。举例来说,当标签的显示区的尺寸大于待处理图片的原始尺寸时,待处理图片填充至标签的显示区时,会对待处理图片进行拉伸处理,以使其尺寸与标签的显示区的尺寸相配,在将拉伸处理后的待处理图片填充至标签的显示区即可布满标签。网页中的图片均具有反映各自身份的URL地址,由此可以根据JS获取待处理图片的URL地址。将待处理图片的URL地址链接于标签中可将待处理图片填充于标签中。由于直接通过标签链接URL地址,在进行图片模糊处理时并不需要另一张图片,且保留了原图片文件,不会产生新图片,节约了带宽。在将待处理图片填充于标签中之后,可以依照不同的标签类型将待处理图片布满标签。Step S106: Obtain the image to be processed in the webpage, and fill the label with the image to be processed. Covering the image to be processed with the label refers to filling the display area of the label with the image to be processed. Due to the difference in size between the display area of the label and the image to be processed, when the image to be processed fills the display area of the label, the White borders are reserved in the display area. For example, when the size of the display area of the label is larger than the original size of the picture to be processed, when the picture to be processed fills the display area of the label, the picture to be processed will be stretched so that its size is the same as the display area of the label The size is matched, and the label can be filled with the stretched picture to be processed after filling the display area of the label. The pictures in the web page all have URL addresses reflecting their respective identities, so the URL addresses of the pictures to be processed can be obtained according to the JS. Linking the URL address of the image to be processed to the tag can fill the tag with the image to be processed. Because the URL address is directly linked through the label, another picture is not needed when blurring the picture, and the original picture file is kept, and no new picture will be generated, which saves bandwidth. After the pictures to be processed are filled in the labels, the pictures to be processed can be filled with labels according to different label types.
步骤S108:将样式不同的多个标签重叠。其中在进行标签重叠操作之前,需要将填充同一张待处理图片的多个标签设置为不同尺寸,并且将每个标签设置一定透明度。经过对标签的样式进行以上设置,再使用CSS绝对定位(position:absolute)进行设置就可以将多个标签重叠以得到模糊效果的图片。CSS的绝对定位主要需要设置left、top、angle和z-index等参数,left表示标签水平偏移量、top表示标签垂直偏移量、angle表示标签的角度、z-index表示标签的层级关系。通过对CSS的绝对定位的上述参数进行设置就可以对标签叠放时的叠放顺序、叠放偏移和叠放角度等进行设置,以根据需要得到不同模糊效果的图片。重叠标签的数量可以预先设定,但重叠标签的数量并不唯一,可以根据模糊效果的实际需要做相应调整。Step S108: Overlap multiple labels with different styles. Among them, before performing the label overlapping operation, it is necessary to set the multiple labels filling the same image to be processed to different sizes, and set a certain transparency for each label. After setting the style of the label above, and then using CSS absolute positioning (position:absolute) to set it, multiple labels can be overlapped to obtain a picture with a blur effect. The absolute positioning of CSS mainly needs to set parameters such as left, top, angle, and z-index. left indicates the horizontal offset of the label, top indicates the vertical offset of the label, angle indicates the angle of the label, and z-index indicates the hierarchical relationship of the label. By setting the above parameters of CSS absolute positioning, you can set the stacking order, stacking offset, and stacking angle when the labels are stacked, so as to obtain pictures with different blur effects as required. The number of overlapping labels can be preset, but the number of overlapping labels is not unique, and can be adjusted accordingly according to the actual needs of the blur effect.
图1A示意性示出图1的图片模糊处理方法中设置标签样式的流程图。如图1A所示,步骤S104具体包括以下步骤:FIG. 1A schematically shows a flow chart of setting label styles in the image blurring method in FIG. 1 . As shown in Figure 1A, step S104 specifically includes the following steps:
步骤S1041:将所述标签的所述尺寸属性设置为预定尺寸。标签具有反映标签尺寸的尺寸属性,在对标签的尺寸属性赋予不同数值就可以得到不同尺寸的标签。例如将标签的高度属性设置为600mm,标签的宽度属性设置为800mm,可以得到尺寸为600×800的标签。标签的尺寸可以根据需要进行任意设定,从而得到不同尺寸的标签,通过调整标签的尺寸可以适当调整标签重叠后的图片模糊效果。Step S1041: Set the size attribute of the label to a predetermined size. The label has a size attribute that reflects the size of the label. You can get labels of different sizes by assigning different values to the size attribute of the label. For example, if the height property of the label is set to 600mm and the width property of the label is set to 800mm, a label with a size of 600×800 can be obtained. The size of the label can be set arbitrarily according to the needs, so as to obtain labels of different sizes. By adjusting the size of the label, the image blur effect after overlapping the labels can be adjusted appropriately.
步骤S1042:将所述标签的所述透明属性设置为所述标签的预定透明度。标签具有反映标签透明度的透明属性,在对标签的透明属性赋予不同数值可以得到不同透明度的标签。标签的透明属性为1表示标签不透明。标签透明属性小于1表示标签透明,并且随标签透明属性所赋值越小,标签的透明度随之增加。标签的透明度可以根据需要进行任意设定,从而得到不同透明度的标签,通过调整标签的透明度也可以适当调整标签重叠后的图片模糊效果。Step S1042: Set the transparency attribute of the label to the predetermined transparency of the label. Labels have a transparent attribute that reflects the transparency of the label. You can get labels with different transparency by assigning different values to the transparent attribute of the label. A label with a transparent property of 1 means the label is opaque. A label transparency attribute less than 1 indicates that the label is transparent, and the smaller the value assigned to the label transparency attribute, the greater the transparency of the label. The transparency of the label can be set arbitrarily according to the needs, so that labels with different transparency can be obtained. By adjusting the transparency of the label, the blur effect of the picture after the label overlap can also be adjusted appropriately.
图1B示意性示出图1的图片模糊处理方法中将待处理图片布满于标签的一实施例的流程图。如图1B所示,步骤S106具体包括以下步骤:FIG. 1B schematically shows a flow chart of an embodiment of filling labels with pictures to be processed in the picture blurring processing method in FIG. 1 . As shown in Figure 1B, step S106 specifically includes the following steps:
步骤S1061:获取网页中待处理图片的地址。Step S1061: Obtain the address of the picture to be processed in the web page.
步骤S1062:将所述图片标签的所述地址属性设置为所述待处理图片的地址。Step S1062: Set the address attribute of the picture tag as the address of the picture to be processed.
本实施例中创建的标签为图片标签(img),具有地址属性(src)。将图片标签的地址属性(src)设置为待处理图片的地址就可以直接将待处理图片布满于标签,而无需对待处理图片进行拉伸操作。The tag created in this embodiment is an image tag (img) with an address attribute (src). Setting the address attribute (src) of the picture tag to the address of the picture to be processed can directly fill the label with the picture to be processed without stretching the picture to be processed.
图1C示意性示出图1的图片模糊处理方法中将待处理图片布满于标签的另一实施例的流程图。如图1C所示,步骤S106具体包括如下步骤:FIG. 1C schematically shows a flow chart of another embodiment of filling labels with pictures to be processed in the picture blur processing method in FIG. 1 . As shown in Figure 1C, step S106 specifically includes the following steps:
步骤S1061:获取所述网页中待处理图片的地址。Step S1061: Obtain the address of the picture to be processed in the webpage.
步骤S1062’:将所述标签的所述背景地址属性设置为所述待处理图片的地址。Step S1062': Set the background address attribute of the label as the address of the picture to be processed.
步骤S1063:将所述标签的所述背景尺寸属性设置为与所述标签的所述尺寸属性相同。Step S1063: Set the background size attribute of the label to be the same as the size attribute of the label.
本实施例中创建的标签为普通标签,而非图片标签(img),其具有尺寸属性、背景地址属性和背景尺寸属性。普通标签与上述图片标签(img)不同,其无法直接通过地址属性(src)设置待处理图片的地址,因此在设置待处理图片地址需采用背景地址属性进行设置,如步骤S1062’将所述标签的所述背景地址属性设置为所述待处理图片的地址,则可以将待处理图片链接于标签中。由于待处理图片的尺寸是一定的,一旦标签的尺寸大于待处理图片的尺寸,此时将待处理图片链接于标签,并无法使待处理图片布满于标签中,会影响后续标签叠加后图片的模糊处理效果。因此,在步骤S1062’之后,还需将所述标签的所述背景尺寸属性设置为与所述标签的所述尺寸属性相同,例如,通过CSS将背景尺寸属性(background-size)设置为100%,使链接于标签中的待处理图片可拉伸,当待处理图片的尺寸小于标签的尺寸时,通过将待处理图片的尺寸拉伸至与标签的尺寸相同,可以使待处理图片布满于标签。The tag created in this embodiment is an ordinary tag, not an image tag (img), which has a size attribute, a background address attribute, and a background size attribute. The ordinary tag is different from the above-mentioned image tag (img), and it cannot directly set the address of the image to be processed through the address attribute (src). If the background address attribute of is set to the address of the image to be processed, the image to be processed can be linked to the tag. Since the size of the picture to be processed is fixed, once the size of the label is larger than the size of the picture to be processed, linking the picture to be processed to the label at this time will not make the picture to be processed full in the label, which will affect the image after the subsequent label superposition blurring effect. Therefore, after step S1062', it is also necessary to set the background-size attribute of the label to be the same as the size attribute of the label, for example, set the background-size attribute (background-size) to 100% through CSS , make the picture to be processed linked to the label stretchable. When the size of the picture to be processed is smaller than the size of the label, by stretching the size of the picture to be processed to be the same as the size of the label, the picture to be processed can be filled with Label.
图2示意性示出根据本发明另一实施例的图片模糊处理方法的流程图。Fig. 2 schematically shows a flow chart of a method for blurring a picture according to another embodiment of the present invention.
如图2所示,本实施例的图片模糊处理方法20包括如下步骤:As shown in Figure 2, the image blur processing method 20 of this embodiment includes the following steps:
步骤S102:创建多个标签。Step S102: Create multiple tags.
步骤S104:设置所述标签的样式。Step S104: Set the style of the label.
步骤S106:获取网页中待处理图片,并将所述待处理图片布满所述标签。Step S106: Obtain the image to be processed in the webpage, and fill the label with the image to be processed.
步骤S108:将样式不同的多个标签重叠。Step S108: Overlap multiple labels with different styles.
步骤S110:利用浏览器的渲染引擎,将经过重叠的所述多个标签进行显示。Step S110: using the rendering engine of the browser to display the multiple tags that have been overlapped.
本实施例中步骤S102-S108已于上述实施例的各步骤中做了详细说明,在此不再赘述。其与上述实施例的主要区别在于增加了步骤S110,多个填充有同一张待处理图片的透明标签重叠后即得到模糊效果的图片,再利用浏览器的渲染引擎可以将模糊处理的图片予以显示。本实施例还可以同时显示待处理图片和模糊处理之后的图片,以便二者进行对比。Steps S102-S108 in this embodiment have been described in detail in the steps of the above embodiments, and will not be repeated here. The main difference between it and the above-mentioned embodiment is that step S110 is added. After overlapping multiple transparent labels filled with the same image to be processed, a blurred image can be obtained, and then the rendered image of the browser can be used to display the blurred image. . In this embodiment, the picture to be processed and the picture after blurring can also be displayed at the same time, so that the two can be compared.
图3示意性示出根据本发明一实施例的图片模糊处理装置的结构示意图。Fig. 3 schematically shows a schematic structural diagram of an apparatus for image blurring processing according to an embodiment of the present invention.
如图3所示,本实施例的图片模糊处理装置30包括创建模块302、设置模块304、填充模块306和重叠模块308。As shown in FIG. 3 , the image blur processing apparatus 30 of this embodiment includes a creation module 302 , a setting module 304 , a filling module 306 and an overlapping module 308 .
创建模块302,用于创建标签。The creation module 302 is used for creating labels.
设置模块304,用于设置所述标签的样式。A setting module 304, configured to set the style of the label.
填充模块306,用于获取网页中待处理图片,并将所述待处理图片布满所述标签。以及The filling module 306 is configured to acquire the picture to be processed in the webpage, and fill the label with the picture to be processed. as well as
重叠模块308,用于将所述标签的样式不同的多个标签重叠。The overlapping module 308 is configured to overlap multiple labels with different label styles.
具体地说,当标签包括尺寸属性和透明属性。设置模块304包括第一尺寸设置单元3041和透明度设置单元3042。Specifically, when the label includes a size attribute and a transparency attribute. The setting module 304 includes a first size setting unit 3041 and a transparency setting unit 3042 .
第一尺寸设置单元3041,用于将所述标签的所述尺寸属性设置为预定尺寸;以及A first size setting unit 3041, configured to set the size attribute of the label to a predetermined size; and
透明度设置单元3042,用于将所述标签的所述透明属性设置为所述标签的预定透明度。A transparency setting unit 3042, configured to set the transparency attribute of the label to a predetermined transparency of the label.
当标签为图片标签(img),包括地址属性;所述填充模块306包括获取单元3061和第一地址设置单元3062。When the tag is an image tag (img), it includes an address attribute; the filling module 306 includes an acquiring unit 3061 and a first address setting unit 3062 .
获取单元3061,用于获取所述网页中待处理图片的地址;以及An acquisition unit 3061, configured to acquire the address of the picture to be processed in the webpage; and
第一地址设置单元3062,用于将所述图片标签的所述地址属性设置为所述待处理图片的地址。The first address setting unit 3062 is configured to set the address attribute of the picture tag as the address of the picture to be processed.
本实施例中由于标签为图片标签,待处理图片在链接于标签同时,就可以确保待处理图片的尺寸可以随标签的尺寸相配,即待处理图片的尺寸可以随标签的尺寸的变化而同时变化,仅通过待处理图片与标签地址的链接步骤就可以实现待处理图片布满于标签。In this embodiment, since the tag is an image tag, when the image to be processed is linked to the tag, it can be ensured that the size of the image to be processed can match the size of the tag, that is, the size of the image to be processed can change simultaneously with the size of the tag , only by linking the image to be processed with the address of the label can the image to be processed be covered with the label.
图4示意性示出根据本发明另一实施例的图片模糊处理装置的结构示意图。Fig. 4 schematically shows a schematic structural diagram of an apparatus for image blur processing according to another embodiment of the present invention.
如图4所示,本实施例的图片模糊处理装置40包括创建模块302、设置模块304、填充模块306’和重叠模块308。As shown in FIG. 4 , the image blur processing device 40 of this embodiment includes a creation module 302, a setting module 304, a filling module 306' and an overlapping module 308.
本实施例与图3实施例的主要区别在于填充模块306和填充模块306’的具体实现方式不尽相同。本实施例的标签为普通标签,并非图片标签(img),包括尺寸属性、背景地址属性和背景尺寸属性。The main difference between this embodiment and the embodiment in Fig. 3 is that the specific implementation manners of the filling module 306 and the filling module 306' are different. The tags in this embodiment are ordinary tags, not image tags (img), and include size attributes, background address attributes, and background size attributes.
具体来说,填充模块306’包括获取单元3061、第二地址设置单元3063和第二尺寸设置单元3064。Specifically, the filling module 306' includes an acquisition unit 3061, a second address setting unit 3063 and a second size setting unit 3064.
获取单元3061,用于获取所述网页中待处理图片的地址;An acquisition unit 3061, configured to acquire the address of the picture to be processed in the webpage;
第二地址设置单元3063,用于将所述标签的所述背景地址属性设置为所述待处理图片的地址;以及The second address setting unit 3063 is configured to set the background address attribute of the label as the address of the picture to be processed; and
第二尺寸设置单元3064,用于将所述标签的所述背景尺寸属性设置为与所述标签的所述尺寸属性相同。The second size setting unit 3064 is configured to set the background size attribute of the label to be the same as the size attribute of the label.
本实施例创建的标签为普通标签,在将待处理图片的地址链接于标签地址时,待处理图片的尺寸不能随标签的尺寸的变化而同时变化,需要额外进行待处理图片尺寸的拉伸以与标签的尺寸相符。The tags created in this example are ordinary tags. When the address of the image to be processed is linked to the address of the tag, the size of the image to be processed cannot be changed simultaneously with the size of the tag, and additional stretching of the size of the image to be processed is required. Match the size of the label.
图5示意性示出根据本发明一实施例的图片模糊处理装置的结构示意图。Fig. 5 schematically shows a schematic structural diagram of an apparatus for image blurring processing according to an embodiment of the present invention.
如图5所示,本实施例的图片模糊处理装置50包括创建模块302、设置模块304、填充模块306、重叠模块308和显示模块310。As shown in FIG. 5 , the image blur processing apparatus 50 of this embodiment includes a creation module 302 , a setting module 304 , a filling module 306 , an overlapping module 308 and a display module 310 .
本实施例中创建模块302、设置模块304、填充模块306和重叠模块308与上述实施例相同,在此不再赘述。本实施例与上述实施例的主要区别在于增加了显示模块310。显示模块310用于利用浏览器的渲染引擎,将经过重叠的所述多个标签进行显示。The creation module 302 , the setting module 304 , the filling module 306 and the overlapping module 308 in this embodiment are the same as those in the above embodiment, and will not be repeated here. The main difference between this embodiment and the foregoing embodiments is that a display module 310 is added. The display module 310 is configured to use a browser rendering engine to display the multiple overlapping tags.
上述实施例提供的图片模糊处理装置可以通过预装于终端中的软件来实现。并且其中各模块具体功能的实现过程可以参见上述方法实施例的相关描述,在此不再赘述。The image blur processing apparatus provided in the foregoing embodiments may be implemented by software preinstalled in the terminal. And the implementation process of the specific functions of each module can refer to the relevant description of the above method embodiments, and will not be repeated here.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是平板电脑、台式机、移动电话等)执行根据本公开实施方式的方法。Through the description of the above implementations, those skilled in the art can easily understand that the example implementations described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of software products, and the software products can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which may be a tablet computer, a desktop computer, a mobile phone, etc.) to execute the method according to the embodiments of the present disclosure.
以上具体地示出和描述了本公开的示例性实施方式。应可理解的是,本公开不限于这里描述的详细结构、设置方式或实现方法;相反,本公开意图涵盖包含在所附权利要求的精神和范围内的各种修改和等效设置。Exemplary embodiments of the present disclosure have been specifically shown and described above. It should be understood that the disclosure is not limited to the detailed structures, arrangements or methods of implementation described herein; on the contrary, the disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610366102.4A CN107437236B (en) | 2016-05-27 | 2016-05-27 | A kind of image blurring processing method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610366102.4A CN107437236B (en) | 2016-05-27 | 2016-05-27 | A kind of image blurring processing method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107437236A true CN107437236A (en) | 2017-12-05 |
| CN107437236B CN107437236B (en) | 2021-08-13 |
Family
ID=60454539
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610366102.4A Active CN107437236B (en) | 2016-05-27 | 2016-05-27 | A kind of image blurring processing method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107437236B (en) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0898261A2 (en) * | 1997-08-20 | 1999-02-24 | Bristol-Myers Squibb Company | Container with label for hair dye and related process |
| US20040119713A1 (en) * | 2002-12-20 | 2004-06-24 | Michael Meyringer | Interactive and web-based Gantt Chart |
| CN103020178A (en) * | 2012-11-28 | 2013-04-03 | 北京奇虎科技有限公司 | Method and device for loading image toolbar with browser |
| CN103856476A (en) * | 2012-11-29 | 2014-06-11 | 北京千橡网景科技发展有限公司 | Method and device for identifying network robot |
| CN105094930A (en) * | 2015-09-09 | 2015-11-25 | 上海斐讯数据通信技术有限公司 | Image positioning system and method |
| CN105468656A (en) * | 2014-09-12 | 2016-04-06 | 腾讯科技(深圳)有限公司 | Webpage background image generation method and system |
| CN106341403A (en) * | 2016-08-30 | 2017-01-18 | 竞技世界(北京)网络技术有限公司 | Identifying code theft preventing method |
-
2016
- 2016-05-27 CN CN201610366102.4A patent/CN107437236B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0898261A2 (en) * | 1997-08-20 | 1999-02-24 | Bristol-Myers Squibb Company | Container with label for hair dye and related process |
| US6106917A (en) * | 1997-08-20 | 2000-08-22 | Bristol-Myers Squibb Company | Container with label for hair dye |
| US20040119713A1 (en) * | 2002-12-20 | 2004-06-24 | Michael Meyringer | Interactive and web-based Gantt Chart |
| CN103020178A (en) * | 2012-11-28 | 2013-04-03 | 北京奇虎科技有限公司 | Method and device for loading image toolbar with browser |
| CN103856476A (en) * | 2012-11-29 | 2014-06-11 | 北京千橡网景科技发展有限公司 | Method and device for identifying network robot |
| CN105468656A (en) * | 2014-09-12 | 2016-04-06 | 腾讯科技(深圳)有限公司 | Webpage background image generation method and system |
| CN105094930A (en) * | 2015-09-09 | 2015-11-25 | 上海斐讯数据通信技术有限公司 | Image positioning system and method |
| CN106341403A (en) * | 2016-08-30 | 2017-01-18 | 竞技世界(北京)网络技术有限公司 | Identifying code theft preventing method |
Non-Patent Citations (4)
| Title |
|---|
| KATERYNA SYNYTSYA .ETAL: "HTML5 in Development of Assessment Tasks for e-Learning", 《 APPLIED COMPUTER SYSTEMS》 * |
| 周潇: "CSS滤镜在网页制作中的运用", 《辽宁师专学报》 * |
| 江平 等: "《HTML与CSS程序设计项目化教程》", 31 August 2015, 华中科技大学出版社 * |
| 袁磊 主编: "《网页设计与制作教程》", 31 January 2012, 东软电子出版社 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107437236B (en) | 2021-08-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103823620B (en) | Screen adaption method and device | |
| CN104360882B (en) | Display methods and device are carried out to picture in webpage in a kind of browser | |
| CN103631866B (en) | Webpage display method and browser | |
| AU2012242947A2 (en) | Method and system for personalizing images rendered in scenes for personalized customer experience | |
| CN104731821B (en) | Webpage shade method for Asynchronous Request pattern | |
| CN107239287A (en) | A kind of Webpage display process, device, electronic equipment and storage medium | |
| CN103631867B (en) | Webpage display method and browser | |
| CN113835595B (en) | Image display method, device, electronic device and computer storage medium | |
| CN110532497B (en) | Method for generating panorama, method for generating three-dimensional page and computing device | |
| JP2014524623A5 (en) | ||
| WO2022227868A1 (en) | Scene rendering method and apparatus, electronic device, and readable storage medium | |
| WO2021135683A1 (en) | Display terminal adjustment method and display terminal | |
| CN104616158A (en) | Product detail page generation method and device | |
| CN106204439A (en) | The method and system of picture self-adaptive processing | |
| CN102609414A (en) | Picture hot zone highlighting display method, device and system based on browser | |
| CN106528887A (en) | Webpage design method and system | |
| CN114968461B (en) | Front-end page containerized layout method and device, computer equipment and storage medium | |
| US20140201658A1 (en) | Rendering maps with canvas elements | |
| CN109065001B (en) | Image down-sampling method and device, terminal equipment and medium | |
| CN108134906A (en) | Image processing method and its system | |
| CN110825989B (en) | Image display method, device, electronic device and readable medium | |
| US20130031467A1 (en) | So-called hd-web method for high-definition and all-screen compatibile internet contents | |
| CN105556570A (en) | Generating screen data | |
| CN107437236B (en) | A kind of image blurring processing method and device | |
| CN112037341A (en) | Method and device for processing VR panorama interaction function based on Web front end |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |