Movatterモバイル変換


[0]ホーム

URL:


CN113704530A - Image processing method, image processing device, electronic equipment and computer readable storage medium - Google Patents

Image processing method, image processing device, electronic equipment and computer readable storage medium
Download PDF

Info

Publication number
CN113704530A
CN113704530ACN202111002522.1ACN202111002522ACN113704530ACN 113704530 ACN113704530 ACN 113704530ACN 202111002522 ACN202111002522 ACN 202111002522ACN 113704530 ACN113704530 ACN 113704530A
Authority
CN
China
Prior art keywords
image processing
svg file
processing tool
attribute set
converting
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.)
Pending
Application number
CN202111002522.1A
Other languages
Chinese (zh)
Inventor
董慧凯
王宇航
曾鹏轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Siming Qichuang Technology Co ltd
Original Assignee
Beijing Siming Qichuang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Siming Qichuang Technology Co ltdfiledCriticalBeijing Siming Qichuang Technology Co ltd
Priority to CN202111002522.1ApriorityCriticalpatent/CN113704530A/en
Publication of CN113704530ApublicationCriticalpatent/CN113704530A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请提供一种图像处理方法、装置、电子设备及计算机可读存储介质。方法包括:将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令;根据渲染指令,通过指定图像处理工具将SVG文件转换成可提取纹理的位图;根据位图生成供Unity引擎处理的纹理图。在本方案中,在Unity引擎对SVG文件渲染过程中,无需将SVG文件转换成三角形网格的方式进行渲染,而是将SVG文件转换成纹理图,从而有利于降低SVG文件渲染处理的运算量,提高渲染处理的实时性。

Figure 202111002522

The present application provides an image processing method, apparatus, electronic device, and computer-readable storage medium. The method includes: converting the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool; according to the rendering instruction, converting the SVG file into a bitmap that can extract textures through the designated image processing tool; generating according to the bitmap Texture map for processing by the Unity engine. In this solution, during the rendering process of the SVG file by the Unity engine, it is not necessary to convert the SVG file into a triangular mesh for rendering, but the SVG file is converted into a texture map, which is beneficial to reduce the calculation amount of the SVG file rendering processing. , to improve the real-time performance of rendering processing.

Figure 202111002522

Description

Image processing method, image processing device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer image processing, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium.
Background
The Unity engine is a tool commonly used for image processing in the fields of games, movie animation, and the like. Currently, the Unity engine cannot directly process vector graphics, for example, the Unity engine cannot directly process SVG files textually. When the Unity engine needs to process the texture of an SVG (Scalable Vector Graphics) file, the SVG file is usually rendered by converting the SVG file into a triangular mesh, and the processing method needs to generate more triangular meshes, which results in large computation amount and poor real-time performance for the SVG file.
Disclosure of Invention
An object of the embodiments of the present application is to provide an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium, which can solve the problems of large computation amount and poor real-time performance when a Unity engine renders an SVG file.
In order to achieve the above object, embodiments of the present application are implemented as follows:
in a first aspect, an embodiment of the present application provides an image processing method, where the method includes: converting the attribute set in the obtained SVG file into a corresponding rendering instruction which can be identified by a designated image processing tool; converting the SVG file into a bitmap of extractable texture by the designated image processing tool according to the rendering instruction; and generating a texture map for processing by the Unity engine according to the bitmap.
In the above embodiment, the attribute set in the SVG file is converted into the corresponding rendering instruction recognizable by the designated image processing tool, and then the SVG file is converted into the bitmap capable of extracting the texture by the designated image processing tool, and then the texture map is generated.
With reference to the first aspect, in some optional embodiments, converting the obtained set of attributes in the SVG file into corresponding rendering instructions recognizable by a specified image processing tool includes:
and converting the parent node text label and the child node text label in the obtained SVG file attribute set into a first type of rendering instruction which can be recognized by the appointed image processing tool.
In the above embodiment, the parent node text label and the child node text label in the SVG file can be subsequently drawn in the bitmap by using the first type of rendering instruction, so that the problem that the Unity engine does not support the parent node text label and the child node text label in the SVG file can be improved.
With reference to the first aspect, in some optional embodiments, converting the obtained set of attributes in the SVG file into corresponding rendering instructions recognizable by a specified image processing tool includes:
and converting the obtained line label in the attribute set of the SVG file into a second type of rendering instruction which can be identified by the appointed image processing tool, wherein the line label comprises at least one of a straight line, a rectangle, a circle, an ellipse, a path, a multi-segment line and a polygon.
With reference to the first aspect, in some optional embodiments, converting the obtained set of attributes in the SVG file into corresponding rendering instructions recognizable by a specified image processing tool includes:
and converting the obtained transformation tags in the attribute set of the SVG file into a third type of rendering instructions recognizable by the specified image processing tool, wherein the transformation tags comprise at least one of rotation, translation and scaling.
With reference to the first aspect, in some optional embodiments, converting the obtained set of attributes in the SVG file into corresponding rendering instructions recognizable by a specified image processing tool includes:
and converting the filling, contour and opacity in the obtained attribute set of the SVG file into a fourth class of rendering instructions which can be recognized by the specified image processing tool.
With reference to the first aspect, in some optional embodiments, the method further comprises:
and performing image rendering on the texture map through the Unity engine, and displaying and outputting an image representing the rendered SVG file.
With reference to the first aspect, in some optional embodiments, before converting the set of attributes in the obtained SVG file into corresponding rendering instructions recognizable to a specified image processing tool, the method further comprises:
and analyzing the obtained SVG file according to an SAX analysis strategy to obtain the attribute set of the SVG file.
With reference to the first aspect, in some alternative embodiments, the specified image processing tool is a skisharp tool.
In the above embodiment, the skeiasharp tool can be used in different operating systems, so that the skeiasharp tool has a cross-platform function, which is beneficial to expanding applicable scenes.
In a second aspect, an embodiment of the present application further provides an image processing apparatus, including:
an instruction generating unit, which is used for converting the attribute set in the obtained SVG file into a corresponding rendering instruction which can be identified by a specified image processing tool;
an image conversion unit for converting the SVG file into a bitmap of extractable texture by the specified image processing tool according to the rendering instruction;
and the texture processing unit is used for generating a texture map for the Unity engine to process according to the bitmap.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory coupled to each other, and a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device is caused to perform the method described above.
In a fourth aspect, the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the above method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present application.
Fig. 3 is a second flowchart of an image processing method according to the embodiment of the present application.
Fig. 4 is a block diagram of an image processing apparatus according to an embodiment of the present application.
Icon: 10-an electronic device; 11-a processing module; 12-a storage module; 200-an image processing apparatus; 210-an instruction generation unit; 220-an image conversion unit; 230-texture processing unit.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It should be noted that the terms "first," "second," and the like are used merely to distinguish one description from another, and are not intended to indicate or imply relative importance. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, the present application provides anelectronic device 10, which can be used to perform conversion processing on an SVG file, so that a Unity engine can perform image rendering on the converted SVG file. Theelectronic device 10 may be, but is not limited to, a personal computer, a server, or the like.
Theelectronic device 10 may include aprocessing module 11 and astorage module 12. Thememory module 12 stores therein a computer program which, when executed by theprocessing module 11, enables theelectronic device 10 to perform the steps of the method described below.
Theprocessing module 11 and thestorage module 12 are electrically connected directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
Referring to fig. 2, an embodiment of the present application further provides an image processing method, which can be applied to theelectronic device 10, and theelectronic device 10 executes or implements the steps of the method. The method may comprise the steps of:
step S110, converting the attribute set in the obtained SVG file into a corresponding rendering instruction which can be identified by a designated image processing tool;
step S120, converting the SVG file into a bitmap with extractable texture through the designated image processing tool according to the rendering instruction;
step S130, generating a texture map for the Unity engine to process according to the bitmap.
In the above embodiment, the attribute set in the SVG file is converted into the corresponding rendering instruction recognizable by the designated image processing tool, and then the SVG file is converted into the bitmap capable of extracting the texture by the designated image processing tool, and then the bitmap is generated, so that in the process of rendering the SVG file by the Unity engine, the SVG file is converted into the texture map for image rendering, and the SVG file is rendered in a manner of converting the SVG file into the triangular mesh, which is beneficial to reducing the computation amount of the SVG file rendering and improving the real-time performance of the rendering.
The individual steps of the process are explained in detail below, as follows:
understandably, when processing the SVG image file, theelectronic device 10 obtains in advance the SVG file and the attribute set of the SVG file. The way in which the SVG file is obtained by theelectronic device 10 can be flexibly determined according to actual situations. For example, the SVG file may be a file automatically generated by theelectronic device 10, or theelectronic device 10 may obtain the SVG file from another device storing the SVG file, and the way of obtaining the SVG file is not particularly limited herein.
When processing the SVG image file, if the attribute set of the SVG file does not exist in theelectronic device 10, the method includes, before step S110: and analyzing the obtained SVG file according to an SAX analysis strategy to obtain the attribute set of the SVG file.
SAX is shorthand for English "Simple API for XML"; XML is shorthand for the English "Extensible Markup Language," which refers to Extensible Markup Language. The SAX parsing strategy is an alternative mode of XML parsing, and can parse SVG files to obtain various attribute information in the SVG files. That is, theelectronic device 10 may rapidly parse the SVG file through the SAX parsing policy, so as to obtain various types of attribute information of the SVG file as an attribute set.
In step S110, theelectronic device 10 has previously obtained the SVG file and the attribute set of the SVG file. In the attribute set of the SVG file, a plurality of attributes of the SVG file are included. For example, the set of attributes includes, but is not limited to, parent text labels, child text labels, line labels, transformation labels, fill, outline, opacity, and the like.
Electronic device 10 may utilize a scripting program to convert different attributes in the SVG file into different rendering instructions for a given image processing tool to convert the SVG file into a bitmap. Wherein, a script program is pre-installed in theelectronic device 10, and the script program can be compiled according to actual situations as long as the attributes in the SVG file can be converted into corresponding rendering instructions.
As an alternative implementation, step S110 may include:
and converting the parent node text label and the child node text label in the obtained SVG file attribute set into a first type of rendering instruction which can be recognized by the appointed image processing tool.
The contents of the attributes in an SVG file are well known to those skilled in the art. For example, a parent text tag refers to a text tag and a child text tag refers to a tspan tag.Electronic device 10 may convert the text tags, tspan tags in the SVG file attribute set into rendering instructions of the first type by specifying an image processing tool. In this manner, the designated image processing tool may subsequently convert the text tags in the SVG file into a new bitmap. When the Unity engine carries out image rendering subsequently, the text label and the tspan label can be supported so as to meet the requirement of corresponding projects with text processing and solve the problem that the Unity engine cannot support the text label and the tspan label.
As an alternative implementation, step S110 may include:
and converting the obtained line label in the attribute set of the SVG file into a second type of rendering instruction which can be recognized by the appointed image processing tool.
Understandably, different attributes in an SVG file may correspond to different rendering instructions. Line labels include, but are not limited to, straight lines, rectangles, circles, ellipses, paths, polylines, polygons, and the like. By converting the line labels into the second type rendering instructions, the specified image processing tool can convert the line labels such as straight lines, rectangles, circles, ellipses, paths, multi-segment lines, polygons and the like in the SVG file into a new bitmap, and the line characteristics such as straight lines, rectangles, circles, ellipses, paths, multi-segment lines, polygons and the like are prevented from being omitted in the converted bitmap.
As an alternative implementation, step S110 may include:
and converting the obtained transformation tags in the attribute set of the SVG file into a third type of rendering instruction which can be recognized by the specified image processing tool. Wherein the transformation tags include, but are not limited to, rotation, translation, scaling, and the like.
In this embodiment, by converting the transformation tag of the SVG file into the third type rendering instruction, the omission of transformation attributes such as rotation, translation, scaling, and the like in the converted bitmap can be avoided.
As an alternative implementation, step S110 may include:
and converting the filling, contour and opacity in the obtained attribute set of the SVG file into a fourth class of rendering instructions which can be recognized by the specified image processing tool.
In the embodiment, filling, outline and opacity in the SVG file are converted into the fourth type of rendering instructions, so that the attributes such as filling, outline and opacity in the SVG file can be converted into a bitmap, and the converted bitmap is prevented from omitting the attribute information such as filling, outline and opacity in the SVG file.
In this embodiment, theelectronic device 10 may also convert other attributes in the SVG file into corresponding rendering instructions. For example, image tags in the attribute set of the SVG file are converted into rendering instructions of a fifth type, and attributes such as linear fading, radial fading and the like in the attribute set of the SVG file are converted into rendering instructions of a sixth type.
In the process of converting the SVG file into a new bitmap, a designated image processing tool cannot directly convert or draw the attribute set of the SVG file into the bitmap, and each attribute in the SVG file needs to be converted into a rendering instruction which can be recognized by the designated image processing tool, and then the attribute set of the SVG file is converted or drawn into the bitmap through the rendering instruction.
In step S120, after the rendering instruction corresponding to each type of attribute of the SVG file is obtained, the SVG file can be converted into a corresponding bitmap by using the rendering instruction through a designated image processing tool. Wherein, the bitmap obtained by conversion can extract texture resources.
The designated image processing tool can be a software tool capable of converting the SVG file into a bitmap capable of extracting textures, and can be flexibly determined according to actual conditions. For example, the designated image tool may be a SkiaSharp tool, or other tool having similar functionality as the SkiaSharp tool.
For example, the designated image tool may be a tool such as CoreGraphics under the iOS platform, com. Among them, the tools such as CoreGraphics, com. android. graphics, and system. drawing have functions similar to the skisharp tool, and are well known to those skilled in the art.
Where SkiaSharp is a CSharp language wrapper to the Skia engine, the tool can be used in the Unity engine for image processing. The SkiaSharp can be used in a cross-platform manner, for example, in different operating systems such as a Windows system and an Android system. The Skia engine and CSharp languages are well known to those skilled in the art and will not be described in detail herein.
In step S130, theelectronic device 10 may generate a texture map for Unity by reading the pixel values of the bitmap obtained by conversion. The way of generating the texture map is well known to those skilled in the art and will not be described herein.
Referring to fig. 3, the image processing method provided in this embodiment may further include step S140. And step S140, performing image rendering on the texture map through the Unity engine, and displaying and outputting an image representing the rendered SVG file.
In this embodiment, an SVG file may be quickly converted by theelectronic device 10 into a texture map for use by the Unity engine. After the texture map is obtained, the Unity engine can quickly perform texture rendering based on the texture map, so as to obtain a rendered image, wherein the rendered image is an image obtained by rendering the SVG file by the Unity engine.
Assuming that the image processing tool is designated as a SkiaSharp tool and the converted bitmap of the SVG file is a bitmap, the implementation flow of the method will be described as follows:
firstly, when converting each attribute in the SVG file into a corresponding rendering instruction, theelectronic device 10 may convert an image tag in the SVG file into an SKBitmap instruction (referred to as a fifth type rendering instruction), so that when performing bitmap conversion, the image tag in the SVG file may be drawn into a bitmap by using a DrawBitmap instruction of SKCanvas, which is a module in a skisharp tool and is well known to those skilled in the art;
and converting a text tag and a tspan tag in the SVG file into a DrawText instruction (referring to a first class rendering instruction), so that when bitmap conversion is carried out, the DrawText instruction of SKCanvas can be used for drawing the text in the SVG file into a bitmap.
Line labels such as line, rectangle, circle, ellipse, path, polyline and polygon in the SVG file are converted into SKPath instructions (referring to a second type rendering instruction), so that the line labels in the SVG file can be drawn into bitmaps by using the DrawPath instructions of SKCanvas when bitmap conversion is carried out.
The transform attribute in the SVG file is converted into an SKMatrix instruction (referring to a third type rendering instruction), the transform attribute refers to a transformation tag and may include attributes of rotation, translation, scaling and the like of an image, and thus, the transform attribute in the SVG file may be added through the SKMatrix instruction when a bitmap is drawn.
And converting the attributes such as fill, stroke and opacity in the SVG file into an SKPaint instruction (referring to a fourth type rendering instruction), so that the attributes such as fill, stroke and opacity in the SVG file can be added through the SKPaint instruction when the bitmap is drawn.
The attributes such as linear gradient and radial gradient in the SVG file are converted into SKShader instruction (referring to the sixth type of rendering instruction), so that the attributes such as linear gradient and radial gradient in the SVG file can be added through the SKShader instruction when the bitmap is rendered.
In addition, theelectronic device 10 can push and pop the drawing states of the container class or the reference class tags such as g, a, use, defs, etc. in the SVG file to ensure that the SVG file can be normally converted into a bitmap. Wherein g, a, use, defs are container class or reference class labels in the SVG file, which are well known to those skilled in the art. Attributes such as viewport and viewbox in the SVG file may be used for control of the Canvas.
When the text is drawn, that is, when a DrawText instruction is called, the text can be cut into a normal text and an expressive text, wherein the normal text is drawn by using a text font, and the expressive text is drawn by using an expressive character font. The common text is a font text, such as english letters, numbers, chinese characters, and the like. The expression text is character text, such as ^ A _, so that characters can be more comprehensively drawn.
And secondly, after various rendering instructions of attributes in the SVG file are obtained, converting the SVG file into a bitmap 'SKBitmap' by using SkiaSharp according to the various rendering instructions, and finally reading a pixel value in the SKBitmap to generate a Texture resource 'Texture 2D' used by the Unity engine. When the subsequent Unity engine carries out Texture rendering, image rendering can be realized based on Texture 2D.
Referring to fig. 4, animage processing apparatus 200 is further provided in an embodiment of the present application, which can be applied to theelectronic device 10 for executing steps of the method. Theimage processing apparatus 200 includes at least one software functional module which can be stored in the form of software or Firmware (Firmware) in thestorage module 12 or solidified in an Operating System (OS) of theelectronic device 10. Theprocessing module 11 is used for executing executable modules stored in thestorage module 12, such as software functional modules and computer programs included in theimage processing apparatus 200.
Theimage processing apparatus 200 may include aninstruction generating unit 210, animage converting unit 220, and atexture processing unit 230, and may perform the following operation steps:
aninstruction generating unit 210 for converting the attribute set in the obtained SVG file into a corresponding rendering instruction recognizable by a specified image processing tool;
animage conversion unit 220 for converting the SVG file into a bitmap of extractable texture by the specified image processing tool according to the rendering instruction;
and thetexture processing unit 230 is configured to generate a texture map for the Unity engine to process according to the bitmap.
Optionally, theimage processing apparatus 200 may further include a parsing unit. The parsing unit is configured to parse the obtained SVG file according to the SAX parsing policy to obtain the attribute set of the SVG file before theinstruction generating unit 210 executes step S110
Optionally, theinstruction generating unit 210 may be further configured to: and converting the parent node text label and the child node text label in the obtained SVG file attribute set into a first type of rendering instruction which can be recognized by the appointed image processing tool.
Optionally, theinstruction generating unit 210 may be further configured to: and converting the obtained line label in the attribute set of the SVG file into a second type of rendering instruction which can be identified by the appointed image processing tool, wherein the line label comprises at least one of a straight line, a rectangle, a circle, an ellipse, a path, a multi-segment line and a polygon.
Optionally, theinstruction generating unit 210 may be further configured to: and converting the obtained transformation tags in the attribute set of the SVG file into a third type of rendering instructions recognizable by the specified image processing tool, wherein the transformation tags comprise at least one of rotation, translation and scaling.
Optionally, theinstruction generating unit 210 may be further configured to: and converting the filling, contour and opacity in the obtained attribute set of the SVG file into a fourth class of rendering instructions which can be recognized by the specified image processing tool.
Optionally, theimage processing apparatus 200 may further include a rendering display unit, configured to perform image rendering on the texture map through the Unity engine, and display and output an image representing the rendered SVG file.
In this embodiment, theprocessing module 11 may be an integrated circuit chip having signal processing capability. Theprocessing module 11 may be a general-purpose processor. For example, the processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), or the like; the method, the steps and the logic block diagram disclosed in the embodiments of the present Application can also be implemented or executed by a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
Thememory module 12 may be, but is not limited to, a random access memory, a read only memory, a programmable read only memory, an erasable programmable read only memory, an electrically erasable programmable read only memory, and the like. In this embodiment, thestorage module 12 may be used to store SVG files, texture resources, and the like. Of course, thestorage module 12 may also be used to store a program, and theprocessing module 11 executes the program after receiving the execution instruction.
It is understood that the configuration shown in fig. 1 is only a schematic configuration of theelectronic device 10, and that theelectronic device 10 may further include more components than those shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working process of theelectronic device 10 described above may refer to the corresponding process of each step in the foregoing method, and will not be described in too much detail herein.
The embodiment of the application also provides a computer readable storage medium. The computer-readable storage medium has stored therein a computer program which, when run on a computer, causes the computer to execute the image processing method as described in the above embodiments.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by hardware, or by software plus a necessary general hardware platform, and based on such understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments of the present application.
In summary, in the scheme, the attribute set in the SVG file is converted into the corresponding rendering instruction recognizable by the designated image processing tool, then the SVG file is converted into the bitmap capable of extracting the texture by the designated image processing tool, and the texture map is generated, so that the SVG file does not need to be converted into the triangular mesh for rendering in the process of rendering the SVG file by the Unity engine, thereby being beneficial to reducing the computation amount of the SVG file rendering processing and improving the real-time performance of the rendering processing.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus, system, and method may be implemented in other ways. The apparatus, system, and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

Translated fromChinese
1.一种图像处理方法,其特征在于,所述方法包括:1. an image processing method, is characterized in that, described method comprises:将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令;Convert the attribute set in the obtained SVG file into a corresponding rendering instruction that can be recognized by the specified image processing tool;根据所述渲染指令,通过所述指定图像处理工具将所述SVG文件转换成可提取纹理的位图;converting the SVG file into a texture-extractable bitmap by using the specified image processing tool according to the rendering instruction;根据所述位图生成供Unity引擎处理的纹理图。A texture map for processing by the Unity engine is generated according to the bitmap.2.根据权利要求1所述的方法,其特征在于,将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令,包括:2. The method according to claim 1, wherein converting the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool, comprising:将获得的所述SVG文件属性集中的父节点文本标签、子节点文本标签,转换成所述指定图像处理工具可识别的第一类渲染指令。Converting the parent node text label and the child node text label in the obtained attribute set of the SVG file into the first type of rendering instructions recognizable by the designated image processing tool.3.根据权利要求1所述的方法,其特征在于,将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令,包括:3. The method according to claim 1, wherein converting the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool, comprising:将获得的所述SVG文件属性集中的线条标签,转换成所述指定图像处理工具可识别的第二类渲染指令,其中,所述线条标签包括直线、矩形、圆、椭圆、路径、多段线、多边形中的至少一种。Converting the obtained line label in the attribute set of the SVG file into a second type of rendering instruction recognizable by the specified image processing tool, wherein the line label includes a line, a rectangle, a circle, an ellipse, a path, a polyline, At least one of the polygons.4.根据权利要求1所述的方法,其特征在于,将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令,包括:4. The method according to claim 1, wherein converting the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool, comprising:将获得的所述SVG文件属性集中的变换标签,转换成所述指定图像处理工具可识别的第三类渲染指令,其中,所述变换标签包括旋转、平移、缩放中的至少一种。Convert the obtained transformation tag in the attribute set of the SVG file into a third type of rendering instruction recognizable by the specified image processing tool, wherein the transformation tag includes at least one of rotation, translation, and scaling.5.根据权利要求1所述的方法,其特征在于,将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令,包括:5. The method according to claim 1, wherein converting the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool, comprising:将获得的所述SVG文件属性集中的填充、轮廓、不透明度,转换成所述指定图像处理工具可识别的第四类渲染指令。Convert the obtained fill, outline, and opacity in the attribute set of the SVG file into a fourth type of rendering instruction that can be recognized by the designated image processing tool.6.根据权利要求1所述的方法,其特征在于,所述方法还包括:6. The method of claim 1, wherein the method further comprises:通过所述Unity引擎对所述纹理图进行图像渲染,并显示输出表征所述SVG文件渲染后的图像。Image rendering is performed on the texture map by the Unity engine, and the display output represents the rendered image of the SVG file.7.根据权利要求1-6中任一项所述的方法,其特征在于,在将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令之前,所述方法还包括:7. The method according to any one of claims 1-6, characterized in that, before converting the attribute set in the obtained SVG file into a corresponding rendering instruction recognizable by a designated image processing tool, the method further comprises: :根据SAX解析策略对获得的所述SVG文件进行解析,得到所述SVG文件的所述属性集。The obtained SVG file is parsed according to the SAX parsing strategy to obtain the attribute set of the SVG file.8.一种图像处理装置,其特征在于,所述装置包括:8. An image processing device, wherein the device comprises:指令生成单元,用于将获得的SVG文件中的属性集转换成指定图像处理工具可识别的相应渲染指令;an instruction generation unit, configured to convert the attribute set in the obtained SVG file into a corresponding rendering instruction identifiable by a designated image processing tool;图像转换单元,用于根据所述渲染指令,通过所述指定图像处理工具将所述SVG文件转换成可提取纹理的位图;an image conversion unit, configured to convert the SVG file into a texture-extractable bitmap through the specified image processing tool according to the rendering instruction;纹理处理单元,用于根据所述位图生成供Unity引擎处理的纹理图。A texture processing unit, configured to generate a texture map for the Unity engine to process according to the bitmap.9.一种电子设备,其特征在于,所述电子设备包括相互耦合的处理器及存储器,所述存储器内存储计算机程序,当所述计算机程序被所述处理器执行时,使得所述电子设备执行如权利要求1-7中任一项所述的方法。9. An electronic device, characterized in that the electronic device comprises a mutually coupled processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device causes the electronic device to The method of any of claims 1-7 is performed.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1-7中任一项所述的方法。10. A computer-readable storage medium, characterized in that, a computer program is stored in the computer-readable storage medium, and when the computer program is executed on a computer, the computer is made to execute as in claims 1-7 The method of any one.
CN202111002522.1A2021-08-302021-08-30Image processing method, image processing device, electronic equipment and computer readable storage mediumPendingCN113704530A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111002522.1ACN113704530A (en)2021-08-302021-08-30Image processing method, image processing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111002522.1ACN113704530A (en)2021-08-302021-08-30Image processing method, image processing device, electronic equipment and computer readable storage medium

Publications (1)

Publication NumberPublication Date
CN113704530Atrue CN113704530A (en)2021-11-26

Family

ID=78656638

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111002522.1APendingCN113704530A (en)2021-08-302021-08-30Image processing method, image processing device, electronic equipment and computer readable storage medium

Country Status (1)

CountryLink
CN (1)CN113704530A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114637731A (en)*2022-03-302022-06-17广东博智林机器人有限公司Format conversion method and device based on SVG file
CN115345973A (en)*2022-08-112022-11-15厦门极致互动网络技术股份有限公司Image-text batching method based on TextMeshPro

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101046888A (en)*2006-03-302007-10-03株式会社东芝Rendering apparatus and method, and shape data generation apparatus and method
WO2012142730A1 (en)*2011-04-212012-10-26Xie JingxiangMethod and device for word processing
CN102831635A (en)*2011-06-132012-12-19华为软件技术有限公司Method and terminal for displaying vector graphics
CN107066430A (en)*2017-04-212017-08-18广州爱九游信息技术有限公司Image processing method, device, service end and client
CN107220067A (en)*2017-06-292017-09-29广州优视网络科技有限公司The loading method and device of scalable vector graphicses picture under Android system
US20180173683A1 (en)*2016-12-152018-06-21Sap SeGraphics display capture system
CN109284487A (en)*2018-08-282019-01-29广州视源电子科技股份有限公司Method and device for rendering data in canvas, electronic equipment and storage medium
JP2021111229A (en)*2020-01-142021-08-02キヤノン株式会社 Information processing device, image data generation method and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101046888A (en)*2006-03-302007-10-03株式会社东芝Rendering apparatus and method, and shape data generation apparatus and method
WO2012142730A1 (en)*2011-04-212012-10-26Xie JingxiangMethod and device for word processing
CN102831635A (en)*2011-06-132012-12-19华为软件技术有限公司Method and terminal for displaying vector graphics
US20180173683A1 (en)*2016-12-152018-06-21Sap SeGraphics display capture system
CN107066430A (en)*2017-04-212017-08-18广州爱九游信息技术有限公司Image processing method, device, service end and client
CN107220067A (en)*2017-06-292017-09-29广州优视网络科技有限公司The loading method and device of scalable vector graphicses picture under Android system
CN109284487A (en)*2018-08-282019-01-29广州视源电子科技股份有限公司Method and device for rendering data in canvas, electronic equipment and storage medium
JP2021111229A (en)*2020-01-142021-08-02キヤノン株式会社 Information processing device, image data generation method and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MR.CAMELLIA: "skia研究文档", pages 1 - 96, Retrieved from the Internet <URL:https://download.csdn.net/download/qq_43041775/11011108>*

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114637731A (en)*2022-03-302022-06-17广东博智林机器人有限公司Format conversion method and device based on SVG file
CN115345973A (en)*2022-08-112022-11-15厦门极致互动网络技术股份有限公司Image-text batching method based on TextMeshPro

Similar Documents

PublicationPublication DateTitle
KR102523843B1 (en) Font rendering method, device and computer readable storage medium
CN111813380B (en)Coloring data processing method and device based on game engine and electronic equipment
CN111221596B (en)Font rendering method, apparatus and computer readable storage medium
WO2009001226A2 (en)Data system and method
CN108399172B (en)Vector diagram generation method and device
CN104850388A (en)Method and apparatus for drafting webpage
CN113704530A (en)Image processing method, image processing device, electronic equipment and computer readable storage medium
CN114218890B (en)Page rendering method and device, electronic equipment and storage medium
CN114791988A (en)Browser-based PDF file analysis method, system and storage medium
CN113760283A (en)Text rendering method and device
CN111460342B (en)Page rendering display method and device, electronic equipment and computer storage medium
CN106920270B (en)Animation processing method and device
CN114254585B (en)Font generation method and device, electronic equipment and storage medium
CN112581568B (en)Dynamic poster generation method, device, server and storage medium
CN117971175B (en)Design draft self-adaption-based application software development method and electronic equipment
CN118963755A (en) Adaptive multilingual text layout method, device and equipment
CN118193723A (en)Text parsing method, system, electronic equipment and storage medium
CN111240676A (en)Method and device for generating code of skeleton screen
CN113902018B (en) Image sample generation method, device, computer readable medium and electronic device
CN119514490A (en) Text rendering method, device, equipment, medium and product
US20230306670A1 (en)Game Engine-Based Shading Data Processing Method And Apparatus, And Electronic Device
US20140267380A1 (en)System and method for efficiently viewing a style
CN111913703B (en)Object editing method, device, electronic equipment and readable storage medium
CN110032712A (en)A kind of font rendering device and terminal
CN116933729A (en)Method, device, equipment and system for rendering characters in page

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20211126

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp