CN108322755A - A kind of picture compression processing method and system - Google Patents
A kind of picture compression processing method and system Download PDFInfo
- Publication number
- CN108322755A CN108322755A CN201810023095.7A CN201810023095A CN108322755A CN 108322755 A CN108322755 A CN 108322755A CN 201810023095 A CN201810023095 A CN 201810023095A CN 108322755 A CN108322755 A CN 108322755A
- Authority
- CN
- China
- Prior art keywords
- picture
- size
- original image
- compression
- sectional drawing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/46—Embedding additional information in the video signal during the compression process
- H04N19/467—Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
A kind of picture compression processing method of present invention offer and system, the method include:Sectional drawing processing is carried out to entire original image, wherein treated that dimension of picture is identical as original image size for the sectional drawing;According to original image size, picture size ideal range value corresponding with original image size is got, and set compression quality threshold values;Using JPG compress modes, to sectional drawing, treated that picture compresses, and so that the size of compressed picture is maintained in the ideal range value, and meet the compression quality threshold values.The present invention carries out sectional drawing processing to original image, is compressed to the picture after sectional drawing, and set picture compression quality threshold, so that compressed picture is on the basis of ensureing compression ratio, it can guarantee compression quality again, not only ensured picture compression rate, but also ensure picture compression quality.
Description
Technical field
The present invention relates to picture compression technical fields, more particularly, to a kind of picture compression processing method and system.
Background technology
In the mobile terminals IOS, the storage format for gained photo of taking pictures is JPG, and essentially all of digital photographing is all with this
Format is preserved.Inherently a kind of compression processing modes of JPG, the file stored with * .jpg formats is other type figures
The 1/10-1/20 of file.Under normal circumstances, * .jpg files only have tens KB, and number of colors can reach 24, therefore,
Jpg formats are widely used on Internet, to save network transmission resource.
Due to the picture for gained of taking pictures, wherein containing the information such as a large amount of color-values, light, shadow, iPhone mobile phones are clapped
Individual JPG formats photo is up to 6Mb-12Mb or so sizes, even across compression processing again, is also maintained at about 1.5Mb
Above size.
For developer, 1.5Mb or excessive is excessive to the pressure in broadband if uploading onto the server, and storage and flow disappear
It consumes excessive.Ideal size, it should maintain 100Kb or so.
Developer to take pictures gained picture compress when, mainly compress photo in high light pixel and people naked eyes
Invisible image vegetarian refreshments in visual range.Because keeping lower distortion rate, it cannot compress too many time, may result in this way
Compression ratio is low.Reach ideal 100Kb or so size, then being bound to repeatedly to compress picture, repeatedly rejects picture therein
Element, a pixel only accounts for 4, to reach ideal value, it is necessary to and constantly modification compression quality threshold values removes more pixels,
In this way by repeatedly compression, the picture distortion factor is high, and picture blur is unclear, loses readability, and some even can change artwork
Size.
Invention content
The present invention is provided at a kind of a kind of picture compression for overcoming the above problem or solving the above problems at least partly
Method and system are managed, can overcome the problems, such as that the compression ratio of existing picture compression is low and the distortion factor is high.
According to an aspect of the invention, there is provided a kind of picture compression processing method, including:
Sectional drawing processing is carried out to entire original image, wherein the sectional drawing treated dimension of picture and original image ruler
It is very little identical;
According to original image size, picture size ideal range value corresponding with original image size is got, and set
Compression quality threshold values;
To sectional drawing, treated that picture compresses, and the size of compressed picture is made to be maintained at the ideal range value
It is interior, and meet the compression quality threshold values.
Beneficial effects of the present invention are:Sectional drawing processing is carried out to original image, to sectional drawing, treated that picture compresses,
And setting picture compression quality threshold so that compressed picture can guarantee compression quality on the basis of ensureing compression ratio,
Not only ensure picture compression rate, but also ensure picture compression quality.
Based on the above technical solution, the present invention can also improve as follows.
Further, further include before the step S1:
Obtain original image size and original picture size;Judge whether original picture size corresponds in original image size
Picture size ideal range value in, if so, original image without compression, directly retain original image, if it is not, then to original
Picture carries out sectional drawing processing.
Further, further include before the progress sectional drawing processing to original image:
The exif information for obtaining original image determines the rotation angle of original image according to direction value therein, will be original
The visual angle of picture is adjusted to normal viewing angle when camera system acquiescence is taken pictures.
Further, the picture size ideal range value can be according to the high pixel ratio of width of picture and the high picture of width of picture
Plain value is determined, and the method further includes:
Build the correspondence of the high pixel ratio of width of picture, the high pixel value of width and picture size ideal range value of picture
Table.
Further, described according to original image size, it is ideal to get picture size corresponding with original image size
Value range specifically includes:
The high pixel ratio of width of original image is calculated, and according to the high pixel ratio of the width of original image, the width of original image
High pixel value is searched in the mapping table, finds the width with the high pixel ratio of the width of original image, original image
The corresponding picture size ideal range value of high pixel value.
Further, the picture size ideal range value includes picture size upper limit value and picture size lower limiting value, institute
It states and sectional drawing is compressed, the size of compressed picture is made to be maintained in ideal range value, and meet compression quality threshold values tool
Body includes:
Using JPG compress modes, to sectional drawing, treated that picture compresses, and picture size after by sectional drawing is compressed to
When picture size upper limit value, the compression quality of picture at this time is obtained;Judge whether the compression quality of the picture is less than or equal to set
Fixed compression quality threshold values returns to compressed picture if so, stopping compression;
If the compression quality of picture is more than the compression quality threshold values of setting, continue to compress picture, until final
The compression quality of equal with the picture size lower limiting value or final compressed picture of the size of compressed picture is pressed with setting
Contracting quality threshold is equal.
Further, further include:
It adds paths according to the watermark being pre-designed, watermark character string is added to final compressed picture.
Further, the watermark path is oblique line path or arc track path;
When the watermark add paths for oblique line path when, determine direction of rotation and the rotation angle in the oblique line path,
Watermark character string is added to according to the direction of rotation and rotation angle in the oblique line path in compressed picture;
When the watermark add paths for arc track when, set the radius of the arc track, determine arc track
Direction of rotation and watermark character start of string rotation start angle, since the start angle, by watermark character string according to
The radius of arc track and direction of rotation rotation are added in compressed picture.
According to another aspect of the present invention, a kind of picture compression processing system is provided, including:
Interception module, for carrying out sectional drawing processing to entire original image, wherein the sectional drawing treated dimension of picture
It is identical as original image size;
Acquisition module, it is ideal for according to original image size, getting picture size corresponding with original image size
Value range, and set compression quality threshold values;
Compression module makes the size of compressed picture be maintained at institute for treated that picture compresses to sectional drawing
It states in ideal range value, and meets the compression quality threshold values.
According to a further aspect of the invention, a kind of non-transient computer readable storage medium is provided, which is characterized in that
The non-transient computer readable storage medium stores computer instruction, and the computer instruction makes the computer execute picture
Compression processing method.
Description of the drawings
Fig. 1 is the picture compression process flow figure of one embodiment of the invention;
Fig. 2 be the present embodiment one embodiment in the schematic diagram of watermark is added in picture upon compression;
Fig. 3 is that the picture compression processing system of another embodiment of the present invention connects block diagram;
Fig. 4 is that the picture compression processing system of another embodiment of the invention is connected block diagram;
Fig. 5 is that the electronic equipment of further embodiment of the present invention connects block diagram.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below
Example is not limited to the scope of the present invention for illustrating the present invention.
Referring to Fig. 1, the picture compression processing method of one embodiment of the invention is provided, picture compression rate can improved
On the basis of, ensure the compression quality of picture so that compressed picture is clear.This method includes:To entire original image into
Row sectional drawing processing, wherein treated that dimension of picture is identical as original image size for sectional drawing;According to original image size, obtain
To picture size ideal range value corresponding with original image size, and set compression quality threshold values;To sectional drawing treated figure
Piece is compressed, and the size of compressed picture is made to be maintained in the ideal range value, and meets the compression quality threshold values.
Due to directly being compressed to original image using JPG compress modes, compressed picture size is still bigger,
Compression ratio is relatively low.To promote compression ratio, it is bound to be compressed in original picture, because of artwork sheet data great disadvantage
In directly being compressed.So, the present embodiment is to carry out screenshot capture to original picture by the way of, and the region cut just is
Original picture size area, in this way in naked eyes recognizable set, obtained sectional drawing picture size directly can drop to 2Mb hereinafter, straight
It connects and compression ratio is promoted to 78% or more.
After sectional drawing processing being carried out to original image, wherein during carrying out sectional drawing processing to original image, preserve former
The size of beginning picture restores the size of the picture after sectional drawing, for example, the size of the picture after sectional drawing is less than original
Picture after sectional drawing is then resized to size identical with original image size by the size of picture.
It obtains carrying out sectional drawing treated picture to original image, according to original image size, get and original image
The ideal range value of the corresponding picture size of size, and compression quality threshold values is set, described compression quality threshold values refers to final
The compression quality of compressed picture cannot be less than the compression quality threshold values of setting, and otherwise, the distortion factor of compressed picture is too
Height, picture can be very unintelligible.
Then the picture after sectional drawing is compressed using JPG compress modes so that the size of compressed picture is kept
In ideal value range, and meet compression quality threshold values, i.e., the compression quality of final compressed picture cannot be less than setting
Compression quality threshold values.
The present embodiment carries out sectional drawing processing to original image, the size of original image is greatly reduced, to the figure after sectional drawing
Piece is compressed, and sets picture compression quality threshold so that compressed picture can be protected on the basis of ensureing compression ratio
Compression quality is demonstrate,proved, had not only ensured picture compression rate, but also ensure picture compression quality.
In one embodiment of the invention, further include before the step S1:Obtain original image size and original graph
Piece size;Original picture size is judged whether in the corresponding picture size ideal range value of original image size, if so, former
Beginning picture directly returns to original image without compression, if it is not, then carrying out sectional drawing processing to original image.
Due to original image carry out sectional drawing processing, and to the picture after sectional drawing carry out compression be in order to enable compression after
Picture size in ideal value range, therefore, to original image carry out sectional drawing processing before, need first to judge original graph
Whether piece size is in corresponding ideal range value.Detailed process is to obtain original image size and original picture size first,
Judge original picture size whether in the ideal range value of the corresponding picture size of original image size.Wherein, the ruler of picture
Very little to be indicated with pixel value, the pixel value of dimension of picture is different, and the corresponding size of the picture is (with the big of picture committed memory
It is small to indicate) ideal value range also can be different.If original picture size is in corresponding ideal range value, without to original
Beginning picture is compressed, and original image is directly returned;If original picture size in corresponding ideal range value, is not said
The size of bright original image is excessive, for example, due to the picture for gained of taking pictures, wherein containing a large amount of light, shadow, line lamp letter
Breath, occupies a large amount of memory, to exclude the influence of these factors, and do not influence the visual effect of user, need to original
Picture carries out sectional drawing, and the picture size after sectional drawing is much smaller compared to original picture size, and the picture size after sectional drawing is substantially
In 2Mb or less.
In another embodiment of the present invention, further include before the progress sectional drawing to original image:Obtain original graph
The exif information of piece determines the rotation angle of original image according to direction value therein, and the visual angle of original image is adjusted to clap
Normal viewing angle when lighting system acquiescence is taken pictures.
Before carrying out sectional drawing to original image, normal viewing angle when thering is itself acquiescence to take pictures due to camera system, than
Such as, it is visual angle of normally taking pictures that the camera system acquiescence transverse screen of the iPhone mobile phones of IOS systems, which is taken pictures,.For the original of gained of taking pictures
Picture needs the normal visual angle of taking pictures that photo angle is modified to camera system acquiescence, and specific makeover process is to pass through reading
Exif information in photo, wherein in exif information comprising take pictures direction value, photographing device, photo opporunity, IOS sensitivity with
And the data such as geographical locations GPS, according to direction value therein of taking pictures, to change the rotation angle of photo, make the visual angle of photo with
The normal viewing angle of taking pictures of camera system acquiescence is consistent.Herein, it needs to be adjusted the visual angle of photo, is because server is to figure
It is the normal viewing angle given tacit consent to according to camera system to carry out when piece is handled.
In one embodiment of the invention, the ideal range value of the picture size can be according to the high pixel ratio of width of picture
The high pixel value of the width of value and picture is determined, including:Build the high pixel ratio of width of picture, the high pixel value of width and the figure of picture
The mapping table of the ideal range value of piece size.
Previous embodiment is taught, and the ideal range value of corresponding picture size is got according to original image size, therefore,
Need to pre-establish the correspondence of dimension of picture and picture size ideal range value.Wherein, dimension of picture apparatus volumetric pixel value
It indicates, the ideal range value of picture size is related with the high pixel ratio of the width of the high pixel value of the width of picture and picture, building
When vertical correspondence, build the high pixel ratio of width of picture, the high pixel value of width of picture and picture size ideal range value it
Between mapping table.
In another embodiment of the present invention, described according to original image size, it gets and original image size pair
The ideal range value for the picture size answered specifically includes:Calculate the high pixel ratio of width of original image;According to the width of original image
High pixel ratio, original image the high pixel value of width searched in the mapping table, find the width with original image
The ideal range value of the corresponding picture size of the high pixel value of width of high pixel ratio, original image.
It is above-mentioned according to original image size, get the ideal range value of picture size corresponding with original image size
Detailed process is the high pixel value of width for obtaining original image and the high pixel ratio of width for calculating original image, then according to original
The high pixel ratio of width of the high pixel value of width and original image of beginning picture, is searched in above-mentioned mapping table, is looked for
To the ideal range value of picture size corresponding with the high pixel ratio of the width of original image, the high pixel value of width of original image.
In one embodiment of the invention, the ideal range value of the picture size includes picture size upper limit value and figure
Piece size lower limiting value, it is described that sectional drawing is compressed using JPG compress modes, so that the size of compressed picture is maintained at ideal
In value range, and meets compression quality threshold values and specifically include:Sectional drawing is compressed using JPG compress modes, by the figure of sectional drawing
Piece size is compressed to picture size upper limit value, obtains the compression quality of picture at this time;Judge the picture compression quality whether
Less than or equal to the compression quality threshold values of setting, if so, stopping compression, compressed picture is returned to;If the compression quality of picture
More than the compression quality threshold values of setting, then continue to compress picture, until the size and picture of final compressed picture
The compression quality of the equal or final compressed picture of size lower limiting value is equal with setting compression quality threshold values.
During being compressed to the picture after sectional drawing, picture is compressed using JPG compress modes, wherein
The ideal range value of picture size includes picture size upper limit value and picture size lower limiting value.In the process compressed to picture
In, two factors of the compression ratio of picture and the compression quality of picture need summation to consider, the compression ratio of picture is too low, can lead to figure
The compressed size of piece is still very big, and committed memory is big, meanwhile, picture is excessively compressed, the distortion factor of picture can be caused
Height, picture compressed in this way can be smudgy.Therefore, during to picture compression, the two factors to be balanced.Specifically
Way be, using JPG compress modes the picture after sectional drawing is compressed during, extremely by the picture compression after sectional drawing
Picture size upper limit value obtains picture compression quality at this time.Wherein, by the picture compression after sectional drawing to picture size upper limit value
During, it can be 1 by compression quality, be successively decreased with fixed step-length, for example, compression quality is gradual with 0.06 step-length
Successively decrease to be compressed to the picture after sectional drawing.Picture compression quality at this time is compared with setting compression quality threshold values
Compared with determining the need for continuing to compress to picture according to comparison result.
If picture compression quality at this time is less than or equal to the compression quality threshold values of setting, picture is pressed in stopping
Contracting, picture at this time, in case the compression quality of compressed picture is too low.If picture compression quality at this time is more than setting
Compression quality threshold values can then continue to compress to picture, during continuing compression, when picture is compressed to picture
When the compression quality that size reaches picture size lower limiting value or picture reaches the compression quality threshold values of setting, stop to picture
Compression.
It summarizes, during being compressed to the picture after sectional drawing, is ensureing compressed picture size right
In the picture size ideal range value answered in advance under, ensure as possible compressed picture compression quality be in setting compression
On quality threshold.The summation of compression ratio and compression quality is considered, just can guarantee the size of compressed picture suitable
It in magnitude range, and can guarantee that the distortion factor of compressed picture is relatively low, keep the high-visible of picture.
In one embodiment of the invention, it adds paths according to the watermark being pre-designed, to final compressed picture
Add watermark character string.
In the prior art, JPG compress modes are to realize to the compression processing of picture, be cannot achieve to watermark in picture
Addition.The present embodiment may be implemented to add the function of watermark on picture upon compression.Specifically, first on picture upon compression
Design watermark adds paths, and then watermark character string adds paths according to the watermark of design is added on compressed picture.
Wherein, watermark path is oblique line path or arc track path.When watermark add paths for oblique line path when, really
Watermark character string is added to according to the direction in oblique line path in compressed picture by the direction for determining oblique line path;When watermark adds
Add path be arc track when, set the radius of arc track, determine that the direction of rotation of arc track and watermark character string are opened
Begin the start angle rotated, and since start angle, watermark character string is revolved according to the radius of arc track and direction of rotation
Turn to be added in compressed picture.
The specific method that watermark is added on picture upon compression is introduced below, referring to Fig. 2, for example, compressing
The path that watermark character string is added on picture afterwards is arc track path, then first designs arc track radius, for example, design circle
Arc orbital radius is 100mm, and the direction of rotation of contract profile, for clockwise or counter-clockwise, and determines watermark character string
Start the start angle of rotation, for example, starting is since -2/ π.
During specific implementation, watermark character string is decomposed into single character one by one, and storage is arrived in sequence
In array, the angle shared by each character is calculated, is stored in array, then calculates the total angle shared by all characters.Time
It counts all characters in group one by one, calculates each character since start angle, it should the angle of rotation, for example, a character institute
It is 3 ° to account for angle, then first character rotates 3 ° since start angle, and second character rotates 6 ° from start angle.It is rotating
During, relative to the coordinate system of current device, calculate the center point coordinate of each character, and by current device coordinate system
Central point be moved to the central point of each character, then according to carrying out rotating corresponding angle to each character from start angle
Degree, is directed to each character, is rotated using same method, after array traverses, has just obtained arc track
Watermark on path.
When watermark add paths for oblique line path when, it is comparatively simpler than arc track path, determine each word
Spacing between the rotation angle of symbol and direction and each two character, you can realize the addition of character string watermark.
Referring to Fig. 3, the picture compression processing system of one embodiment of the invention, including interception module 21, acquisition are provided
Module 22 and compression module 23.
Wherein, interception module 21, for carrying out sectional drawing processing to original image, wherein the sectional drawing treated picture
Size is identical as original image size.
Acquisition module 22, for according to original image size, getting picture size corresponding with original image size
Ideal range value, and set compression quality threshold values.
Compression module 23 makes for using JPG compress modes, to 21 sectional drawing of interception module, treated that picture compresses
The size of compressed picture is maintained in ideal range value, and meets compression quality threshold values.
Referring to Fig. 4, the picture compression processing system of one embodiment of the invention, including interception module 21, acquisition are provided
Module 22, compression module 23, judgment module 24, adjustment module 25, structure module 26, searching module 27 and add module 28.
Interception module 21, for carrying out sectional drawing processing to original image, wherein sectional drawing treated dimension of picture with it is original
Dimension of picture is identical.
Acquisition module 22, for according to original image size, getting picture size corresponding with original image size
Ideal range value, and set compression quality threshold values.
Compression module 23 makes for using JPG compress modes, to 21 sectional drawing of interception module, treated that picture compresses
The size of compressed picture is maintained in ideal range value, and meets compression quality threshold values.
Wherein, acquisition module 22 are additionally operable to obtain original image size and original picture size.
Judgment module 24, for judging original picture size whether in the corresponding picture size ideal model of original image size
It encloses in value, if so, original image directly returns to original image, if it is not, then calling interception module 21 to original graph without compression
Piece carries out sectional drawing processing.
Module 25 is adjusted, for before interception module 21 carries out sectional drawing processing to original image, obtaining original image
Exif information determines the rotation angle of original image according to direction value therein, and the visual angle of original image, which is adjusted to take pictures, is
Normal viewing angle when system acquiescence is taken pictures.
Wherein, the ideal range value of picture size can according to the high pixel value of width of the high pixel ratio of width of picture and picture into
Row determines, correspondingly, structure module 26, the high pixel value of width and picture of the high pixel ratio of width, picture for building picture are big
The mapping table of small ideal range value.
Searching module 27, the high pixel ratio of width for calculating original image, and according to the high pixel ratio of the width of original image
Value, original image the high pixel value of width searched in the mapping table, find and the high pixel ratio of the width of original image
The ideal range value of value, the corresponding picture size of the high pixel value of width of original image, gets and original graph for acquisition module 22
The ideal range value of the corresponding picture size of chip size.
Wherein, the ideal range value of picture size includes picture size upper limit value and picture size lower limiting value, correspondingly, obtaining
Modulus block 22 is additionally operable to, when the picture size of sectional drawing is compressed to picture size upper limit value using JPG compress modes, obtain this
When picture compression quality;Correspondingly, judgment module 24 is additionally operable to judge whether the compression quality of picture at this time is less than or equal to set
Fixed compression quality threshold values returns to compressed picture if so, stopping compression;If the compression quality of picture is more than and sets at this time
Fixed compression quality threshold values, then call compression module 23 to continue to compress picture, until final compressed picture is big
The compression quality of small equal with picture size lower limiting value or final compressed picture is equal with setting compression quality threshold values.
Add module 28 adds watermark for adding paths according to the watermark being pre-designed to final compressed picture
Character string.
Wherein, watermark path is oblique line path or arc track path;Correspondingly, add module 28, specifically for working as
Watermark add paths for oblique line path when, direction of rotation and the rotation angle in oblique line path are determined, by watermark character string according to oblique
The direction of rotation of thread path and rotation angle are added in compressed picture;It adds paths as circular arc also particularly useful for when watermark
When track, the radius of arc track is set, determines the direction of rotation of arc track and the starting of watermark character start of string rotation
Watermark character string is added to by angle since the start angle according to the radius of arc track and direction of rotation rotation
In compressed picture.
It is the electronic equipment of one embodiment of the invention referring to Fig. 5, electronic equipment includes:Processor (processor)
501, memory (memory) 502 and bus 503;Wherein, the processor 501 and memory 502 are complete by the bus 503
At mutual communication.
The processor 501 is used to call the program instruction in the memory 502, to execute above-mentioned each method embodiment
The method provided, such as including:Sectional drawing processing is carried out to entire original image, wherein the sectional drawing treated picture ruler
It is very little identical as original image size;According to original image size, it is ideal to get picture size corresponding with original image size
Value range, and set compression quality threshold values;To sectional drawing, treated that picture compresses, and the size of compressed picture is made to keep
In the ideal range value, and meet the compression quality threshold values.
The present invention discloses a kind of computer program product, which can including being stored in non-transient computer
The computer program on storage medium is read, which includes program instruction, when program instruction is computer-executed, meter
Calculation machine is able to carry out the picture compression processing method that above-mentioned corresponding embodiment is provided, such as including:To entire original image into
Row sectional drawing processing, wherein treated that dimension of picture is identical as original image size for the sectional drawing;According to original image size,
Picture size ideal range value corresponding with original image size is got, and sets compression quality threshold values;After sectional drawing processing
Picture compressed, so that the size of compressed picture is maintained in the ideal range value, and meet the compression quality
Threshold values.
A kind of picture compression processing method and system provided by the invention carry out sectional drawing processing to original image, drop significantly
The low size of original image, compresses the picture after sectional drawing, it is only necessary to which a small amount of compression processing several times can to press
Picture size after contracting is maintained in ideal range value, and sets picture compression quality threshold so that compressed picture is being protected
It on the basis of demonstrate,proving compression ratio, and can guarantee compression quality, reached the balance of compression ratio and the distortion factor, compressed picture reaches
Preferable effect.
Finally, the present processes are only preferable embodiment, are not intended to limit the scope of the present invention.It is all
Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on should be included in the protection of the present invention
Within the scope of.
Claims (10)
1. a kind of picture compression processing method, which is characterized in that including:
Sectional drawing processing is carried out to entire original image, wherein the sectional drawing treated dimension of picture and original image size phase
Together;
According to original image size, picture size ideal range value corresponding with original image size is got, and set compression
Quality threshold;
To sectional drawing, treated that picture compresses, and the size of compressed picture is made to be maintained in the ideal range value, and
Meet the compression quality threshold values.
2. picture compression processing method as described in claim 1, which is characterized in that further include before the step S1:
Obtain original image size and original picture size;
Original picture size is judged whether in the corresponding picture size ideal range value of original image size, if so, original
Picture directly retains original image without compression, if it is not, then carrying out sectional drawing processing to original image.
3. picture compression processing method as claimed in claim 2, which is characterized in that described to carry out sectional drawing processing to original image
Further include before:
The exif information for obtaining original image determines the rotation angle of original image according to direction value therein, by original image
Visual angle be adjusted to normal viewing angle of camera system acquiescence when taking pictures.
4. picture compression processing method as described in claim 1, which is characterized in that the picture size ideal range value can root
It is determined according to the high pixel value of width of the high pixel ratio of the width of picture and picture, the method further includes:
Build the mapping table of the high pixel ratio of width of picture, the high pixel value of width and picture size ideal range value of picture.
5. picture compression processing method as claimed in claim 4, which is characterized in that it is described according to original image size, it obtains
It is specifically included to picture size ideal range value corresponding with original image size:
The high pixel ratio of width of original image is calculated, and according to the high pixel ratio of the width of original image, the high picture of width of original image
Plain value is searched in the mapping table, finds the high picture of width with the high pixel ratio of the width of original image, original image
Element is worth corresponding picture size ideal range value.
6. picture compression processing method as claimed in claim 5, which is characterized in that the picture size ideal range value includes
Picture size upper limit value and picture size lower limiting value, it is described that sectional drawing is compressed, so that the size of compressed picture is maintained at
In ideal range value, and meets compression quality threshold values and specifically include:
Using JPG compress modes, to sectional drawing, treated that picture compresses, and picture size after by sectional drawing is compressed to picture
When maxsize value, the compression quality of picture at this time is obtained;Judge whether the compression quality of the picture is less than or equal to setting
Compression quality threshold values returns to compressed picture if so, stopping compression;
If the compression quality of picture is more than the compression quality threshold values of setting, continue to compress picture, until final compression
The compression quality of equal with the picture size lower limiting value or final compressed picture of the size of picture afterwards and setting compression matter
It is equal to measure threshold values.
7. picture compression processing method as claimed in any one of claims 1 to 6, which is characterized in that further include:
It adds paths according to the watermark being pre-designed, watermark character string is added to final compressed picture.
8. picture compression processing method as claimed in claim 6, which is characterized in that the watermark path be oblique line path or
Arc track path;
When the watermark add paths for oblique line path when, direction of rotation and the rotation angle in the oblique line path are determined, by water
Print character string is added to according to the direction of rotation and rotation angle in the oblique line path in compressed picture;
When the watermark add paths for arc track when, set the radius of the arc track, determine the rotation of arc track
The start angle of direction and the rotation of watermark character start of string, since the start angle, by watermark character string according to circular arc
The radius of track and direction of rotation rotation are added in compressed picture.
9. a kind of picture compression processing system, which is characterized in that including:
Interception module, for carrying out sectional drawing processing to entire original image, wherein the sectional drawing treated dimension of picture with it is former
Beginning dimension of picture is identical;
Acquisition module, for according to original image size, getting picture size ideal range corresponding with original image size
Value, and set compression quality threshold values;
Compression module makes the size of compressed picture be maintained at the reason for treated that picture compresses to sectional drawing
Think in value range, and meets the compression quality threshold values.
10. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited
Computer instruction is stored up, the computer instruction makes the computer execute the method as described in claim 1-8 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810023095.7A CN108322755B (en) | 2018-01-10 | 2018-01-10 | Picture compression processing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810023095.7A CN108322755B (en) | 2018-01-10 | 2018-01-10 | Picture compression processing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108322755A true CN108322755A (en) | 2018-07-24 |
CN108322755B CN108322755B (en) | 2021-07-09 |
Family
ID=62893292
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810023095.7A Active CN108322755B (en) | 2018-01-10 | 2018-01-10 | Picture compression processing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108322755B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111311699A (en) * | 2020-01-17 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Picture compression method and device |
CN118096486A (en) * | 2024-04-25 | 2024-05-28 | 浪潮软件科技有限公司 | Double-layer hybrid watermark embedding method, device and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100306022A1 (en) * | 2009-05-27 | 2010-12-02 | Honeywood Technologies, Llc | Advertisement content selection and presentation |
US20130117659A1 (en) * | 2011-11-09 | 2013-05-09 | Microsoft Corporation | Dynamic Server-Side Image Sizing For Fidelity Improvements |
CN104902282A (en) * | 2015-06-04 | 2015-09-09 | 深圳市明日空间信息技术有限公司 | Processing method and device for embedding watermark image into video frame |
CN105491414A (en) * | 2015-11-19 | 2016-04-13 | 深圳市时尚德源文化传播有限公司 | Synchronous display method and device of images |
CN105979265A (en) * | 2016-05-05 | 2016-09-28 | 贵州白山云科技有限公司 | Image compression method and apparatus |
US20180007340A1 (en) * | 2016-06-29 | 2018-01-04 | Barbara Carey Stachowski | Method and system for motion controlled mobile viewing |
-
2018
- 2018-01-10 CN CN201810023095.7A patent/CN108322755B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100306022A1 (en) * | 2009-05-27 | 2010-12-02 | Honeywood Technologies, Llc | Advertisement content selection and presentation |
US20130117659A1 (en) * | 2011-11-09 | 2013-05-09 | Microsoft Corporation | Dynamic Server-Side Image Sizing For Fidelity Improvements |
CN104902282A (en) * | 2015-06-04 | 2015-09-09 | 深圳市明日空间信息技术有限公司 | Processing method and device for embedding watermark image into video frame |
CN105491414A (en) * | 2015-11-19 | 2016-04-13 | 深圳市时尚德源文化传播有限公司 | Synchronous display method and device of images |
CN105979265A (en) * | 2016-05-05 | 2016-09-28 | 贵州白山云科技有限公司 | Image compression method and apparatus |
US20180007340A1 (en) * | 2016-06-29 | 2018-01-04 | Barbara Carey Stachowski | Method and system for motion controlled mobile viewing |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111311699A (en) * | 2020-01-17 | 2020-06-19 | 北京达佳互联信息技术有限公司 | Picture compression method and device |
CN118096486A (en) * | 2024-04-25 | 2024-05-28 | 浪潮软件科技有限公司 | Double-layer hybrid watermark embedding method, device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN108322755B (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11395011B2 (en) | Coordinated piecewise Bezier vectorization | |
CN101639933B (en) | Image rotation correction method and system and electronic device | |
CN109407936B (en) | Screenshot method and related device | |
CN108681729A (en) | Text image antidote, device, storage medium and equipment | |
CN109951635B (en) | Photographing processing method and device, mobile terminal and storage medium | |
CN112906047B (en) | Image privacy information protection system and method based on deep learning | |
CN111259968A (en) | Illegal image recognition method, device, equipment and computer readable storage medium | |
CN106599758A (en) | Image quality processing method and terminal | |
CN108322755A (en) | A kind of picture compression processing method and system | |
CN107704798A (en) | Image weakening method, device, computer-readable recording medium and computer equipment | |
CN111833234B (en) | Image display method, image processing apparatus, and computer-readable storage medium | |
WO2015196681A1 (en) | Picture processing method and electronic device | |
CN110737795A (en) | Photo album cover determining method, device, equipment and storage medium | |
CN111062926B (en) | Video data processing method, device and storage medium | |
CN110619060B (en) | Cigarette carton image database construction method and cigarette carton anti-counterfeiting query method | |
CN114005066B (en) | HDR-based video frame image processing method and device, computer equipment and medium | |
CN116777734A (en) | Method, device, equipment and storage medium for generating background penetration image | |
CN102843479A (en) | File scanning method, file scanning device and portable electronic device | |
WO2018214900A1 (en) | Storage apparatus, mobile terminal and image processing method thereof | |
CN105007412A (en) | Photo storage method for mobile terminal | |
CN115550558A (en) | Automatic exposure method and device for shooting equipment, electronic equipment and storage medium | |
CN109242763B (en) | Picture processing method, picture processing device and terminal equipment | |
CN103838583A (en) | Method and system for rapidly viewing pictures | |
CN104702847B (en) | Image resolution ratio method of adjustment and device | |
CN107509101A (en) | Image processing method |
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 | ||
CP01 | Change in the name or title of a patent holder |
Address after: 100085 Floor 101 102-1, No. 35 Building, No. 2 Hospital, Xierqi West Road, Haidian District, Beijing Patentee after: Seashell Housing (Beijing) Technology Co.,Ltd. Address before: 100085 Floor 101 102-1, No. 35 Building, No. 2 Hospital, Xierqi West Road, Haidian District, Beijing Patentee before: LIANJIA(BEIJING) TECHNOLOGY Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |