CN106485657B - Picture processing method and device - Google Patents
Picture processing method and device Download PDFInfo
- Publication number
- CN106485657B CN106485657B CN201610833679.1A CN201610833679A CN106485657B CN 106485657 B CN106485657 B CN 106485657B CN 201610833679 A CN201610833679 A CN 201610833679A CN 106485657 B CN106485657 B CN 106485657B
- Authority
- CN
- China
- Prior art keywords
- picture
- size information
- stretching
- apk
- pixel point
- 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.)
- Expired - Fee Related
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 11
- 238000000034 method Methods 0.000 claims abstract description 18
- 238000004806 packaging method and process Methods 0.000 claims abstract description 11
- 238000009434 installation Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 11
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000011900 installation process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013585 weight reducing agent Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Telephone Function (AREA)
- Information Transfer Between Computers (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a picture processing method and a picture processing device, which are used for achieving the purpose of reducing the resource data volume of apk. The method comprises the following steps: compressing the first picture according to a preset size to obtain a second picture; packaging the second picture to an installation program file apk of an application; when a request for calling the second picture is received, obtaining picture size information corresponding to the request; and stretching the second picture according to the picture size information.
Description
Technical Field
The invention relates to the technical field of internet application, in particular to a picture processing method and device.
Background
apk is always concerned by wide users as a file format of an android system installation package, and the more bulky apk is, the more traffic they consume in the downloading and installation process, and the longer the installation waiting time is. For the product itself, this means that the download conversion rate will be lower, because in the contest, the user has more chance to select the one with the best experience, the most functions, the best performance, and the smallest package; it is an opportunity for development to optimize the improved techniques.
Disclosure of Invention
The invention provides a picture processing method and a picture processing device, which are used for achieving the purpose of reducing the resource data volume of apk.
The invention provides a picture processing method, which comprises the following steps:
compressing the first picture according to a preset size to obtain a second picture;
packaging the second picture to an installation program file apk of an application;
when a request for calling the second picture is received, obtaining picture size information corresponding to the request;
and stretching the second picture according to the picture size information.
In an embodiment of the present invention, performing stretching processing on the second picture according to the picture size information includes:
and stretching the second picture based on pixel points according to the picture size information.
In an embodiment of the present invention, stretching the second picture based on a pixel point according to the picture size information includes:
determining pixel point stretching areas of the second picture and the times of copying the pixel point stretching areas of the second picture according to the picture size information;
and copying the times of the pixel point stretching areas of the second picture, and redrawing the picture to obtain a third picture stretched from the second picture.
In an embodiment of the present invention, the pixel point stretching region of the second picture is a pixel point region where 1 is multiplied by 1.
In an embodiment of the present invention, the method further includes:
installing the apk of the application on the mobile terminal;
and after the second picture is stretched according to the picture size information, storing the stretched picture at the appointed position of the mobile terminal.
The present invention also provides an image processing apparatus, including:
the first processing module is used for compressing the first picture according to a preset size to obtain a second picture;
the packaging module is used for packaging the second picture to an application installation program file apk;
the acquisition module is used for acquiring the picture size information corresponding to the request when receiving the request for calling the second picture;
and the second processing module is used for stretching the second picture according to the picture size information.
In an embodiment of the present invention, the second processing module is further configured to:
and stretching the second picture based on pixel points according to the picture size information.
In an embodiment of the present invention, the second processing module is further configured to:
determining pixel point stretching areas of the second picture and the times of copying the pixel point stretching areas of the second picture according to the picture size information;
and copying the times of the pixel point stretching areas of the second picture, and redrawing the picture to obtain a third picture stretched from the second picture.
In an embodiment of the present invention, the pixel point stretching region of the second picture is a pixel point region where 1 is multiplied by 1.
In an embodiment of the present invention, the apparatus further includes:
the installation module is used for installing the apk of the application on the mobile terminal;
and the storage module is used for storing the stretched picture at the specified position of the mobile terminal after the second processing module stretches the second picture according to the picture size information.
In the embodiment of the invention, the first picture is compressed according to the preset size to obtain a second picture; packaging the second picture to an installation program file apk of an application; when a request for calling the second picture is received, obtaining picture size information corresponding to the request; and stretching the second picture according to the picture size information. Therefore, the method and the device can achieve the purpose of reducing the resource data volume of the apk.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flowchart illustrating a method for processing a picture according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing pictures according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present invention; and
fig. 4 is a schematic structural diagram of a picture processing apparatus according to another embodiment of the invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Fig. 1 is a flowchart illustrating a picture processing method according to an embodiment of the present invention, where the method may be applied to a terminal such as a smart phone, a smart television, and a smart watch, and the method may include the following steps S11-S14.
And step S11, compressing the first picture according to a preset size to obtain a second picture.
In this step, the first picture may be an icon, a button, a page, etc. of the application, which is not limited by the present invention.
Step S12, package the second picture to the installer file apk of the application.
In this step, the compressed second picture is packed into the applied apk, so that the resource data amount of the apk can be reduced, and the apk can be slimmed.
In step S13, when a request for calling a second picture is received, picture size information corresponding to the request is acquired.
In step S14, the second picture is stretched according to the picture size information.
In this step, when a request for calling the second picture is received, the size information of the picture can be analyzed from the request, and then the second picture is stretched according to the size information of the picture and provided to the requester who initiates the request.
In the embodiment of the invention, the first picture is compressed according to the preset size to obtain a second picture; packaging the second picture to an installation program file apk of an application; when a request for calling the second picture is received, obtaining picture size information corresponding to the request; and stretching the second picture according to the picture size information. Therefore, the method and the device can achieve the purpose of reducing the resource data volume of the apk.
In step S14, the second picture is stretched according to the picture size information, and an optional scheme is provided in the embodiment of the present invention, that is, the second picture is stretched based on the pixel points according to the picture size information.
Further, stretching the second picture based on the pixel points according to the picture size information may include the following steps a1-a 2.
Step A1, determining the pixel point stretching area of the second picture and the times of copying the pixel point stretching area of the second picture according to the picture size information.
And step A2, copying the pixel point stretching area of the second picture for the times, and redrawing the picture to obtain a third picture stretched by the second picture.
In an alternative embodiment of the present invention, the second picture may be stretched using a compression tool, and the compression tool may be configured with a stretchable coordinate range. For example, for one picture, the maximum stretchable coordinate range is 100 pixels. Further, 10 pixels out of 100 pixels may be stretched. Here, 10 or 100 pixels means a region of one length or width.
In an optional embodiment of the present invention, the pixel point stretching region of the second picture may be a pixel point region where 1 is multiplied by 1.
In an alternative embodiment of the present invention, an apk of an application may also be installed on the mobile terminal, so that after the step S14 performs stretching processing on the second picture according to the picture size information, the stretched picture may be saved in a designated position of the mobile terminal for the next use.
In an alternative embodiment of the invention, if one or more corners of the first panel are curved, then upon stretching, the curved portion generally does not stretch and the regions outside the curved portion are stretchable regions.
The following describes the implementation process of the image processing method according to the present invention in detail by using a specific embodiment. Fig. 2 is a flowchart illustrating a picture processing method according to another embodiment of the present invention, where the method may be applied to a terminal such as a smart phone or a smart tv, and the method may include the following steps S21-S26.
And step S21, compressing the first picture according to a preset size to obtain a second picture.
In this step, the first picture may be an icon, a button, a page, etc. of the application, which is not limited by the present invention.
Step S22, package the second picture to the installer file apk of the application.
In this step, the compressed second picture is packed into the applied apk, so that the resource data amount of the apk can be reduced, and the apk can be slimmed.
Step S23, install the apk of the application on the mobile terminal.
In step S24, when a request for calling a second picture is received, picture size information corresponding to the request is acquired.
Step S25, determining a pixel point stretching region of the second picture and the number of times of copying the pixel point stretching region of the second picture according to the picture size information.
In this step, the pixel point stretching region of the second picture may be a pixel point region where 1 is multiplied by 1.
And step S26, copying the pixel point stretching area of the second picture for the times, and redrawing the picture to obtain a third picture stretched by the second picture.
The embodiment of the invention compresses the apk picture, can reduce the resource data amount of the apk, and realizes the weight reduction of the apk. When the method and the device are used, the compressed picture can be stretched according to actual conditions so as to be stretched to a proper size, and various requirements are met. Thus, the apk does not need to store pictures of various sizes, and the resource data amount of the apk can be further reduced.
It should be noted that, in practical applications, all the above-mentioned optional embodiments may be combined in a combined manner at will to form an optional embodiment of the present invention, and details are not described here any more.
Corresponding to the image processing method in the above embodiment, the present invention further provides an image processing apparatus. Fig. 3 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present invention, including:
the first processing module 31 is configured to perform compression processing on the first picture according to a preset size to obtain a second picture;
the packaging module 32 is configured to package the second picture into an application installer file apk;
an obtaining module 33, configured to, when a request for calling the second picture is received, obtain picture size information corresponding to the request;
and the second processing module 34 is configured to perform stretching processing on the second picture according to the picture size information.
In an embodiment of the present invention, the second processing module 34 is further configured to:
and stretching the second picture based on pixel points according to the picture size information.
In an embodiment of the present invention, the second processing module 34 is further configured to:
determining pixel point stretching areas of the second picture and the times of copying the pixel point stretching areas of the second picture according to the picture size information;
and copying the times of the pixel point stretching areas of the second picture, and redrawing the picture to obtain a third picture stretched from the second picture.
In an embodiment of the present invention, the pixel point stretching region of the second picture is a pixel point region where 1 is multiplied by 1.
In an embodiment of the present invention, as shown in fig. 4, the apparatus shown in fig. 3 above may further include:
an installation module 41, configured to install the apk of the application on the mobile terminal;
a saving module 42, configured to, after the second processing module 34 performs stretching processing on the second picture according to the picture size information, save the stretched picture in a specified position of the mobile terminal.
The above device of the embodiment of the present invention: compressing the first picture according to a preset size to obtain a second picture; packaging the second picture to an installation program file apk of an application; when a request for calling the second picture is received, obtaining picture size information corresponding to the request; and stretching the second picture according to the picture size information. Therefore, the method and the device can achieve the purpose of reducing the resource data volume of the apk.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (4)
1. An image processing method, comprising:
compressing the first picture according to a preset size to obtain a second picture;
packaging the second picture to an installation program file apk of an application;
installing the apk of the application on the mobile terminal;
when a request for calling the second picture is received, obtaining picture size information corresponding to the request;
stretching the second picture according to the picture size information;
storing the stretched picture at the designated position of the mobile terminal;
stretching the second picture according to the picture size information, including:
stretching the second picture based on pixel points according to the picture size information;
according to the picture size information, stretching the second picture based on pixel points comprises the following steps:
determining pixel point stretching areas of the second picture and the times of copying the pixel point stretching areas of the second picture according to the picture size information;
and copying the times of the pixel point stretching areas of the second picture, and redrawing the picture to obtain a third picture stretched from the second picture.
2. The method of claim 1, wherein the pixel stretching region of the second picture is a pixel region of 1 multiplied by 1.
3. A picture processing apparatus, comprising:
the first processing module is used for compressing the first picture according to a preset size to obtain a second picture;
the packaging module is used for packaging the second picture to an application installation program file apk;
the acquisition module is used for acquiring the picture size information corresponding to the request when receiving the request for calling the second picture;
the second processing module is used for stretching the second picture according to the picture size information;
the installation module is used for installing the apk of the application on the mobile terminal;
the storage module is used for storing the stretched picture at the specified position of the mobile terminal after the second processing module stretches the second picture according to the picture size information;
the second processing module is further configured to:
stretching the second picture based on pixel points according to the picture size information;
the second processing module is further configured to:
determining pixel point stretching areas of the second picture and the times of copying the pixel point stretching areas of the second picture according to the picture size information;
and copying the times of the pixel point stretching areas of the second picture, and redrawing the picture to obtain a third picture stretched from the second picture.
4. The apparatus of claim 3, wherein the pixel stretching region of the second picture is a pixel region of 1 multiplied by 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610833679.1A CN106485657B (en) | 2016-09-19 | 2016-09-19 | Picture processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610833679.1A CN106485657B (en) | 2016-09-19 | 2016-09-19 | Picture processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106485657A CN106485657A (en) | 2017-03-08 |
CN106485657B true CN106485657B (en) | 2020-06-09 |
Family
ID=58267545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610833679.1A Expired - Fee Related CN106485657B (en) | 2016-09-19 | 2016-09-19 | Picture processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106485657B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012175138A (en) * | 2011-02-17 | 2012-09-10 | Clarion Co Ltd | Camera system |
CN105867769A (en) * | 2016-03-29 | 2016-08-17 | 广州阿里巴巴文学信息技术有限公司 | Picture switching method and device and user terminal |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI541051B (en) * | 2010-11-01 | 2016-07-11 | 任天堂股份有限公司 | Game system,controller device,and game process method |
CN103544005B (en) * | 2013-09-10 | 2017-08-08 | Tcl集团股份有限公司 | A kind of regarded as output controlling method and device of Android self-defined controls |
US8868924B1 (en) * | 2014-03-04 | 2014-10-21 | Kaspersky Lab Zao | System and method for modifying a software distribution package |
CN105373545A (en) * | 2014-08-25 | 2016-03-02 | 阿里巴巴集团控股有限公司 | Picture display method and device |
CN105426709B (en) * | 2015-11-12 | 2016-10-12 | 福建北卡科技有限公司 | Private information communication means based on jpeg image Information hiding and system |
CN105915623A (en) * | 2016-05-20 | 2016-08-31 | 努比亚技术有限公司 | Device and method of processing application installation package |
-
2016
- 2016-09-19 CN CN201610833679.1A patent/CN106485657B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012175138A (en) * | 2011-02-17 | 2012-09-10 | Clarion Co Ltd | Camera system |
CN105867769A (en) * | 2016-03-29 | 2016-08-17 | 广州阿里巴巴文学信息技术有限公司 | Picture switching method and device and user terminal |
Also Published As
Publication number | Publication date |
---|---|
CN106485657A (en) | 2017-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3754490B1 (en) | User interface rendering method and apparatus, and terminal | |
CN103677942B (en) | A kind of method and apparatus of movable terminal to browse network pictures | |
CN108111555B (en) | Method and system for controlling installation package downloading process | |
CN108388988B (en) | Block chain-based collaborative office method, system and computer-readable storage medium | |
US20100125838A1 (en) | Method and Apparatus for Optimizing a Program | |
CN111523652B (en) | Processor, data processing method thereof and image pickup device | |
CN111681291A (en) | Image processing method, device, equipment and computer readable storage medium | |
CN108509272B (en) | Method and device for copying GPU (graphics processing Unit) video memory texture to system memory and electronic equipment | |
EP2891063A1 (en) | Augmenting capabilities of a host device | |
CN111796885A (en) | Display method and device of cloud application program and electronic equipment | |
CN109361947A (en) | Internet resources batch loading method, smart television, storage medium and device | |
CN104104995A (en) | Image display method and device | |
CN111683189B (en) | Picture compression method, system, terminal and storage medium | |
CN110798702B (en) | Video decoding method, device, equipment and computer readable storage medium | |
CN110231962B (en) | Process performance configuration method, device, terminal and storage medium | |
CN108921784B (en) | Picture compression method and system based on mobile terminal | |
CN111294377A (en) | Network request sending method of dependency relationship, terminal device and storage medium | |
CN105843752A (en) | Method and device for distributing memory of mobile terminal for caching image data | |
CN112148395A (en) | Page display method, device, equipment and storage medium | |
CN106485657B (en) | Picture processing method and device | |
CN112165572A (en) | Image processing method, device, terminal and storage medium | |
CN109814953B (en) | Wearable device view processing method and device, wearable device and storage medium | |
CN111813541A (en) | Task scheduling method, device, medium and equipment | |
CN117687772A (en) | Algorithm scheduling method and electronic equipment | |
CN116596748A (en) | Image stylization processing method, apparatus, device, storage medium, and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A method and device for image processing Effective date of registration: 20210104 Granted publication date: 20200609 Pledgee: Inner Mongolia Huipu Energy Co.,Ltd. Pledgor: TVMINING (BEIJING) MEDIA TECHNOLOGY Co.,Ltd. Registration number: Y2020990001527 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200609 Termination date: 20210919 |
|
CF01 | Termination of patent right due to non-payment of annual fee |