CN111158619B - Picture processing method and device - Google Patents

Picture processing method and device Download PDF

Info

Publication number
CN111158619B
CN111158619B CN201911360738.8A CN201911360738A CN111158619B CN 111158619 B CN111158619 B CN 111158619B CN 201911360738 A CN201911360738 A CN 201911360738A CN 111158619 B CN111158619 B CN 111158619B
Authority
CN
China
Prior art keywords
picture
terminal
display control
memory
display
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.)
Active
Application number
CN201911360738.8A
Other languages
Chinese (zh)
Other versions
CN111158619A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201911360738.8A priority Critical patent/CN111158619B/en
Publication of CN111158619A publication Critical patent/CN111158619A/en
Application granted granted Critical
Publication of CN111158619B publication Critical patent/CN111158619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay

Abstract

The application discloses a picture processing method and device, which are used for displaying a picture with a self-adaptive size according to the resolution of a terminal. The method comprises the following steps: acquiring pixel information of a display screen of a terminal and size information of a display control, wherein the display control is used for controlling the display screen to display an image; then determining a picture compression coefficient corresponding to the display control according to the size information of the display control of the pixel information; after a picture obtaining request sent by the terminal based on the display control is received, compressing a picture to be previewed corresponding to the picture obtaining request according to a picture compression coefficient corresponding to the display control to obtain a compressed picture, and then sending the compressed picture to the terminal so that the terminal can display the compressed picture through the display control.

Description

Picture processing method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for processing an image.
Background
With the continuous development of display technologies, the screen resolution of various display devices is higher and higher, and accordingly, the requirement for the definition of pictures is higher and higher, and high-definition pictures have become the basic requirement for picture display. However, when a user obtains a picture from a web page, if the user wants to browse or store a high-definition picture, the picture with the highest resolution corresponding to the picture needs to be loaded, which consumes a lot of traffic. The higher the definition of the picture is, the larger the storage capacity of the picture is, and generally the storage capacity of the high definition picture is more than 1MB, and the storage capacity of some high definition pictures even reaches more than 10 MB.
When the picture is loaded, in order to reduce the occupation of the picture on the memory, when the size of the picture source file is larger than the display area on the terminal, the size of the picture source file can be reduced according to the size of the display area, otherwise, the picture source file is displayed according to the size of the picture source file, and the picture source file or the reduced picture source file is loaded to the memory. However, only compressing pictures in this way will affect the clarity of the pictures and result in poor user experience. Therefore, it is necessary to provide a method for compressing pictures according to the resolution of the device, so as to avoid the waste of traffic and the waste of storage space when the user browses the pictures as much as possible.
Disclosure of Invention
The embodiment of the application provides a picture processing method and device, which are used for solving the technical problem that when pictures are displayed through terminals with different resolutions, the pictures with self-adaptive sizes cannot be displayed well.
In a first aspect, a method for processing a picture is provided, where the method includes:
acquiring pixel information of a display screen of a terminal and size information of a display control, wherein the display control is used for controlling the display screen to display an image;
determining a picture compression coefficient corresponding to the display control according to the pixel information and the size information of the display control;
after receiving a picture acquisition request sent by the terminal based on the display control, compressing a picture to be previewed corresponding to the picture acquisition request according to a picture compression coefficient corresponding to the display control to obtain a compressed picture;
and sending the compressed picture to the terminal so that the terminal displays the compressed picture through the display control.
In one possible design, the pixel information includes a screen resolution and a screen pixel density of the terminal, and determining a picture compression coefficient corresponding to the display control according to the pixel information and the size information of the display control includes:
determining the resolution ratio of the terminal according to the screen resolution and the screen pixel density;
determining a display area of the display control according to the resolution ratio and the size information of the display control;
and determining the picture compression coefficient corresponding to the display control according to the display area and the corresponding relation between the preset display area and the picture compression coefficient.
In a possible design, before compressing the picture to be previewed corresponding to the picture obtaining request according to the picture compression coefficient corresponding to the display control, the method further includes:
and determining that the size of the picture to be previewed is larger than that of the display control.
In one possible design, before sending the compressed picture to the terminal, the method further includes:
acquiring the residual memory of the terminal;
determining whether the memory occupied by the compressed picture is larger than the residual memory;
and if the memory occupied by the compressed picture is larger than the residual memory, compressing the compressed picture again so as to enable the memory occupied by the compressed picture to be smaller than or equal to the residual memory.
In one possible design, after determining whether the memory occupied by the compressed picture is greater than the remaining memory, the method further includes:
determining whether the remaining memory is less than a threshold;
when the residual memory is smaller than the threshold value, sending a deleting instruction to the terminal, wherein the deleting instruction is used for indicating the terminal to delete the pictures stored before the preset time length; or sending a prompt instruction to the terminal, wherein the prompt instruction is used for instructing the terminal to send prompt information to a user so that the user can clean the memory of the terminal.
In a second aspect, a picture processing apparatus is provided, the apparatus comprising:
the terminal comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring pixel information of a display screen of the terminal and size information of a display control, and the display control is used for controlling the display screen to display an image;
the determining module is used for determining a picture compression coefficient corresponding to the display control according to the pixel information and the size information of the display control;
the compression module is used for compressing the picture to be previewed corresponding to the picture acquisition request according to the picture compression coefficient corresponding to the display control after receiving the picture acquisition request sent by the terminal based on the display control so as to obtain a compressed picture;
and the sending module is used for sending the compressed picture to the terminal so that the terminal can display the compressed picture through the display control.
In one possible design, the pixel information includes a screen resolution and a screen pixel density of the terminal, and the determining module is configured to:
determining the resolution ratio of the terminal according to the screen resolution and the screen pixel density;
determining a display area of the display control according to the resolution ratio and the size information of the display control;
and determining the picture compression coefficient corresponding to the display control according to the display area and the corresponding relation between the preset display area and the picture compression coefficient.
In one possible design, the determining module is further configured to:
and determining that the size of the picture to be previewed is larger than that of the display control.
In one possible design, the obtaining module is further configured to:
acquiring the residual memory of the terminal;
the determination module is further to: determining whether the memory occupied by the compressed picture is larger than the residual memory;
the compression module is further to: and if the memory occupied by the compressed picture is larger than the residual memory, compressing the compressed picture again so as to enable the memory occupied by the compressed picture to be smaller than or equal to the residual memory.
In one possible design, the determining module is further configured to:
determining whether the remaining memory is less than a threshold;
the sending module is further configured to: when the residual memory is smaller than the threshold value, sending a deleting instruction to the terminal, wherein the deleting instruction is used for indicating the terminal to delete the pictures stored before the preset time length; or sending a prompt instruction to the terminal, wherein the prompt instruction is used for instructing the terminal to send prompt information to a user so that the user can clean the memory of the terminal.
In a third aspect, a terminal device is provided, where the terminal device includes:
at least one processor, and
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the method as described in the first aspect and any possible embodiment by executing the instructions stored by the memory.
In a fourth aspect, a computer-readable storage medium is provided, which stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect and any possible embodiment.
In a fifth aspect, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the picture processing method described in the above various possible implementations.
In the embodiment of the application, the background server can determine the picture compression coefficients for different terminals and different display controls according to the pixel information of the display screen of the terminal and the size information of the display controls, and when a user needs to preview pictures through the terminal, the server can compress the pictures according to the picture compression coefficients and then send the pictures to the terminal equipment. Because the picture sent to the terminal device is compressed based on the relevant information of the terminal device, when the terminal device displays the compressed picture to be previewed, the picture is in accordance with the display condition of the terminal device, and thus when the user browses the picture, the user is in accordance with the browsing requirement of the user. Moreover, the server side directly compresses the picture and then sends the compressed picture to the terminal equipment, so that the flow consumption of the terminal equipment can be saved, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a picture processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a terminal displaying a picture according to an embodiment of the present application;
fig. 4 is another schematic diagram of a terminal displaying a picture according to an embodiment of the present application;
fig. 5 is a block diagram of a picture processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
The terms "first" and "second" in the description and claims of the present application and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the term "comprises" and any variations thereof, which are intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The "plurality" in the present application may mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this document generally indicates that the preceding and following related objects are in an "or" relationship unless otherwise specified.
In order to facilitate understanding of the technical solutions provided in the embodiments of the present application, some brief descriptions are provided below for application scenarios used in the technical solutions provided in the embodiments of the present application, and it should be noted that the application scenarios described below are only used for illustrating the embodiments of the present invention and are not limited. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
Please refer to fig. 1, where fig. 1 is an application scenario to which the technical solution of the embodiment of the present application can be applied. In the application scenario, the application scenario includes at least one terminal device and one server, and in fig. 1, for example, at least one terminal device is 2, which are respectively terminal device 1 and terminal device 2.
The server is used for providing a picture to be previewed for at least one terminal device, when the terminal device needs to display the picture, a user can perform corresponding click operation on the terminal device, and then the terminal sends pixel information of the terminal device and size information of a current display control to the server, so that the server determines a picture compression coefficient corresponding to the terminal according to the information. The click operation may be, for example, that the user clicks the WeChat friend circle, and the display control at this time may be understood as a related control in the terminal device for controlling the screen to display the picture in the WeChat friend circle.
Therefore, after a user clicks a display control icon for displaying a picture, the user wants to preview the picture through the display control, the terminal device sends related information to the server, the server calculates the picture compression coefficient of the display control according to the related information, after the user clicks a picture, the terminal device sends a picture acquisition request to the server, the server can determine a target picture which the user wants to preview based on the picture acquisition request, then performs adaptive compression processing on the target picture, and sends the compressed picture to the terminal device, so that the picture finally presented by the terminal device can be a picture which is relatively in accordance with the display information of the terminal device, and the presentation effect is better.
The technical scheme provided by the embodiment of the application is described in the following with the accompanying drawings of the specification.
Referring to fig. 2, fig. 2 is a flowchart of an image processing method according to an embodiment of the present disclosure. The method is described below by taking as an example the application in the application scenario shown in fig. 1, and the method may be executed by the aforementioned server in fig. 1. The flow diagram is described as follows:
step 201: and acquiring pixel information of a display screen of the terminal and size information of the display control.
The pixel information of the display screen includes a screen resolution and a screen pixel density of the terminal device, for example, the screen resolution is 1920 × 1080, 1280 × 960, 960 × 720, 864 × 480, 720 × 480, the pixel density is 330 pixels/inch, 240 pixels/inch, and the like. The display control is used for controlling the display screen to display the image, for example, if the user clicks an application program of the Tencent video, the display control is used for controlling a related control for displaying the image on the Tencent video in the application program, which can be understood as a display control of the Tencent video application program, the display control can also be directly understood as a container for displaying the picture, and the picture can be displayed in a related area of the display control.
In a specific implementation process, when acquiring pixel information of a display screen and size information of a display control of a terminal device, a server may send a corresponding acquisition request to the terminal, and after receiving the acquisition request, the terminal sends pixel information of the display screen and size information of the display control of the terminal to the server according to feedback of the acquisition request, or when detecting that a user opens an application, the terminal may actively send pixel information of the display screen and size information of the display control of the terminal to the server of the application, and an acquisition mode for the server to acquire terminal-related information is not limited in the embodiment of the application.
Step 202: and determining a picture compression coefficient corresponding to the display control according to the pixel information and the size information of the display control.
In a possible implementation manner, as described above, the pixel information is the screen resolution and the screen pixel density of the terminal, after the screen resolution and the screen pixel density of the terminal are obtained, the server may calculate and obtain a resolution ratio corresponding to the terminal according to the screen resolution and the screen pixel density of the terminal device, further determine a display area for displaying a picture according to the resolution ratio and size information of the current display control, and then determine a picture compression coefficient corresponding to the current display control according to a corresponding relationship between the display area and a preset display area and the picture compression coefficient. That is to say, the server stores some corresponding relationships between the display area and the picture compression coefficient in advance, where the corresponding relationships may be obtained according to empirical values, or may also be obtained through calculation by a specific algorithm, and the specific setting manner of the corresponding relationships is not limited in the embodiment of the present application.
As shown in fig. 3, the entire area in fig. 3 may be understood as a screen of a terminal device (e.g., a mobile phone), and the area within the dashed line frame may be understood as a display area of a display control. For example, the screen resolution of the mobile phone is 1920 × 1080, and the screen pixel density is 400 pixels/inch, then the screen resolution may be divided by the screen pixel density to obtain a resolution ratio, i.e., 4.8:2.7, and then the ratio is converted into an integer ratio of two to two, i.e., 16:9, which is the resolution ratio of the terminal obtained by calculating the screen resolution and the screen pixel density. Then, a display area of the display control for displaying the picture can be determined according to the resolution ratio and the size information of the display control, for example, when the related picture is displayed through the mobile phone, the display area of the picture is determined to be the whole display control, that is, when the picture is displayed, the picture occupies the whole area of the display control, then, the picture compression coefficient corresponding to the display area can be inquired according to the display area, and further, the picture compression coefficient corresponding to the display area is determined to be the picture compression coefficient corresponding to the display control.
As an example, the correspondence between the display area and the picture compression coefficient may be as shown in table 1. In table 1, if the display area is located in the interval a to B, the corresponding picture compression coefficient is coefficient 1; and if the display area is positioned in the C-D interval, the corresponding picture compression coefficient is a coefficient 2. The values from a to D are sequentially reduced, the coefficient 1 is greater than the coefficient 2, and the specific value can be set according to the use requirement, which is not limited herein.
TABLE 1
Display area Picture compression factor
Interval A to B Coefficient of 1
Interval of C to D Coefficient 2
Alternatively, referring to fig. 4, the whole area shown in fig. 4 may be understood as a screen of the terminal device, the screen may be understood as a screen when the mobile phone is in a horizontal screen state, an area within a dotted line frame is a display area size for controlling a display control for displaying a picture, for example, the screen resolution of the mobile phone is 1280 × 960, and the screen pixel density is 320 pixels/inch, so that a resolution ratio, which is 4:3, may be obtained by dividing the screen resolution by the screen pixel density, where the ratio is an integer ratio of two to two, and thus the ratio is a resolution ratio of the terminal obtained by calculating the screen resolution and the screen pixel density. Then, a display area of the display control for displaying the picture may be determined according to the resolution ratio and the size information of the display control, for example, the determined display area is a solid line area smaller than the size of the display control in fig. 4, a picture compression coefficient corresponding to the display area may be queried according to the display area, and the picture compression coefficient corresponding to the display area is determined as the picture compression coefficient corresponding to the display control.
In the embodiment of the application, the resolution ratio of the terminal is determined through the pixel information of the terminal, then the display area currently used for displaying the picture is determined according to the resolution ratio and the size information of the display control, and then the picture compression coefficient corresponding to the display control is determined according to the corresponding relation between the display area and the picture compression coefficient.
Step 203: after a picture obtaining request sent by a terminal based on a display control is received, compressing a picture to be previewed corresponding to the picture obtaining request according to a picture compression coefficient corresponding to the display control so as to obtain a compressed picture.
In a possible implementation manner, after a user clicks a certain picture, that indicates that the user wants to preview the picture, the terminal generates a corresponding request instruction based on the clicking operation of the user, and sends the request instruction to the server, where the request instruction is a picture acquisition request sent by the terminal, the picture can be understood as a picture to be previewed, then the terminal device sends a picture acquisition request to the server, and the server can determine the picture to be previewed, which needs to be displayed by the terminal device, based on the picture acquisition request. After the server determines the picture to be previewed, the picture to be previewed can be compressed according to the determined picture compression coefficient.
In addition, after the server determines the picture to be previewed, the server may first determine the size of the picture to be previewed, then compare the size with the size of the display control reported by the terminal device, and compress the picture to be previewed when it is determined that the size of the picture to be previewed is larger than the size of the display control. Because, in general, when the size of the picture to be previewed is larger than the size of the display control, the picture to be previewed needs to be compressed, so that if the server determines that the size of the picture to be previewed is smaller than the size of the display control, the picture to be previewed does not need to be compressed, that is, when the size of the picture to be previewed is smaller than the size of the display control, the picture to be previewed can be directly sent to the terminal, and thus, the picture displayed by the terminal device is the picture which is not compressed, and the picture of the picture is clearer.
Step 204: and sending the compressed picture to the terminal so that the terminal displays the compressed picture through the display control.
Because the memory space occupied by the compressed picture is small, the compressed picture is sent to the terminal, and the traffic consumption of the terminal can be reduced.
In a possible implementation manner, before the server sends the compressed picture to the terminal, the server may first obtain the remaining memory of the terminal device, determine the memory occupied by the compressed picture, then determine whether the memory occupied by the compressed picture is larger than the remaining memory of the terminal device, and if it is determined that the occupied memory is larger than the remaining memory of the terminal, it indicates that the remaining memory of the terminal device is insufficient to cache the current picture to be previewed. In the embodiment of the application, the server may compress the compressed picture again when determining that the memory occupied by the compressed picture is larger than the remaining memory of the terminal, so that the memory occupied by the compressed picture is smaller than the remaining memory of the terminal device as much as possible, and the terminal device may cache the compressed picture.
In addition, when the re-compression processing is performed, it is necessary to consider whether the display effect after the picture compression is clear or not, and therefore, when the compression processing is performed again on the compressed picture, the compression processing can be performed to a small extent in general. For example, a compression coefficient for performing compression processing again may be set in advance, and then the compressed picture may be subjected to compression processing again based on the compression coefficient. That is to say, when the compressed picture is compressed again, the process may be different from the process of the first compression, the first compression is to determine the compression coefficient according to the related information of the terminal, and compress the picture to be previewed, and when the compression is performed again, the compressed picture is compressed again on the premise of not affecting the picture display effect, so that the memory occupied by the compressed picture is less than the remaining memory of the terminal device as much as possible.
In the embodiment of the application, when the compression processing is performed again, only the compressed picture is compressed again, which generally does not cause too much influence on the display quality of the picture, and the user may not have too much influence when viewing the picture, so that the terminal device can cache the compressed picture again on the premise of not influencing the preview experience of the user, and the bandwidth consumption of the user can be reduced to a certain extent.
In a specific implementation process, if the memory occupied by the compressed picture is greater than the remaining memory of the terminal, it may be further determined whether the remaining memory of the terminal is less than a threshold, where the threshold may be understood as a minimum memory value required by the terminal device to clearly display the picture, that is, when the remaining memory of the terminal is equal to the threshold, the terminal device may just clearly display the picture, and after the picture is cached and displayed, the remaining memory of the terminal becomes 0MB, and if the memory of the terminal needs to be occupied, the memory of the terminal device must be cleaned first.
When the remaining memory of the terminal is smaller than the threshold, it may be considered that the picture obtained by compressing the compressed picture again may cause the picture quality of the picture sent to the terminal to be not clear enough, which affects the viewing experience of the user. In this case, the server may send a corresponding instruction to the terminal, so that the terminal device performs a certain cleaning on the memory.
For example, if the memory occupied by the currently compressed picture needs 5MB and the remaining memory of the terminal device is 4MB, if the compressed picture can be compressed again without affecting the preview visual effect of the user, so that the memory occupied by the compressed picture is less than or equal to 4MB, the compressed picture can be compressed again. Or, if the compressed picture is compressed again without affecting the preview visual effect of the user, and then the compressed picture can only be compressed to 4.5MB, which is still larger than the remaining memory of the terminal device, the server may send a corresponding instruction to the terminal to prompt the terminal to perform memory cleaning, so as to ensure that the remaining memory can cache the compressed picture again.
In a possible implementation manner, the server may send a deletion instruction to the terminal device, where the deletion instruction may be an instruction used to instruct the terminal device to automatically perform memory cleaning. In general, when the remaining memory of the terminal device is small, the number of pictures cached in the terminal device may be large, and for pictures with an excessively long caching time, the user may not need to check again, so that the terminal device may delete the pictures with the excessively long caching time when automatically cleaning the memory. That is to say, a preset time length may be preset, and when the terminal device performs automatic cleaning, the pictures stored before the preset time length may be deleted, so as to increase the memory capacity of the remaining memory. Therefore, the user does not need to manually clean the memory, and the terminal equipment can acquire the compressed picture to correspondingly display after automatically cleaning, so that the intelligence of the terminal equipment is improved, and the operation of the user is simplified.
In another possible implementation, the server may also send a prompt instruction to the terminal device, where the prompt instruction may be an instruction instructing the terminal device to send prompt information to the user, for example, the terminal device may display a prompt dialog box for memory cleaning in an interface to the user, and after seeing the prompt dialog box, the user indicates that the current memory needs to be cleaned to a certain extent, so that the user may delete unnecessary pictures in a proper amount according to the needs of the user, so as to increase the memory capacity of the remaining memory of the terminal device. Therefore, when the memory is cleaned, the pictures which are not required to be stored by the user are deleted, and the reliability of the memory cleaning is improved.
In the embodiment of the application, the background server can determine the picture compression coefficients of different display controls for different terminals according to the pixel information of the display screen of the terminal and the size information of the display controls, then when the terminal needs to preview the picture, the picture can be compressed and then sent to the terminal equipment, because the sent picture is compressed based on the relevant information of the terminal, therefore, when the terminal displays the picture to be previewed, the comparison of the picture meets the display condition of the terminal, then the user can meet the watching effect of the user when watching the picture, and because the server side directly compresses the picture and then sends the picture to the terminal, the flow consumption of the terminal can be saved, and the user experience is improved.
Based on the same inventive concept, the embodiment of the present application provides an image processing apparatus, which can implement the corresponding function of the image processing method. The picture processing apparatus may be a hardware structure, a software module, or a hardware structure plus a software module. The picture processing device can be realized by a chip system, and the chip system can be formed by a chip and can also comprise the chip and other discrete devices. Referring to fig. 5, the image processing apparatus includes an obtaining module 501, a determining module 502, a compressing module 503, and a sending module 504. Wherein:
the acquiring module 501 is configured to acquire pixel information of a display screen of a terminal and size information of a display control, where the display control is used to control the display screen to display an image;
a determining module 502, configured to determine, according to the pixel information and the size information of the display control, a picture compression coefficient corresponding to the display control;
the compression module 503 is configured to, after receiving a picture acquisition request sent by the terminal based on the display control, compress a picture to be previewed corresponding to the picture acquisition request according to a picture compression coefficient corresponding to the display control, so as to obtain a compressed picture;
a sending module 504, configured to send the compressed picture to the terminal, so that the terminal displays the compressed picture through the display control.
In a possible implementation, the pixel information includes a screen resolution and a screen pixel density of the terminal, and the determining module 502 is configured to:
determining the resolution ratio of the terminal according to the screen resolution and the screen pixel density;
determining a display area of the display control according to the resolution ratio and the size information of the display control;
and determining the picture compression coefficient corresponding to the display control according to the display area and the corresponding relation between the preset display area and the picture compression coefficient.
In a possible implementation, the determining module 502 is further configured to:
and determining that the size of the picture to be previewed is larger than that of the display control.
In a possible implementation, the obtaining module 501 is further configured to:
acquiring the residual memory of the terminal;
the determining module 502 is further configured to: determining whether the memory occupied by the compressed picture is larger than the rest memory;
the compression module 503 is further configured to: and if the memory occupied by the compressed picture is larger than the residual memory, compressing the compressed picture again so as to enable the memory occupied by the compressed picture to be smaller than or equal to the residual memory.
In a possible implementation, the determining module 502 is further configured to:
determining whether the remaining memory is less than a threshold;
the sending module 504 is further configured to: when the residual memory is smaller than the threshold value, sending a deleting instruction to the terminal, wherein the deleting instruction is used for indicating the terminal to delete the picture stored before the preset time length; or sending a prompt instruction to the terminal, wherein the prompt instruction is used for instructing the terminal to send prompt information to the user so that the user can clean the memory of the terminal.
All relevant contents of each step related to the embodiment of the image processing method can be cited to the functional description of the functional module corresponding to the image processing apparatus in the embodiment of the present application, and are not described herein again.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Based on the same inventive concept, the embodiment of the application provides the terminal equipment. Referring to fig. 6, the terminal device includes at least one processor 601 and a memory 602 connected to the at least one processor, in this embodiment, a specific connection medium between the processor 601 and the memory 602 is not limited in this application, in fig. 6, the processor 601 and the memory 602 are connected by a bus 600 as an example, the bus 600 is represented by a thick line in fig. 6, and a connection manner between other components is only schematically illustrated and is not limited. The bus 600 may be divided into an address bus, a data bus, a control bus, etc., and is shown with only one thick line in fig. 6 for ease of illustration, but does not represent only one bus or type of bus.
The terminal device in this embodiment of the application may further include a communication interface 603, where the communication interface 603 is, for example, a network port, and the terminal device may receive data or transmit data through the communication interface 603.
In the embodiment of the present application, the memory 602 stores instructions executable by the at least one processor 601, and the at least one processor 601 may execute the steps included in the foregoing picture processing method by executing the instructions stored in the memory 602.
The processor 601 is a control center of the terminal device, and may connect various parts of the whole device by using various interfaces and lines, and perform various functions and process data of the terminal device by operating or executing instructions stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring on the terminal device. Alternatively, processor 601 may include one or more processing units, and processor 601 may integrate an application processor, which mainly handles operating systems and application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 601 may be a general-purpose processor, such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the image processing method disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
The memory 602, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 602 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 602 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 602 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
By programming the processor 601, the code corresponding to the image processing method described in the foregoing embodiment may be solidified into a chip, so that the chip can execute the steps of the image processing method when running, and how to program the processor 601 is a technique known by those skilled in the art, and is not described herein again.
Based on the same inventive concept, embodiments of the present application further provide a storage medium storing computer instructions, which, when executed on a computer, cause the computer to perform the steps of the image processing method as described above.
In some possible embodiments, the aspects of the image processing method provided in the present application may also be implemented in the form of a program product, which includes program code for causing a terminal device to perform the steps in the image processing method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the terminal device.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. 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 application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (8)

1. A picture processing method, characterized in that the method comprises:
acquiring pixel information of a display screen of a terminal and size information of a display control, wherein the display control is used for controlling the display screen to display an image; the pixel information comprises the screen resolution and the screen pixel density of the terminal;
determining the resolution ratio of the terminal according to the screen resolution and the screen pixel density;
determining a display area of the display control according to the resolution ratio and the size information of the display control;
determining a picture compression coefficient corresponding to the display control according to the display area and the corresponding relation between the preset display area and the picture compression coefficient;
after receiving a picture acquisition request sent by the terminal based on the display control, compressing a picture to be previewed corresponding to the picture acquisition request according to a picture compression coefficient corresponding to the display control to obtain a compressed picture;
acquiring the residual memory of the terminal;
determining whether the memory occupied by the compressed picture is larger than the residual memory;
if the memory occupied by the compressed picture is larger than the residual memory, the compressed picture is compressed again, so that the memory occupied by the compressed picture is smaller than or equal to the residual memory;
and sending the picture which is compressed again to the terminal so that the terminal displays the picture which is compressed again through the display control.
2. The method of claim 1, wherein before compressing the picture to be previewed corresponding to the picture obtaining request according to the picture compression coefficient corresponding to the display control, the method further comprises:
and determining that the size of the picture to be previewed is larger than that of the display control.
3. The method of claim 1, wherein after determining whether the memory occupied by the compressed picture is greater than the remaining memory, the method further comprises:
determining whether the remaining memory is less than a threshold;
when the residual memory is smaller than the threshold value, sending a deleting instruction to the terminal, wherein the deleting instruction is used for indicating the terminal to delete the pictures stored before the preset time length; or sending a prompt instruction to the terminal, wherein the prompt instruction is used for instructing the terminal to send prompt information to a user so that the user can clean the memory of the terminal.
4. A picture processing apparatus, characterized in that the apparatus comprises:
the terminal comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring pixel information of a display screen of the terminal and size information of a display control, and the display control is used for controlling the display screen to display an image; the pixel information comprises the screen resolution and the screen pixel density of the terminal;
the determining module is used for determining the resolution ratio of the terminal according to the screen resolution and the screen pixel density; determining a display area of the display control according to the resolution ratio and the size information of the display control; determining a picture compression coefficient corresponding to the display control according to the display area and the corresponding relation between the preset display area and the picture compression coefficient;
the compression module is used for compressing the picture to be previewed corresponding to the picture acquisition request according to the picture compression coefficient corresponding to the display control after receiving the picture acquisition request sent by the terminal based on the display control so as to obtain a compressed picture;
the obtaining module is further configured to obtain the remaining memory of the terminal;
the determining module is further configured to determine whether the memory occupied by the compressed picture is larger than the remaining memory;
the compression module is further configured to, if the memory occupied by the compressed picture is larger than the remaining memory, perform compression processing on the compressed picture again, so that the memory occupied by the compressed picture is smaller than or equal to the remaining memory;
and the sending module is used for sending the picture which is compressed again to the terminal so that the terminal displays the picture which is compressed again through the display control.
5. The apparatus of claim 4, wherein the determination module is further to:
and determining that the size of the picture to be previewed is larger than that of the display control.
6. The apparatus of claim 4, wherein the determination module is further to:
determining whether the remaining memory is less than a threshold;
the sending module is further configured to: when the residual memory is smaller than the threshold value, sending a deleting instruction to the terminal, wherein the deleting instruction is used for indicating the terminal to delete the pictures stored before the preset time length; or sending a prompt instruction to the terminal, wherein the prompt instruction is used for instructing the terminal to send prompt information to a user so that the user can clean the memory of the terminal.
7. A terminal device, characterized in that the terminal device comprises:
at least one processor, and
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the method of any one of claims 1-3 by executing the instructions stored by the memory.
8. A computer-readable storage medium having stored thereon computer instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1-3.
CN201911360738.8A 2019-12-25 2019-12-25 Picture processing method and device Active CN111158619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911360738.8A CN111158619B (en) 2019-12-25 2019-12-25 Picture processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911360738.8A CN111158619B (en) 2019-12-25 2019-12-25 Picture processing method and device

Publications (2)

Publication Number Publication Date
CN111158619A CN111158619A (en) 2020-05-15
CN111158619B true CN111158619B (en) 2021-09-21

Family

ID=70558037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911360738.8A Active CN111158619B (en) 2019-12-25 2019-12-25 Picture processing method and device

Country Status (1)

Country Link
CN (1) CN111158619B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770381B (en) * 2020-06-04 2022-08-05 北京达佳互联信息技术有限公司 Video editing prompting method and device and electronic equipment
CN112099742A (en) * 2020-08-13 2020-12-18 深圳奇迹智慧网络有限公司 Asynchronous display control method, asynchronous display control terminal and asynchronous display system
CN113628292B (en) * 2021-08-16 2023-07-25 上海云轴信息科技有限公司 Method and device for previewing pictures in target terminal
CN114706581A (en) * 2022-04-06 2022-07-05 北京字节跳动网络技术有限公司 Image analysis method, image analysis device, computer equipment and storage medium
CN116107535A (en) * 2022-12-26 2023-05-12 深圳市长丰影像器材有限公司 Method, system, equipment and storage medium for displaying image of microphone
CN116319638A (en) * 2023-03-16 2023-06-23 杭州安司源科技有限公司 Method and device for sending picture message in encrypted instant messaging system
CN117008863B (en) * 2023-09-28 2024-04-16 之江实验室 LOFAR long data processing and displaying method and device

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7813562B2 (en) * 2004-09-27 2010-10-12 Intel Corporation Low-latency remote display rendering using tile-based rendering systems
CN102740155A (en) * 2012-06-15 2012-10-17 宇龙计算机通信科技(深圳)有限公司 Method for displaying images and electronic equipment
CN102946419A (en) * 2012-10-26 2013-02-27 北京奇虎科技有限公司 Picture server and picture data providing method
CN102999253B (en) * 2012-11-13 2016-06-15 北京奇艺世纪科技有限公司 The window display method of a kind of application program, system and mobile terminal
JP5643449B1 (en) * 2014-02-03 2014-12-17 株式会社 ディー・エヌ・エー Server and method for displaying display screen on terminal device
CN105335442B (en) * 2014-08-13 2017-09-15 优视科技有限公司 A kind of processing method and processing device of picture internal memory
CN105183308A (en) * 2015-07-27 2015-12-23 努比亚技术有限公司 Picture display method and apparatus
CN106598404A (en) * 2015-10-16 2017-04-26 青岛海信移动通信技术股份有限公司 Window display method and mobile terminal
CN106681745A (en) * 2015-11-09 2017-05-17 五八同城信息技术有限公司 Picture loading method and terminal
CN105511725A (en) * 2015-12-09 2016-04-20 网易(杭州)网络有限公司 Method and device for displaying controls in interface
CN106028060A (en) * 2016-05-25 2016-10-12 努比亚技术有限公司 Picture check device, system and method
CN106383707A (en) * 2016-09-07 2017-02-08 努比亚技术有限公司 Picture display method and system
CN107179947A (en) * 2017-04-26 2017-09-19 武汉斗鱼网络科技有限公司 A kind of network picture method for down loading and system for mobile terminal
CN108228050B (en) * 2017-12-13 2021-01-22 创新先进技术有限公司 Picture scaling method and device and electronic equipment

Also Published As

Publication number Publication date
CN111158619A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111158619B (en) Picture processing method and device
CN103544207B (en) A kind of method and system of picture loaded and displayed
CN110377264B (en) Layer synthesis method, device, electronic equipment and storage medium
US10834424B2 (en) Method and device for compressing image, and electronic device
CN110446062B (en) Receiving processing method for big data file transmission, electronic device and storage medium
EP4002281A1 (en) Layer composition method and apparatus, electronic device, and storage medium
CN109388317B (en) Picture loading method, terminal device and storage medium
CN108322789B (en) Network picture display method and device and mobile terminal
CN106982388B (en) Picture display method and device
CN110727607B (en) Memory recovery method and device and electronic equipment
WO2017202175A1 (en) Method and device for video compression and electronic device
CN110930467A (en) Image processing method, electronic device and readable storage medium
CN108810610B (en) Screen sharing method and device
US11412311B2 (en) Methods and systems for saving data while streaming video
CN104104995A (en) Image display method and device
US9076207B1 (en) Image processing method, system and electronic device
CN112752107B (en) Webpage picture preprocessing method, system, storage medium and computer equipment
CN115470427A (en) Page loading method, device, equipment and storage medium
CN110418197B (en) Video transcoding method and device and computer readable storage medium
CN110365962B (en) Color gamut conversion processing method and device and electronic equipment
CN108933945B (en) GIF picture compression method, device and storage medium
CN113961429A (en) Memory management method and device, electronic equipment and storage medium
CN113766315A (en) Display device and video information processing method
CN113420171B (en) Image management method, device and storage medium
CN111262996A (en) Notification bar message processing method and device, electronic device 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