CN111161127A - Picture resource rendering optimization method - Google Patents

Picture resource rendering optimization method Download PDF

Info

Publication number
CN111161127A
CN111161127A CN201911319419.2A CN201911319419A CN111161127A CN 111161127 A CN111161127 A CN 111161127A CN 201911319419 A CN201911319419 A CN 201911319419A CN 111161127 A CN111161127 A CN 111161127A
Authority
CN
China
Prior art keywords
pixel
picture
atlas
effective pixel
effective
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
Application number
CN201911319419.2A
Other languages
Chinese (zh)
Other versions
CN111161127B (en
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.)
Shenzhen Haituo Times Technology Co Ltd
Original Assignee
Shenzhen Haituo Times 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 Shenzhen Haituo Times Technology Co Ltd filed Critical Shenzhen Haituo Times Technology Co Ltd
Priority to CN201911319419.2A priority Critical patent/CN111161127B/en
Publication of CN111161127A publication Critical patent/CN111161127A/en
Application granted granted Critical
Publication of CN111161127B publication Critical patent/CN111161127B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the application discloses a picture resource rendering optimization method, which comprises the following steps: loading picture resources; performing pixel point scanning on the picture resource, stopping when an effective pixel point is met, and cutting off an invalid pixel area of the picture resource to obtain a residual pixel atlas; scanning the residual pixel atlas to find effective pixel points; performing logic processing on pixel points in the residual pixel atlas to calculate an effective pixel area, marking the effective pixel area, and deleting the effective pixel area when an invalid pixel area is encountered to obtain an effective pixel atlas; recording basic information of the effective pixel atlas; and cutting the effective pixel picture set into a plurality of pixel sub-picture sets according to the basic information of the effective pixel picture set and recording the picture set relation of each pixel sub-picture set. The method and the device for loading the GPU resources can greatly reduce the time required by loading the resources and reduce the resource rendering pressure of the GPU.

Description

Picture resource rendering optimization method
Technical Field
The application relates to the technical field of picture processing, in particular to a picture resource rendering optimization method.
Background
At present, the requirements of games and various software industries on picture resources and rendering efficiency are higher and higher, but the picture resource processing schemes cannot be processed extremely. The processing and rendering of the current popular pictures are generally whole rendering or slice rendering, the slice effect reduces the problem of loading amount, but the problem of rendering amount is not improved.
The above background disclosure is only for the purpose of assisting in understanding the inventive concepts and technical solutions of the present application and does not necessarily pertain to the prior art of the present application, and should not be used to assess the novelty and inventive step of the present application in the absence of explicit evidence to suggest that such matter has been disclosed at the filing date of the present application.
Disclosure of Invention
The application provides a picture resource rendering optimization method which can greatly reduce the time required by resource loading and reduce the resource rendering pressure of a GPU.
In a first aspect, the present application provides a method for optimizing rendering of picture resources, including:
loading picture resources;
performing pixel point scanning on the picture resource, stopping when an effective pixel point is met, and cutting off an invalid pixel area of the picture resource to obtain a residual pixel atlas;
scanning the residual pixel atlas to find effective pixel points; performing logic processing on pixel points in the residual pixel atlas to calculate an effective pixel area, marking the effective pixel area, and deleting the effective pixel area when an invalid pixel area is encountered to obtain an effective pixel atlas; recording basic information of the effective pixel atlas;
and cutting the effective pixel picture set into a plurality of pixel sub-picture sets according to the basic information of the effective pixel picture set and recording the picture set relation of each pixel sub-picture set.
In some preferred embodiments, the sub-sets of pixels are combined into a specified graph according to the graph set relationships.
In some preferred embodiments, the performing pixel point scanning on the picture resource specifically includes: and scanning pixel points of the picture resources from left to right and from top to bottom.
In some preferred embodiments, the scanning the remaining pixel atlas to find valid pixel points specifically includes: and scanning the residual pixel atlas to find effective pixel points from left to right and from top to bottom.
In some preferred embodiments, the basic information of the active pixel atlas includes an atlas location, an atlas width dimension, and an atlas height dimension.
In some preferred embodiments, the inactive pixel region is a transparent pixel region.
In some preferred embodiments, the valid pixel is a pixel whose transparent channel is not 0 and which is valid.
In some preferred embodiments, the loading picture resource specifically includes: and loading the picture resources by adopting a fileestream flow method.
In some preferred embodiments, according to the basic information of the effective pixel atlas, the effective pixel atlas is cut into a plurality of pixel sub-atlas and the atlas relationship of each pixel sub-atlas is recorded, specifically: and according to the attribute of the configuration file, cutting the effective pixel image set into a plurality of pixel sub-image sets according to the basic information of the effective pixel image set, and forming the image configuration file containing the image set relations of the plurality of pixel sub-image sets and the pixel sub-image sets.
In some preferred embodiments, according to the atlas relationship, the sub-atlas of pixels is used to combine into a designated graph, specifically: and reading the picture configuration file, and combining the pixel sub-picture set into a specified graph.
In a second aspect, the present application provides a computer-readable storage medium: the computer-readable storage medium has stored therein program instructions that, when executed by a processor of a computer, cause the processor to perform the above-described method.
Compared with the prior art, the beneficial effects of the embodiment of the application are as follows:
the positions of the pixel points of the image resources are logically judged, useless resources are removed, the resources which are really needed to be used are left, and the resources are cut into small blocks, so that the GPU does not need to process the useless resources, and the aim of optimization is fulfilled; the saved resources can be optimized to load more animations or special effects. The method and the device for processing the image can greatly reduce the time required by loading the resources and the resource rendering pressure of the GPU, are particularly suitable for projects with high GPU rendering pressure and poor network states, and can better solve the problem of image rendering.
Drawings
Fig. 1 is a schematic flowchart of an application scenario of a method for optimizing rendering of picture resources according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another application scenario of the method for optimizing rendering of picture resources according to an embodiment of the present application;
FIG. 3 illustrates a picture resource of one embodiment of the present application;
FIG. 4 illustrates the processing of a picture resource at step A2 according to an embodiment of the present application;
FIG. 5 illustrates the processing of a picture resource at step A4 according to an embodiment of the present application;
FIG. 6 illustrates the content contained in a picture profile according to one embodiment of the present application;
FIG. 7 illustrates the processing of a picture resource at step A5 according to an embodiment of the present application;
FIG. 8 illustrates the processing of picture resources by the main programs and applications of one embodiment of the present application;
fig. 9 illustrates an application manner of the method for optimizing rendering of picture resources according to an embodiment of the present application.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the embodiments of the present application more clearly apparent, the present application is further described in detail below with reference to fig. 1 to 9 and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like, refer to an orientation or positional relationship indicated in the drawings that is solely for the purpose of facilitating the description of the embodiments and simplifying the description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be considered as limiting the application.
Referring to fig. 2, the present embodiment provides a method for optimizing rendering of picture resources, which includes steps a1 through a 5. Wherein, the steps A1 to A4 are executed by the main program; step a5 is performed by the application.
And step A1, loading picture resources.
In this embodiment, the picture resource is loaded by using a fileestream stream method. Referring to fig. 3, the picture resources may also be referred to as picture materials required for development. Referring to FIG. 8, a picture resource is an input as a main program; and loading is realized through a resource loading module of the main program.
And step A2, scanning pixel points of the picture resources, stopping when effective pixel points are met, and cutting off the invalid pixel area of the picture resources to obtain a residual pixel atlas.
In this embodiment, the effective pixel is a pixel whose transparent channel is not 0 and is an effective pixel, such as the pixel forming a character in fig. 3; the inactive pixel region is a transparent pixel region. Referring to fig. 4, pixel scanning is performed on the picture resources from left to right and from top to bottom, and when an effective pixel is encountered, the scanning is stopped, and the invalid transparent pixel region of the picture frame is cut off.
Step A3, scanning the residual pixel atlas to find effective pixel points; performing logic processing on pixel points in the residual pixel atlas, calculating an effective pixel area, marking the effective pixel area, and deleting the ineffective pixel area to obtain an effective pixel atlas; basic information of the active pixel atlas is recorded.
The invalid pixel region is relative to the valid pixel region, for example, the blank region in fig. 4 is the invalid pixel region.
In this embodiment, the remaining pixel atlas is scanned to find valid pixel points from left to right and from top to bottom. And performing logic processing on the pixel points in the residual pixel map set, such as: the valid pixel is 1 and the invalid pixel is 0. And calculating an effective pixel area, marking the effective pixel area, and deleting the ineffective pixel area to obtain an effective pixel atlas containing effective pixel points. Adding basic information of the effective pixel atlas, such as the position of the atlas, the width size of the atlas and the height size of the atlas, into a configuration library, thereby completing recording the basic information of the effective pixel atlas.
Step A4, cutting the effective pixel atlas into several pixel sub-atlas and recording the atlas relation of each pixel sub-atlas according to the basic information of the effective pixel atlas.
Referring to fig. 5, the effective pixel atlas is cut into a plurality of pixel sub-atlas according to the attribute of the configuration file and the basic information of the effective pixel atlas, and referring to fig. 6, a picture configuration file containing the atlas relations of the plurality of pixel sub-atlas and each pixel sub-atlas is formed; specifically, referring to fig. 8, the effective pixel atlas is decomposed into a plurality of pixel sub-atlases by the resource decomposition logic module of the main program. Referring to fig. 8, a picture profile is output as a main program; and outputting the picture configuration file through a resource output module of the main program.
Wherein, the pixel sub-set has a set minimum width and a set minimum height.
And step A5, combining the sub-picture element sets into a designated graph according to the relation of the picture sets.
Referring to fig. 7, the application program calls the tool development logic block to read the picture configuration file and combine the required resources, i.e., pixel sub-aggregates, into the required graphics, i.e., the designated graphics, and then displays the designated graphics on the display layer. That is, the main program generates a picture configuration file, and the application program forms a designated graph using the picture configuration file.
In the present embodiment, referring to fig. 2, step a1 to step a5 are all completed by the same software. In other embodiments, referring to FIG. 1, steps A1 through A4 are performed by one piece of software, and step A5 is performed by another piece of software.
According to the method, the positions of the pixel points of the picture resources are logically judged, dregs are removed, essence of the dregs is reserved, useless blank resources are removed, resources which are really needed to be used are reserved, and the resources are cut into small blocks, so that the GPU does not need to process the useless resources, and the purpose of optimization is achieved; the saved resources can be optimized to load more animations or special effects and the like, so that the display effect is more glaring. The method and the device can greatly reduce the time required by resource loading and the resource rendering pressure of the GPU, are particularly suitable for projects with high GPU rendering pressure and poor network states, and can better solve the problem of picture rendering.
Referring to fig. 9, with the method for optimizing rendering of picture resources according to this embodiment, processing needs to be started before a project is manufactured, and the picture processing speed is relatively high; after the processing is finished, the corresponding project is imported, and the assembly logic contained in the picture configuration file of the embodiment is referred to in the project, so that the generation of the atlas is realized.
Those skilled in the art will appreciate that all or part of the processes of the embodiments methods may be performed by a computer program, which may be stored in a computer-readable storage medium and executed to perform the processes of the embodiments methods. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
The foregoing is a further detailed description of the present application in connection with specific/preferred embodiments and is not intended to limit the present application to that particular description. For a person skilled in the art to which the present application pertains, several alternatives or modifications to the described embodiments may be made without departing from the concept of the present application, and these alternatives or modifications should be considered as falling within the scope of the present application.

Claims (10)

1. A picture resource rendering optimization method is characterized by comprising the following steps:
loading picture resources;
performing pixel point scanning on the picture resource, stopping when an effective pixel point is met, and cutting off an invalid pixel area of the picture resource to obtain a residual pixel atlas;
scanning the residual pixel atlas to find effective pixel points; performing logic processing on pixel points in the residual pixel atlas to calculate an effective pixel area, marking the effective pixel area, and deleting the effective pixel area when an invalid pixel area is encountered to obtain an effective pixel atlas; recording basic information of the effective pixel atlas;
and cutting the effective pixel picture set into a plurality of pixel sub-picture sets according to the basic information of the effective pixel picture set and recording the picture set relation of each pixel sub-picture set.
2. The method for optimizing rendering of picture resources according to claim 1, further comprising: and combining the pixel sub-collections into a designated graph according to the graph collection relation.
3. The method for optimizing the rendering of picture resources according to claim 1, wherein the scanning of the pixel points of the picture resources specifically comprises: and scanning pixel points of the picture resources from left to right and from top to bottom.
4. The method of claim 1, wherein the scanning the remaining pixel atlas to find valid pixels is specifically: and scanning the residual pixel atlas to find effective pixel points from left to right and from top to bottom.
5. The method for optimizing rendering of picture resources according to claim 1, wherein: the basic information of the active pixel atlas includes an atlas location, an atlas width dimension, and an atlas height dimension.
6. The method for optimizing rendering of picture resources according to claim 1, wherein: the invalid pixel region is a transparent pixel region; the effective pixel points are pixel point transparent channels which are not 0 and are effective pixel points.
7. The method for optimizing rendering of picture resources according to claim 1, wherein the loading of the picture resources is specifically: and loading the picture resources by adopting a fileestream flow method.
8. The method for optimizing picture resource rendering according to claim 2, wherein the method for cutting out a plurality of pixel sub-sets from the effective pixel set and recording an image set relationship of each pixel sub-set according to the basic information of the effective pixel set specifically comprises: and according to the attribute of the configuration file, cutting the effective pixel image set into a plurality of pixel sub-image sets according to the basic information of the effective pixel image set, and forming the image configuration file containing the image set relations of the plurality of pixel sub-image sets and the pixel sub-image sets.
9. The method for optimizing the rendering of picture resources according to claim 8, wherein the pixel sub-sets are combined into a designated graph according to the graph set relationship, specifically: and reading the picture configuration file, and combining the pixel sub-picture set into a specified graph.
10. A computer-readable storage medium, comprising: the computer-readable storage medium has stored therein program instructions which, when executed by a processor of a computer, cause the processor to carry out the method according to any one of claims 1 to 9.
CN201911319419.2A 2019-12-19 2019-12-19 Picture resource rendering optimization method Active CN111161127B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911319419.2A CN111161127B (en) 2019-12-19 2019-12-19 Picture resource rendering optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911319419.2A CN111161127B (en) 2019-12-19 2019-12-19 Picture resource rendering optimization method

Publications (2)

Publication Number Publication Date
CN111161127A true CN111161127A (en) 2020-05-15
CN111161127B CN111161127B (en) 2023-06-30

Family

ID=70557431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911319419.2A Active CN111161127B (en) 2019-12-19 2019-12-19 Picture resource rendering optimization method

Country Status (1)

Country Link
CN (1) CN111161127B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408657A (en) * 2021-07-14 2021-09-17 福建天晴在线互动科技有限公司 Method and system for dynamically planning and merging game atlas
CN116385614A (en) * 2023-03-29 2023-07-04 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9105113B1 (en) * 2004-12-15 2015-08-11 Nvidia Corporation Method and system for efficiently rendering circles
CN106126140A (en) * 2016-06-16 2016-11-16 北京金山安全软件有限公司 Method and device for rendering characters and electronic equipment
CN108960408A (en) * 2018-06-12 2018-12-07 杭州米绘科技有限公司 A kind of stylized system and method towards ultra high-definition resolution ratio pattern
CN109389659A (en) * 2018-09-11 2019-02-26 广州视源电子科技股份有限公司 The rendering method of mathematical formulae, device, storage medium and terminal device in PPT
CN109493410A (en) * 2018-09-25 2019-03-19 叠境数字科技(上海)有限公司 A kind of real-time rendering method of gigabit grade pixel image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9105113B1 (en) * 2004-12-15 2015-08-11 Nvidia Corporation Method and system for efficiently rendering circles
CN106126140A (en) * 2016-06-16 2016-11-16 北京金山安全软件有限公司 Method and device for rendering characters and electronic equipment
CN108960408A (en) * 2018-06-12 2018-12-07 杭州米绘科技有限公司 A kind of stylized system and method towards ultra high-definition resolution ratio pattern
CN109389659A (en) * 2018-09-11 2019-02-26 广州视源电子科技股份有限公司 The rendering method of mathematical formulae, device, storage medium and terminal device in PPT
CN109493410A (en) * 2018-09-25 2019-03-19 叠境数字科技(上海)有限公司 A kind of real-time rendering method of gigabit grade pixel image

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408657A (en) * 2021-07-14 2021-09-17 福建天晴在线互动科技有限公司 Method and system for dynamically planning and merging game atlas
CN113408657B (en) * 2021-07-14 2024-01-30 福建天晴在线互动科技有限公司 Method and system for dynamic planning and merging of game atlas
CN116385614A (en) * 2023-03-29 2023-07-04 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization
CN116385614B (en) * 2023-03-29 2024-03-01 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization

Also Published As

Publication number Publication date
CN111161127B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
US20220139353A1 (en) Display method, electronic device, and non-transitory computer-readable storage medium
US20220139352A1 (en) Method and Device for Image Composition, Electronic Device and Storage Medium
CN108021671B (en) Page transparent processing method and device
CN111161127A (en) Picture resource rendering optimization method
CN109636885B (en) Sequential frame animation production method and system for H5 page
KR101810019B1 (en) Animation data generating method, apparatus, and electronic device
CN116306494A (en) Text rendering method, text rendering device, text rendering equipment, storage medium and text rendering product
CN111968200A (en) GIF file generation method based on hand-drawn video
JP5254250B2 (en) Method and system for generating boundaries in the process of rasterizing vector graphics, and method for manufacturing the system
CN111787240A (en) Video generation method, device and computer readable storage medium
CN105389308B (en) Webpage display processing method and device
CN102932607A (en) Caption graphics and text information generation method and device
CN110264543B (en) Frame drawing method and device of spliced picture and storage medium
US8457432B2 (en) High information density of reduced-size images of web pages
CN111589111A (en) Image processing method, device, equipment and storage medium
CN111477183A (en) Reader refresh method, computing device, and computer storage medium
CN114625997A (en) Page rendering method and device, electronic equipment and computer readable medium
CN103839217A (en) Watermark image realization method
CN111142858A (en) Engine device
CN111951367B (en) Character rendering method, character processing method and device
CN111198858A (en) File processing method and device, computer storage medium and terminal
CN117911578B (en) Text rendering method and device, computer equipment and storage medium
CN116578376A (en) Open format document OFD page display method, device and equipment
CN112416191B (en) Screen recording processing method and device, computer equipment and computer readable storage medium
CN115375818A (en) Image rendering method and device, electronic equipment and storage medium

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