CN109118566A - Compression method, device, storage medium and the electronic device of textures - Google Patents

Compression method, device, storage medium and the electronic device of textures Download PDF

Info

Publication number
CN109118566A
CN109118566A CN201811070469.7A CN201811070469A CN109118566A CN 109118566 A CN109118566 A CN 109118566A CN 201811070469 A CN201811070469 A CN 201811070469A CN 109118566 A CN109118566 A CN 109118566A
Authority
CN
China
Prior art keywords
textures
pixel value
compressed
boundary coordinate
target area
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
CN201811070469.7A
Other languages
Chinese (zh)
Other versions
CN109118566B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201811070469.7A priority Critical patent/CN109118566B/en
Publication of CN109118566A publication Critical patent/CN109118566A/en
Application granted granted Critical
Publication of CN109118566B publication Critical patent/CN109118566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/22Cropping
    • 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

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of compression method of textures, device, storage medium and electronic devices.Wherein, this method comprises: textures to be compressed are divided into first object region and the second target area;Pixel value in first object region is compared with corresponding pixel value in the second target area;Textures to be compressed are compressed based on comparative result.The present invention solve in the related technology textures compression it is not rigorous, the technical issues of resulting in waste of resources.

Description

Compression method, device, storage medium and the electronic device of textures
Technical field
The present invention relates to textures fields, in particular to a kind of compression method of textures, device, storage medium and electricity Sub-device.
Background technique
Current 2D textures, the fine arts for convenience of figure and later period modification is gone out, after drawing is complete, reject in simple cut by textures Directly go out to scheme afterwards, nine palace information generally pass through fine arts software for drawing and record is marked, can draw textures middle region part Stretching range flags is nine grids area, and the nine general pixels in palace area are equal or close, facilitate stretching, in this way, original textures are smaller In the case of can also be applied to big region control, marginal portion keeps original pixel ratio to show details, and intermediate nine palace regions widen, Reduce textures resource in the case where, can the distortionless rendering for big control show.
Existing nine palace of the fine arts goes out to scheme, and alleviates the pixel overlapping waste of fine arts textures, but the weight of textures to a certain extent Double image element still remains repetition and waste, does not enjoy nine palace technology bring textures compression bonus fundamentally.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of compression method of textures, device, storage medium and electronic devices, at least to solve Certainly textures compression is not rigorous in the related technology, the technical issues of resulting in waste of resources.
According to an aspect of an embodiment of the present invention, a kind of compression method of textures is provided, comprising: by textures to be compressed It is divided into first object region and the second target area;Pixel value in first object region is corresponding with the second target area Pixel value be compared;Textures to be compressed are compressed based on comparative result.
According to another aspect of an embodiment of the present invention, a kind of compression set of textures is additionally provided, comprising: division module, For textures to be compressed to be divided into first object region and the second target area;Comparison module is used for first object region In pixel value be compared with corresponding pixel value in the second target area;Compression module, for compressing based on comparative result Textures to be compressed.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, is stored in the storage medium Computer program, wherein the computer program is arranged to execute method described in any of the above-described when operation.
According to another aspect of an embodiment of the present invention, a kind of electronic device, including memory and processor, institute are additionally provided It states and is stored with computer program in memory, the processor is arranged to run the computer program any of the above-described to execute Method described in.
It in embodiments of the present invention, will using first object region and the second target area is divided in textures to be compressed Pixel value in first object region and the second target area is compared, and compresses textures to be compressed using comparison result.Reach The purpose that pixel same or similar in first object region and the second target area can be merged, to realize It is effectively compressed the technical effect of textures, and then solves textures in the related technology and compresses not rigorous, the skill to result in waste of resources Art problem.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of hardware block diagram of the mobile terminal of the compression method of textures of the embodiment of the present invention;
Fig. 2 is the flow diagram of the compression method of textures according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of the textures original image provided according to embodiments of the present invention;
Fig. 4 is the schematic diagram in nine palace regions in the textures provided according to embodiments of the present invention;
Fig. 5 is the schematic diagram of the surface sweeping textures provided according to embodiments of the present invention;
Fig. 6 is the schematic diagram of the compressed textures provided according to embodiments of the present invention;
Fig. 7 is the textures schematic diagram of the preferred embodiment provided according to embodiments of the present invention;
Fig. 8 is the schematic diagram of the compression textures of the output provided according to embodiments of the present invention;
Fig. 9 is some original textures in this example;
Figure 10 is the textures after compressing in the present embodiment;
Figure 11 is the structural schematic diagram of the compression set of the textures provided according to embodiments of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
According to embodiments of the present invention, a kind of compression method embodiment of textures is provided, it should be noted that in attached drawing The step of process illustrates can execute in a computer system such as a set of computer executable instructions, although also, Logical order is shown in flow chart, but in some cases, it can be to be different from shown by sequence execution herein or retouch The step of stating.
Embodiment of the method provided by the embodiment of the present invention can be in mobile terminal, terminal or similar operation It is executed in device.For running on mobile terminals, Fig. 1 is a kind of movement of the compression method of textures of the embodiment of the present invention The hardware block diagram of terminal.As shown in Figure 1, mobile terminal 10 may include at one or more (only showing one in Fig. 1) It manages device 102 (processing unit that processor 102 can include but is not limited to Micro-processor MCV or programmable logic device FPGA etc.) Memory 104 for storing data, optionally, above-mentioned mobile terminal can also include the transmission device for communication function 106 and input-output equipment 108.It will appreciated by the skilled person that structure shown in FIG. 1 is only to illustrate, simultaneously The structure of above-mentioned mobile terminal is not caused to limit.For example, mobile terminal 10 may also include it is more than shown in Fig. 1 or less Component, or with the configuration different from shown in Fig. 1.
Memory 104 can be used for storing computer program, for example, the software program and module of application software, such as this hair The corresponding computer program of prompt generation method in bright embodiment, processor 102 are stored in memory 104 by operation Computer program realizes above-mentioned method thereby executing various function application and data processing.Memory 104 may include High speed random access memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or its His non-volatile solid state memory.In some instances, memory 104 can further comprise remotely setting relative to processor 102 The memory set, these remote memories can pass through network connection to mobile terminal 10.The example of above-mentioned network includes but not It is limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of mobile terminal 10 provide.In an example, transmitting device 106 includes a Network adaptation Device (Network Interface Controller, referred to as NIC), can be connected by base station with other network equipments to It can be communicated with internet.In an example, transmitting device 106 can for radio frequency (Radio Frequency, referred to as RF) module is used to wirelessly be communicated with internet.
Fig. 2 is the flow diagram of the compression method of textures according to an embodiment of the present invention, as shown in Fig. 2, this method packet Include following steps:
Textures to be compressed are divided into first object region and the second target area by step S202;
Step S204 compares the pixel value in first object region with corresponding pixel value in the second target area Compared with;
Step S206 compresses textures to be compressed based on comparative result.
Through the above steps, using first object region and the second target area is divided in textures to be compressed, by first Pixel value in target area and the second target area is compared, and compresses textures to be compressed using comparison result.Having reached can With the purpose for merging pixel same or similar in first object region and the second target area, to realize Effect compression textures technical effect, and then solve in the related technology textures compression it is not rigorous, the technology to result in waste of resources is asked Topic.
It should be noted that above-mentioned first object region can be nine palace regions in textures, i.e., textures to be compressed are in beauty The nine grids region including nine palace information being arranged in art software, nine palace information include the coordinate range in nine grids region and rise Beginning coordinate points;It is also possible to customized region, customized region can be the region of nine grids format.Second target area It is other regions in textures to be compressed other than first object region.
It should be noted that textures to be compressed are to carry out compression processing in the client.Client by textures to be compressed, It is loaded into client process memory, textures to be compressed is parsed using corresponding textures format graphics parsing library, obtains textures letter Cease matrix.Such as a length of M pixel of textures to be compressed, a height of N pixel, then memory textures size is M*N, will be had in client's end memory The textures information matrix of a M*N includes the coordinate information of textures to be compressed, and and coordinate information in textures information matrix Corresponding pixel value.
If having demarcated nine palace regions in textures to be compressed, then nine palace range informations of textures to be compressed are stored in In one table, and nine palace supplemental characteristics of the corresponding mark of this textures to be compressed are read, nine palace supplemental characteristics include patch to be compressed The sizes values of figure, the origin coordinates value in nine palace regions, the range size value in nine palace regions.According to the origin coordinates in nine palace regions Value, in the textures information matrix of reading, the pixel value of nine palace data of the textures to be compressed starting of record is read in inquiry, for example, It is x that nine palaces region, which originate abscissa, then in total textures information matrix of M*N, reads the value of information of x column, the value of information includes picture Element value.
In an alternative embodiment, in the following manner by the pixel value and the second target area in first object region Corresponding pixel value is compared in domain: determining first boundary coordinate in first object region, such as x column among the above;It obtains Pixel value corresponding with the first boundary coordinate, such as the pixel value of x column;The second boundary coordinate for determining the second target area, with x Column be it is adjacent, such as x-1 column;Obtain pixel value corresponding with the second boundary coordinate;By the corresponding pixel of the first boundary coordinate Value pixel value corresponding with the second boundary coordinate is compared.
It is equal or respectively less than pre- in the corresponding pixel value of the first boundary coordinate pixel value corresponding with the second boundary coordinate If in the case where threshold value, deleting the first boundary coordinate;The boundary that the second boundary coordinate is set as the first object region is sat Mark.Such as: if essentially equal from pixel x to both sides reading textures information matrix x-1 column position pixel value and x column pixel value, Then illustrate that nine palace textures can delete the value of x column since at x-1 from textures information matrix, textures information matrix is changed into M-1*N size.
Furthermore, it is necessary to the nine palace information in nine palace regions be changed, for example, the nine palace marginal position abscissas of setting newly are x-1 Place.Scheme among the above is repeated, until nine palace regions cannot be merged with neighboring pixel.Nine final palace regions of record Range information coordinate and internal nine palace regions pixel value, target textures internal storage data at this time is reduced to (M-a) * (N-b), A is that width always reduces pixel value, and b is that height always reduces pixel value, and output target textures replace textures to be compressed.
In an alternative embodiment, in the case where textures to be compressed are without nine palace information, in the following manner will First object region and the second target area are divided into textures to be compressed: in textures information matrix inquiry have it is identical or The coordinates regional of similar pixel value;Coordinates regional is determined as first object region and first object will be removed in textures to be compressed Remaining area except region is determined as the second target area.Such as: textures to be compressed are loaded into client's end memory, are used Textures correspond to the parsing of graphical analysis library, form textures information matrix.Secondly, in textures information matrix, find maximum identical Or similar pixel range, formation can clipping regions, i.e. first object region.Finally, this region is cut in textures information matrix, Clipping region information is recorded, nine palace data are formed, by the textures information matrix output after cutting at target textures, is replaced to be compressed Textures.
Embodiment in order to better understand the present invention does further solution to the present invention below in conjunction with a preferred embodiment It releases.
Set for artistic design be nine palace types textures to be compressed, handled using following manner, such as Fig. 3 institute Show, be the original image of textures to be compressed, the information of original image is as shown in table 1:
Originate x Originate y Inner width Interior height Beam overall It is total high
24 24 80 80 128 128
The corresponding nine palaces information of textures to be compressed is loaded from table 1, wherein original picture size is 128*128 pixel, row It since the 24th pixel, arranges since the 24th pixel, the pixel coverage of internal 80*80 is nine palace regions (corresponding among the above First object region).
It loading textures resource to be compressed and enters memory, the grey parts among Fig. 4 are nine palace vertex stretch zones of setting, That is nine palace regions.
The memory of textures to be compressed is parsed, parses library, such as PNG format figure using the corresponding picture of picture format Piece is parsed using the library LIBPNG, corresponds to RGB and transparence information value by parsing each pixel.To textures to be compressed Memory scans line by line, if pixel value is equal with perimeter data at nine palace position of textures, then illustrates this position combinable week Side pixel merges memory textures information, and records nine new palace positions.
As shown in Figure 5, will be from the 24th row of memory textures array, the 104th row lateral probe movement, the 24th arranges, and the 104th column are swept up and down It retouches, the position of identical numerical value gradually merges.Until neighboring pixel cannot be remerged, new textures output is modified into original nine palace Information.
By above step, textures are finally gone out into figure original size 128*128 pixel from the fine arts, have been compressed to 30*30 picture Element, as shown in fig. 6, the inner width of target textures and Nei Gao are compressed to the pixel region of 2*3.
Target textures are modified to information shown in table 2:
Originate x Originate y Inner width Interior height Beam overall It is total high
14 13 2 3 30 30
From the above, maximized to reduce nine palace pixel coverages by nine palace textures of script, so that it is entire to reach reduction The purpose of textures size.
In addition, practical fine arts textures are mostly not fully equal in nine palace pixel values, each channel RGBA may differ several A pixel, however human eye is generally difficult to discover for the change within several pixel differences, therefore, scanning algorithm among the above can be with It suitably softens terms, by modifying pixel difference range, more nine palaces region out can be compressed, reach bigger compression effectiveness.
It is not the textures in nine palaces originally for GUI design, nine palaces compression can also be carried out to it and generates best nine palaces letter Breath.
1) textures are read and enters memory, as shown in fig. 7, being one for showing the textures of bubble, the fine arts, which go out primitive, to be begun not having There are nine palace information, textures occupancy is huge, and original size is 286*132 pixel.
2) textures information is read line by line, and the equal region of maximum pixel is found in textures, rejects equal region, The starting for rejecting region is nine palace starting points, rejects the range size that range size is nine palaces.
3) textures after output reduction, export nine palace information, as shown in Figure 8.
The information of final target textures is as shown in table 3:
Originate x Originate y Inner width Interior height Beam overall It is total high
4 5 3 3 132 24
By above step, JiuGongTu can be converted by textures most of in project, to greatest extent by textures It repeats pixel to reject, reduces textures occupied space.
Fig. 9 is some original textures in this example, and Figure 10 is the textures after compressing in the present embodiment.It follows that By above step, it is original most effective that picture can be retained so that fine arts textures are found out same or similar pixel under line and are rejected Information achievees the purpose that effectively to reduce redundancy textures resource.Meanwhile this scheme also facilitates extension extension mono- to put up possibility in figure Nine palace region of duplicate removal is cut there are multiple, duplicate region total number can be cut and be merged, textures be reassembled into new nonstandard Quasi- rectangle textures record each small corresponding location of pixels in nine palace regions and size.Then, in rendering, read textures It is all can nine palace regions data information, address single nine palaces textures corresponding position.Herein optimize after, whole textures by change more Small, textures, which measure, greatly to be compressed, and is obtained highest pixel and is utilized.
The embodiment of the invention also provides a kind of compression set of textures, Figure 11 is the patch provided according to embodiments of the present invention The structural schematic diagram of the compression set of figure, as shown in figure 11, which includes:
Division module 1102, for textures to be compressed to be divided into first object region and the second target area;
Comparison module 1104, for the pixel value in the first object region is corresponding with second target area Pixel value be compared;
Compression module 1106, for compressing the textures to be compressed based on comparative result.
Through the above steps, using first object region and the second target area is divided in textures to be compressed, by first Pixel value in target area and the second target area is compared, and compresses textures to be compressed using comparison result.Having reached can With the purpose for merging pixel same or similar in first object region and the second target area, to realize Effect compression textures technical effect, and then solve in the related technology textures compression it is not rigorous, the technology to result in waste of resources is asked Topic.
It should be noted that above-mentioned first object region can be the nine grids region in textures, i.e., textures to be compressed exist Nine palace information being arranged in fine arts software;It is also possible to customized region.Second target area is removed in textures to be compressed Other regions except first object region.
It should be noted that textures to be compressed are to carry out compression processing in the client.Client by textures to be compressed, It is loaded into client process memory, textures to be compressed is parsed using corresponding textures format graphics parsing library, obtains textures letter Cease matrix.Assuming that a length of M pixel of textures to be compressed, a height of N pixel, then memory textures size is M*N, will be had in client's end memory The textures information matrix of a M*N.
In an alternative embodiment, comparison module includes: the first determination unit, for determining first object region First boundary coordinate;First acquisition unit, for obtaining pixel value corresponding with the first boundary coordinate;Second determination unit is used In the second boundary coordinate for determining the second target area;Second acquisition unit, for obtaining picture corresponding with the second boundary coordinate Element value, wherein the first boundary coordinate is adjacent with the second boundary coordinate;Comparing unit is used for the corresponding picture of the first boundary coordinate Element value pixel value corresponding with the second boundary coordinate is compared.For example, in the corresponding pixel value of the first boundary coordinate and second The corresponding pixel value of boundary coordinate is equal or respectively less than in the case where preset threshold, deletes the first boundary coordinate;By the second side Boundary's coordinate is set as the boundary coordinate in the first object region.Such as: textures information matrix is read such as from pixel x to both sides Fruit x-1 column position pixel value and x column pixel value are essentially equal, then illustrate that nine palace textures can be since at x-1, from textures information The value of x column is deleted in matrix, textures information matrix changes into M-1*N size.
Furthermore, it is necessary to the nine palace information in nine palace regions be changed, for example, the nine palace marginal position abscissas of setting newly are x-1 Place.Scheme among the above is repeated, until nine palace regions cannot be merged with neighboring pixel.Nine final palace regions of record Range information coordinate and internal nine palace regions pixel value, target textures internal storage data at this time is reduced to (M-a) * (N-b), A is that width always reduces pixel value, and b is that height always reduces pixel value, and output target textures replace textures to be compressed.
In an alternative embodiment, in the case where textures to be compressed are without nine palace information, in the following manner will First object region and the second target area are divided into textures to be compressed: in textures information matrix inquiry have it is identical or The coordinates regional of similar pixel value;Coordinates regional is determined as first object region and first object will be removed in textures to be compressed Remaining area except region is determined as the second target area.Such as: textures to be compressed are loaded into client's end memory, are used Textures correspond to the parsing of graphical analysis library, form textures information matrix.Secondly, in textures information matrix, find maximum identical Or similar pixel range, formation can clipping regions, i.e. first object region.Finally, this region is cut in textures information matrix, Clipping region information is recorded, nine palace data are formed, by the textures information matrix output after cutting at target textures, is replaced to be compressed Textures.
It should be noted that above-mentioned apparatus can be located in above-mentioned terminal shown in FIG. 1, but it is not limited to this.
The embodiments of the present invention also provide a kind of storage medium, computer program is stored in the storage medium, wherein The computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Optionally, in the present embodiment, above-mentioned storage medium can be set to store by executing based on following steps Calculation machine program:
Textures to be compressed are divided into first object region and the second target area by S1;
Pixel value in first object region is compared by S2 with corresponding pixel value in the second target area;
S3 compresses textures to be compressed based on comparative result.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (Read- Only Memory, referred to as ROM), it is random access memory (Random Access Memory, referred to as RAM), mobile hard The various media that can store computer program such as disk, magnetic or disk.
The embodiments of the present invention also provide a kind of electronic device, including memory and processor, stored in the memory There is computer program, which is arranged to run computer program to execute the step in any of the above-described embodiment of the method Suddenly.
Optionally, above-mentioned electronic device can also include transmission device and input-output equipment, wherein the transmission device It is connected with above-mentioned processor, which connects with above-mentioned processor.
Optionally, in the present embodiment, above-mentioned processor can be set to execute following steps by computer program:
Textures to be compressed are divided into first object region and the second target area by S1;
Pixel value in first object region is compared by S2 with corresponding pixel value in the second target area;
S3 compresses textures to be compressed based on comparative result.
Optionally, the specific example in the present embodiment can be with reference to described in above-described embodiment and optional embodiment Example, details are not described herein for the present embodiment.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of compression method of textures characterized by comprising
Textures to be compressed are divided into first object region and the second target area;
Pixel value in the first object region is compared with corresponding pixel value in second target area;
The textures to be compressed are compressed based on comparative result.
2. the method according to claim 1, wherein by the pixel value and described the in the first object region Corresponding pixel value, which is compared, in two target areas includes:
Determine first boundary coordinate in the first object region;
Obtain pixel value corresponding with first boundary coordinate;
Determine the second boundary coordinate of second target area;
Obtain pixel value corresponding with the second boundary coordinate, wherein first boundary coordinate and the second boundary are sat It marks adjacent;
The corresponding pixel value of first boundary coordinate pixel value corresponding with the second boundary coordinate is compared.
3. according to the method described in claim 2, it is characterized in that, result compresses the textures packet to be compressed based on the comparison It includes:
It is equal or small in the corresponding pixel value of first boundary coordinate pixel value corresponding with the second boundary coordinate In the case where preset threshold, first boundary coordinate is deleted;
Set the second boundary coordinate to the boundary coordinate in the first object region.
4. according to the method described in claim 3, it is characterized in that, setting the first object for the second boundary coordinate After the boundary coordinate in region, the method also includes:
The coordinate range for recalculating the textures to be compressed, obtains targeted compression textures, wherein the targeted compression textures Coordinate range is less than the coordinate range of the textures to be compressed;
Export the targeted compression textures.
5. the method according to claim 1, wherein the textures to be compressed are divided into the first object Before region and second target area, the method also includes:
Determine the textures format of the textures to be compressed;
The textures to be compressed are parsed using with the textures format, obtain textures information matrix, wherein the textures information square It include: the coordinate of the pixel in the first object region and the pixel value of the pixel in battle array.
6. according to the method described in claim 5, it is characterized in that, by the first object is divided into the textures to be compressed Region and second target area include:
Inquiry has the coordinates regional of same or similar pixel value in the textures information matrix;
The coordinates regional is determined as the first object region and the first object will be removed in the textures to be compressed Remaining area except region is determined as second target area.
7. a kind of compression set of textures characterized by comprising
Division module, for textures to be compressed to be divided into first object region and the second target area;
Comparison module, for by pixel value and the corresponding pixel value in second target area in the first object region It is compared;
Compression module, for compressing the textures to be compressed based on comparative result.
8. device according to claim 7, which is characterized in that the comparison module includes:
First determination unit, for determining first boundary coordinate in the first object region;
First acquisition unit, for obtaining pixel value corresponding with first boundary coordinate;
Second determination unit, for determining the second boundary coordinate of second target area;
Second acquisition unit, for obtaining pixel value corresponding with the second boundary coordinate, wherein first boundary coordinate It is adjacent with the second boundary coordinate;
Comparing unit is used for the corresponding pixel value of first boundary coordinate pixel value corresponding with the second boundary coordinate It is compared.
9. a kind of storage medium, which is characterized in that be stored with computer program in the storage medium, wherein the computer Program is arranged to execute method described in any one of claim 1 to 6 when operation.
10. a kind of electronic device, including memory and processor, which is characterized in that be stored with computer journey in the memory Sequence, the processor are arranged to run the computer program to execute side described in any one of claim 1 to 6 Method.
CN201811070469.7A 2018-09-13 2018-09-13 Compression method and device for mapping, storage medium and electronic device Active CN109118566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811070469.7A CN109118566B (en) 2018-09-13 2018-09-13 Compression method and device for mapping, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811070469.7A CN109118566B (en) 2018-09-13 2018-09-13 Compression method and device for mapping, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN109118566A true CN109118566A (en) 2019-01-01
CN109118566B CN109118566B (en) 2023-08-22

Family

ID=64858440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811070469.7A Active CN109118566B (en) 2018-09-13 2018-09-13 Compression method and device for mapping, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN109118566B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110689590A (en) * 2019-09-23 2020-01-14 网易(杭州)网络有限公司 Compression coding method and device for map and mobile terminal equipment
CN113256485A (en) * 2021-05-21 2021-08-13 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN113706640A (en) * 2021-08-05 2021-11-26 网易(杭州)网络有限公司 Method, device, storage medium and electronic equipment for compressing image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016148516A1 (en) * 2015-03-16 2016-09-22 스타십벤딩머신 주식회사 Image compression method and image compression apparatus
CN107346546A (en) * 2017-07-17 2017-11-14 京东方科技集团股份有限公司 A kind of image processing method and device
CN107886552A (en) * 2016-09-29 2018-04-06 网易(杭州)网络有限公司 Stick picture disposing method and apparatus
CN108062758A (en) * 2018-02-27 2018-05-22 山东师范大学 A kind of crowd based on image segmentation algorithm generates emulation mode and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016148516A1 (en) * 2015-03-16 2016-09-22 스타십벤딩머신 주식회사 Image compression method and image compression apparatus
CN107886552A (en) * 2016-09-29 2018-04-06 网易(杭州)网络有限公司 Stick picture disposing method and apparatus
CN107346546A (en) * 2017-07-17 2017-11-14 京东方科技集团股份有限公司 A kind of image processing method and device
CN108062758A (en) * 2018-02-27 2018-05-22 山东师范大学 A kind of crowd based on image segmentation algorithm generates emulation mode and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110689590A (en) * 2019-09-23 2020-01-14 网易(杭州)网络有限公司 Compression coding method and device for map and mobile terminal equipment
CN110689590B (en) * 2019-09-23 2023-04-07 网易(杭州)网络有限公司 Compression coding method and device for map and mobile terminal equipment
CN113256485A (en) * 2021-05-21 2021-08-13 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN113256485B (en) * 2021-05-21 2024-01-30 百果园技术(新加坡)有限公司 Image stretching method, device, electronic equipment and storage medium
CN113706640A (en) * 2021-08-05 2021-11-26 网易(杭州)网络有限公司 Method, device, storage medium and electronic equipment for compressing image

Also Published As

Publication number Publication date
CN109118566B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
KR102690193B1 (en) Binary entropy coding method and device for point cloud
CN107609587B (en) Multi-class multi-view data generation method for generating countermeasure network based on deep convolution
CN109118566A (en) Compression method, device, storage medium and the electronic device of textures
CN110443140B (en) Text positioning method, device, computer equipment and storage medium
CN110990516B (en) Map data processing method, device and server
US7386166B2 (en) Systems and methods for connecting regions image data having similar characteristics
CN105979101B (en) System for selectively pushing unread messages
CN108932745B (en) Image drawing method and device, terminal equipment and computer readable storage medium
US9153042B2 (en) Image processing apparatus
CN110599554A (en) Method and device for identifying face skin color, storage medium and electronic device
CN107123077B (en) The rendering method and device of object
CN107027069A (en) Processing method, device and system, storage medium and the processor of view data
US11902522B2 (en) Character restoration method and apparatus, storage medium, and electronic device
CN114358252A (en) Operation execution method and device in target neural network model and storage medium
CN106251316B (en) Method and device for repairing photos
US8488894B2 (en) Method and system for dot-matrix font data compression and decompression
CN108198192A (en) A kind of quick human body segmentation's method of high-precision based on deep learning
CN107526541A (en) Data processing method and device
KR100630732B1 (en) Parallel thinning process and device
CN106504293B (en) Fingerprint image compression method and device
CN108597000A (en) The method and device of Image Rendering
CN113256484A (en) Method and device for stylizing image
Tan et al. Systematic analysis and removal of circular artifacts for stylegan
CN106775335A (en) The method and mobile terminal of similar picture dragging sequence
KR102371145B1 (en) Apparatus for Image Synthesis and Driving Method Thereof

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