Movatterモバイル変換


[0]ホーム

URL:


CN105430393A - Picture processing method, picture processing device and picture processing platform - Google Patents

Picture processing method, picture processing device and picture processing platform
Download PDF

Info

Publication number
CN105430393A
CN105430393ACN201410484687.0ACN201410484687ACN105430393ACN 105430393 ACN105430393 ACN 105430393ACN 201410484687 ACN201410484687 ACN 201410484687ACN 105430393 ACN105430393 ACN 105430393A
Authority
CN
China
Prior art keywords
picture
original image
compression
area
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410484687.0A
Other languages
Chinese (zh)
Other versions
CN105430393B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co LtdfiledCriticalTencent Technology Shenzhen Co Ltd
Priority to CN201410484687.0ApriorityCriticalpatent/CN105430393B/en
Publication of CN105430393ApublicationCriticalpatent/CN105430393A/en
Application grantedgrantedCritical
Publication of CN105430393BpublicationCriticalpatent/CN105430393B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention provides a picture processing method, a picture processing device and a picture processing platform. The method comprises the following steps: obtaining attribute information of an original picture; aiming at a PNG picture, firstly performing lossless compression on the original picture, and then judging a transparent characteristic of the original picture; if a transparent pixel point does not exist, judging the area of the original picture or a picture color value; when the area of the picture is less than an area threshold or the picture color value is less than a color threshold, compressing the picture after the lossless compression, converting a format of the picture after the lossless compression into a JPG format, and then performing compression; and obtaining the picture, which has the smaller volume in the two pictures, through a comparison, and selecting the picture as a processed picture. In the scheme, judgments are performed through combinations with the picture transparent characteristic, the color value and the area of the PNG picture, original picture information is represented well in the smaller picture volume, the picture expression effect is improved, and the picture volume and quality cost performance are improved.

Description

A kind of image processing method, picture processing device and picture processing platform
Technical field
The present invention relates to picture processing field, specifically a kind of image processing method and picture processing device and picture processing platform.
Background technology
Along with the development of the network information technology and electronic information technology and universal, people often use electronic pictures in daily life, and as mobile phone, digital camera etc. all have the function of taking pictures, the shared of a lot of image information becomes simple and convenient.In the network platform many at present, all there is the function that picture is shared, as uploaded head portrait, photograph album etc.User, when use one pictures, often wishes that picture quality is good, volume is little.But for a kind of picture of set form, in general the quality of picture and volume are directly proportional, and wants to obtain higher picture quality, the size that the inevitable demand fulfillment of this picture is certain, therefore needs between picture image quality and volume size, do one and weighs.
As in the network platform, when user selects uploading pictures, user pulls or clicks the picture uploading a PNG32 form, system carries out lossy compression method according to the actual conditions of picture, it is made to meet image size needed for this platform, return new picture after completing compression to user, user can select to download.In addition, the picture that can also provide user carries out the contrast compressing front and back, as user uploads the picture of jpeg format, according to the lossy compression method that the quality of picture and size are carried out to a certain degree, it is made to meet the requirement of system platform, then the new picture obtained after being compressed by original image returns to user, and shows the contrast of new picture and former figure, and user can select to download.In these schemes, the form of picture uploading, is all determined by the form of original image, when the form of original image is not supported in this system platform, then cannot uploads.
In order to solve the problem, a kind of method of uploading pictures is disclosed in Chinese patent literature CN101808182A, picture uploading terminal and system, the method of this uploading pictures comprises, obtain and need the pictorial information being uploaded to picture sharing Web sites, judge to need the picture uploaded whether to meet the requirement to uploading pictures of picture sharing Web sites according to this information, when being judged as YES, by picture uploading to picture sharing Web sites, when being judged as NO, picture is carried out corresponding conversion by the requirement according to picture sharing Web sites, again by the picture uploading after changing to picture sharing Web sites.In the program, user by terminal as PC uploading pictures to picture sharing Web sites time, be uploaded to picture sharing Web sites again after the format conversion of the uploading pictures that picture sharing Web sites can not supported by terminal automatically becomes the form of picture sharing Web sites support, so just can realize picture and automatically upload.But, the form of the uploading pictures supported due to current picture sharing Web sites is more and more diversified, its feature of different picture formats is different again, and the program cannot select optimum picture format in numerous picture formats, also cannot be optimized process for different format pictures.
Summary of the invention
For this reason, the conversion of form and the compression of data can only be carried out when technical problem to be solved by this invention is picture uploading in prior art, process cannot be optimized targetedly for the picture of different-format, thus propose the picture processing device of a kind of image processing method and use the method, and provide a kind of picture processing platform using this picture processing device simultaneously.
For solving the problems of the technologies described above, of the present inventionly providing a kind of image processing method, comprising:
Determine the attribute information of original image, wherein said original image is PNG format image, and described attribute information comprises transparent characteristic, area, color value;
Lossless Compression is carried out to original image and obtains intermediate picture;
Judge the transparent characteristic of described original image, when there is not transparent pixels point, judge area or the color value of original image, if original image area is less than area threshold or original image color value is less than color threshold, then described intermediate picture is converted into PNG8 format picture; Otherwise described intermediate picture is compressed, and compresses again after described intermediate picture is converted to JPG form, compare the volume of two width pictures after compression, select the picture that the rear volume of compression is little.
The present invention also provides a kind of picture processing device, comprising:
Property extracting module: the attribute information determining original image, wherein said original image is PNG format image, and described attribute information comprises transparent characteristic, area, color value;
Lossless compression modules: Lossless Compression is carried out to original image and obtains intermediate picture;
Judge modular converter: the transparent characteristic judging described original image, when there is not transparent pixels point, judge area or the color value of original image, if original image area is less than area threshold or original image color value is less than color threshold, then described intermediate picture is converted into PNG8 format picture; Otherwise described intermediate picture is compressed, and compresses again after described intermediate picture is converted to JPG form, compare the volume of two width pictures after compression, select the picture that the rear volume of compression is little.
In addition, the present invention also provides a kind of picture processing platform, comprises picture processing device and memory device, and described picture processing device is used for processing picture, and described memory device is used for the picture after stores processor.
Technique scheme of the present invention has the following advantages compared to existing technology,
(1) the invention provides a kind of image processing method, obtain the attribute information of original image, for PNG picture, first Lossless Compression is carried out to original image, then the transparent characteristic of original image is judged, if there is not transparent pixel, then judge area or the picture color value of original image, picture area is less than area threshold or picture color value when being less than color threshold, by the picture compression after Lossless Compression, and the picture after Lossless Compression is converted to the recompression of JPG form, then the picture that in the two width pictures obtained, volume is little is compared, select this picture as the picture after process, picture optimization is carried out according to the attribute information of picture in the program, removed by Lossless Compression and influential information is not had to picture quality, then according to the transparent characteristic of picture, color value and area judge, achieve and better show original image information with less picture volume, improve the expression effect of picture, improve the cost performance of picture volume and expression effect, be particularly useful for uploading of picture, to share etc. in process, for user provides the suitable picture format of optimization, avoid the picture volume that causes because picture format is incorrect excessive, the problems such as bandwidth waste.
(2) the present invention also provides a kind of picture processing device using above-mentioned picture optimized treatment method, comprise property extracting module and judge modular converter, the process of PNG picture can be realized, for the original image that user provides, in conjunction with contents attribute and the format characteristic of picture, be optimized process, obtain preferred form and the form of expression, optimize the expression way of picture.
(3) the present invention also provides a kind of picture processing platform using above-mentioned picture processing device, comprise picture processing device and memory device, need after picture to be processed carries out above-mentioned process via picture processing device, be stored in memory device, effectively make use of the attribute of picture self, improve shared quality and the uploading speed of picture.
Accompanying drawing explanation
In order to make content of the present invention be more likely to be clearly understood, below according to a particular embodiment of the invention and by reference to the accompanying drawings, the present invention is further detailed explanation, wherein
Fig. 1 is the hardware environment schematic diagram that in embodiment of the present invention, image processing method runs;
Fig. 2 is another hardware environment schematic diagram that in embodiment of the present invention, image processing method runs;
Fig. 3 is another hardware environment schematic diagram that in embodiment of the present invention, image processing method runs
Fig. 4 is the flow chart of the image processing method of the embodiment of the present invention 1;
Fig. 5 is the flow chart of the image processing method of the embodiment of the present invention 2;
Fig. 6 is the flow chart of the image processing method of the embodiment of the present invention 3;
Fig. 7 is the flow chart of the image processing method of the embodiment of the present invention 4;
Fig. 8 is the structure chart of the picture processing device of the embodiment of the present invention 6;
Fig. 9 is the structure chart of the picture processing device of the embodiment of the present invention 7.
Embodiment
In a particular embodiment, the plurality of picture processing method under providing the present invention to conceive.Design concept of the present invention is process picture according to the attribute information of picture, the format information of picture is utilized to process targetedly in conjunction with multifrequency natures such as transparent characteristic, picture area, picture volume, color values, while reduction picture volume, ensure the quality of picture.Because different image contents is different, than if any picture color enrich, some picture colors are single, some pictures contain hyalomere and grade, different pictures has different characteristics, and the feature of various picture format is also different, some picture format rich colors, some picture format data volumes are little, the present invention make use of these characteristics exactly, the characteristic of the actual attribute of picture and various picture format is combined, process, thus ensure picture effect while reducing picture volume as far as possible, be particularly useful for uploading of picture, to share etc. in process, for user provides suitable picture, avoid the picture volume that causes because picture format is incorrect excessive, bandwidth waste, the problems such as picture quality difference.
In this embodiment, in the terminal equipment that the method applied environment of this picture processing can process picture for computer, mobile phone etc., as shown in Figure 1 and Figure 2, in such devices, user can select picture and carry out picture processing, and after process, picture-storage in such devices.The applied environment of this image processing method also can be the server of website or some application programs, as user can pass through the client of mobile phone or computer Website login or these application programs, after user selectes picture, process in this picture uploading to server, as shown in Figure 3, by server this picture completed and process and store.
embodiment 1:
There is provided a kind of JPG image processing method in the present embodiment, the equipment performing the method is computer, and be provided with in this computer and perform program command corresponding to following operation, this computer carries out the flow process of picture processing as shown in Figure 4.
User provides the original image of a JPG form.Jpeg format picture, also referred to as JPG format picture, it is modal a kind of picture format, stop after file " .jpg " by name or " .jpeg ", organized to set up by a software development federation, is a kind of lossy compression method form, JPEG compress technique is very advanced, it removes the view data of redundancy by lossy compression method mode, can represent very abundant lively image, can obtain good image quality with minimum disk space while obtaining high compression ratio.
The picture processing process of the JPG form provided for user in the present embodiment is as follows, as shown in Figure 4:
First, computer obtains the attribute information of original image, and the attribute information of described picture comprises picture area and picture color value.Picture area refers to the length of picture and wide product.Picture color value refers to the quantity of all colours had in all pixels comprised in picture.General each pixel is represented by one group of numerical value, travels through all pixels in this picture, and this group numerical value is identical, then represent identical color, is classified as a kind of color; If different, then represent different colors, color value increases a kind of, so just obtains the color value that this picture is all.
Then, computer judges whether the area of original image is less than area threshold, in the present embodiment, area threshold is 100*100 pixel, when being greater than this area threshold, then original image is carried out compression and obtain JPG format picture 1, and carry out compression after original image is converted into PNG form and obtain PNG format image 2, then calculate the volume of JPG format picture 1 and the volume of PNG format image 2.The volume of picture refers to the size of the memory space shared by picture, and the size as picture is 1k, 1M etc., and the volume size of picture is comprehensively determined by the many factors such as number of its area, pixel.After drawing the volume of JPG format picture 1 and the volume of PNG format image 2, then calculate the difference of these two volumes, as volume deviation, volume deviation is in fact with regard to the difference of the volume of two width pictures.If this volume deviation is less than 40K and the color value of original image is greater than 30000 kinds, then select JPG format picture 1 as the picture after process, otherwise select picture that the volume in JPG format picture 1 and PNG format image 2 is little as the picture after process.
Compression in said process, obtains JPG format picture 1 as original image is carried out compression, carries out compression and obtain PNG format image 2 after original image being converted into PNG form, and compression is wherein all lossy compression method.Lossy compression method is the characteristic (time such as stickiness etc.) according to human eye, and reduce semaphore, signal itself has certain loss, and namely image quality has loss.Compression ratio in the present embodiment selects 75%, in other mode, also can select 70%-80%.
In above process, after obtaining JPG format picture 1 and PNG format image 2, due to the picture of JPG form display, color is abundanter, if color value more as being greater than 30000 kinds in the present embodiment time, the graphic form of JPG form can be paid the utmost attention to, but the volume of picture can not be allowed again too large, therefore understand the picture 1 of prioritizing selection JPG form when the two width picture volumes obtained are more or less the same as the picture after process.When color value is few time, then do not need the picture of prioritizing selection JPG form, but consider the picture that selection volume is little, to reduce the space shared by picture.When volume difference is larger time, be also consider little preferential of volume, therefore be all select picture that volume is little as the picture after process in these situations.
In the execution mode that other can be replaced, described area threshold can select 500-22500 pixel, and color threshold can select the color value that 20000-35000 kind is different, and volume deviation can be selected within the scope of 20-50K.
Computer by above-mentioned processing mode, then can obtain the picture after processing.The characteristic of the actual attribute of picture and JPG picture format combines by the present invention, be optimized process, thus obtain picture format and the manifestation mode of expression original image information that can be optimum, improve the expression effect of picture, in being particularly useful for the uploading of picture, the process such as sharing, for user provides the suitable picture format of optimization, avoid that the picture volume that causes because picture format is incorrect is excessive, the problem such as bandwidth waste, poor image quality.
embodiment 2:
Another JPG image processing method is provided in the present embodiment, the method can be performed by mobile phone terminal, user stores the original image that a form is JPG form in mobile phone, there is the instruction performing following processing procedure in this mobile phone, thus complete following handling process, as shown in Figure 5, first, mobile phone reads original JPG picture attribute, this attribute comprises the format information of picture, area, color value, former compression ratio, the picture build-in attributes such as volume, then mobile phone judges the area of original image, if be less than 150*150 pixel, then by program, original image is converted to PNG8 form, as the picture after process.
If the area of original image is not less than above-mentioned threshold value 150*150 pixel, original image is then carried out lossy compression method by program and obtains JPG picture 1 by mobile phone, and carry out lossy compression method after original image being converted into PNG24 form (also can be converted to PNG32 form in other embodiment) and obtain PNG picture 2, then calculate the deviation of the volume of JPG picture 1 and PNG picture 2.If the color value of original image is greater than 20000 kinds and JPG picture 1 after compression and the volume deviation of PNG picture 2 are less than 50K, then JPG picture 1 is selected be picture after optimization; If the color value of original image is less than or equal to 20000 kinds, or when JPG picture 1 after compression and the volume deviation of PNG picture 2 are more than or equal to 50K, then select picture that volume is little as the picture after process.
In the process of above-mentioned lossy compression method, a compression ratio can be pre-set in mobile phone as 70% or 80%, carry out lossy compression method according to this compression ratio.In other implementations, also can obtain a Suitable compression ratio according to current situation, now need the former compression ratio first obtaining original image, if this former compression ratio is greater than 75%, then using 75% as compression ratio during described lossy compression method; If the former compression ratio of original image is less than 75%, then compression ratio when being described lossy compression method with the former compression ratio of original image compresses.
After completion of the above process, can using above by the picture after handset processes as final picture, also can be further processed by mobile phone, as the picture after the process obtained and original image are compared, if the picture format after process is identical with original image form, picture then after direct output processing, is stored in the storage card of mobile phone; If not identical, then original image carried out compressing the acquisition compressed picture consistent with original image form, the picture after this compressed picture and process is exported simultaneously, is stored in the storage card of mobile phone.So just can provide more selection for user, meet the diversity requirement of user.
In other preferred implementations, mobile phone, after having carried out above-mentioned process to picture, can also export the picture of a WEBP form for original image, be stored in Mobile phone card.Due to the picture of this WEBP picture format, some place obtains use, exports such width figure for subsequent use, also for user provides more convenience at this.In the process that picture exports, can as required for user export polytype picture, user can select as required, uses more convenient.
embodiment 3:
A kind of processing method of PNG picture is provided in the present embodiment, the equipment performing the method is server, store the instruction code performing following process in the server, user is by mobile phone Website login, there is provided user to select the interface of picture in website, when user selectes PNG picture uploading, server obtains the information of this picture, and this picture is handled as follows, flow chart as shown in Figure 6:
First, server determines the attribute information of the PNG picture that user selectes, and described attribute information comprises transparent characteristic, area, color value.
PNG format image, i.e. portable network graphic (PNG, PortableNetworkGraphics) are a kind of image file formats.PNG can provide the Lossless Compression image file of length less than GIF 30%.PNG form has 8,24,32 three kinds of forms, wherein 8 PNG support two kinds of different transparent form (index is transparent and alpha is transparent), 24 PNG do not support transparent, and 32 PNG add 8 transparent channels on 24 bases, therefore can represent 256 grades of transparencies.PNG8 and PNG24 numeral be below then represent this PNG form at most can the color value of index and storage." 8 " represent 8 powers namely 256 looks of 2,24 24 powers then representing 2 probably have more than 1,600 ten thousand looks.
Area and the color value of picture were introduced in the above-described embodiments, did not repeat them here.The transparent characteristic of picture refers in picture whether there is transparent pixel, if there is transparent pixel in picture, then think that this picture is translucent picture, if there is not transparent pixel in this picture, namely all pixels are all opaque, then think that this picture is not translucent picture.Whether pixel is transparent is represented by alpha channel (AlphaChannel).
Because the pictorial information comprised in PNG picture is more, in order to reduce the volume of picture, server first carries out Lossless Compression to original PNG picture, gets rid of the information not affecting picture display quality.Lossless Compression is merged by video signal to arrange, and signal itself is loss not.Original image is carried out nothing compress after, as the picture of subsequent treatment.
Then, server judges the transparent characteristic of original image further, when there is not transparent pixels point, judge area or the picture color value of picture, if picture area is less than 100*100 pixel or picture color value when being less than 30000 kinds of different colors, then the PNG picture after above-mentioned Lossless Compression is converted into PNG8 format picture; Otherwise, namely the area of picture be not less than 100*100 pixel and the color value of picture is not less than 30000 kinds when, PNG picture after Lossless Compression is carried out compression and obtains a width picture, and carry out compression again after the PNG picture after this Lossless Compression is converted to JPG form and obtain another secondary picture, then the volume of two width pictures after compression is compared, select to compress the little picture of rear volume as the picture after process, by the picture-storage after process in the server, check for user provides, the function such as download.
In the execution mode that other can be replaced, the threshold value of above-mentioned area can also select 500-22500 pixel, as 150*150 pixel; Above-mentioned color threshold can select the color value that 20000-35000 kind is different, as 20000 kinds, 25000 kinds or 35000 kinds.
In the image processing method that the present embodiment provides, by server, the original PNG picture that user selectes is processed, picture processing is carried out according to the attribute information of picture in the program, according to the transparent characteristic of picture, color value and area judge, achieve and better show original image information with less picture volume, improve the cost performance of picture quality and volume, be particularly useful for uploading of picture, to share etc. in process, for user provides the suitable picture of optimization, avoid the picture volume that causes because picture format is incorrect excessive, the problems such as bandwidth waste.
embodiment 4:
There is provided another PNG image processing method in the present embodiment, original image form is PNG, and handling process herein as shown in Figure 2.The equipment realizing the method is panel computer, user uses panel computer to be selected in the picture existed in this computer, in this panel computer, store the program command performing following operation, complete by running this instruction the process that the picture selected user processes, flow chart as shown in Figure 7.
After user selectes picture, first, panel computer performs the instruction of PNG picture processing, obtains the attribute of the picture after Lossless Compression, comprises the former compression ratio of the area of picture, color value, transparent characteristic and picture.The compression ratio of picture refers to the compression ratio of the digital imagery size after by encoder compresses and former digital imagery size.Then, Lossless Compression is carried out to original PNG picture, obtains the picture after Lossless Compression.
Then, call program wherein by panel computer, judge whether there is transparent pixel in original image, as exist transparent pixel then this original image be translucent picture, if there is no transparent pixel, then this picture is not translucent picture.In the process, if there is transparent pixel in original image, then carry out compression ratio to the picture after Lossless Compression be the lossy compression method of 75% and be converted into the picture being with transparent PNG8 form, the compression ratio of herein 75% is preferred compression ratio, and the compression ratio close with it such as 70-80% also can realize.
When being judged as NO, that is there is not transparent pixel in original image, then judge area or the color value of original image further, if area is less than 150*150 pixel, or picture color value is less than 35000 kinds, then the picture after Lossless Compression is converted into PNG8 form; Otherwise the picture after Lossless Compression is converted to JPG form, and the JPG format picture after conversion and the original PNG format image after Lossless Compression are carried out lossy compression method respectively, compression ratio can be set to 70%, then the picture volume after contrast compression, select the picture of the form that volume is little as the picture after process, be stored in panel computer.
After completion of the above process, can store above by the picture after panel computer process as final picture, also can be further processed by panel computer, as the picture after the process obtained and original image are compared, if the picture format after process is identical with original image form, picture then after direct output processing, is stored in the hard disk of panel computer; If not identical, then original image is carried out compressing the acquisition compressed picture consistent with original image form, the picture after this compressed picture and process is exported simultaneously and is stored in panel computer and selects for user.So just can provide more selection for user, meet the diversity requirement of user.
In other preferred implementations, panel computer, after having carried out above-mentioned process to picture, can also export the picture of a WEBP form for original image, and be stored in the hard disk of panel computer.Due to the picture of this WEBP picture format, obtain and promoted and use, exported such width figure at this for subsequent use, also for user provides more convenience.In the process that picture exports, can as required for user export polytype picture, user can select as required, uses more convenient.
embodiment 5:
In above-described embodiment 1 and 2, give the processing method of the picture for JPG form, be specially:
Obtain the attribute information of original image, described original image is JPG format picture, and the attribute information of described picture comprises picture area and picture color value; Judge whether the area of original image is less than area threshold, when being not less than area threshold, then original image is carried out compression and obtain the first format picture, and carry out compression after original image is converted into PNG form and obtain the second format picture, calculate the volume deviation of the first format picture and the second format picture, if this volume deviation is less than deviation threshold and the color value of original image is greater than color threshold, select the first format picture, otherwise select the picture that the volume in the first format picture and the second format picture is little.
In above-described embodiment 3 and 4, give the processing method for PNG format image, concrete grammar is:
First, determine the attribute information of original image, wherein said original image is PNG format image, and described attribute information comprises transparent characteristic, area, color value; Then, Lossless Compression is carried out to original image and obtain intermediate picture; Then, judging the transparent characteristic of described original image, when there is not transparent pixels point, judging area or the color value of original image, if original image area is less than area threshold or original image color value is less than color threshold, then described intermediate picture is converted into PNG8 format picture; Otherwise described intermediate picture is compressed, and compresses again after described intermediate picture is converted to JPG form, compare the volume of two width pictures after compression, select the picture that the rear volume of compression is little.
A kind of image processing method is provided in the present embodiment, in conjunction with above-mentioned two kinds of picture processing modes, can automatically chooses form and change, select suitable compression algorithm, obtain the picture after processing.The hardware environment realizing the method is server, and this server is connected with the computer of user, and the computer of user is provided with the interface of user's uploading pictures, the picture that server is selected by this interface captures user, and carries out picture processing.For the picture that user uploads, server according to picture format and other property parameters, can determine that PNG or JPG form selected by this picture, then determines the compression ratio of compressed picture volume according to algorithm.Flow process is as follows:
Step 1: user uploads a pictures (PNG or JPG form) by the upload interface in computer, server obtains the transparent characteristic of this picture, picture format, picture color value, picture area, picture volume, the property parameters of former compression ratio of picture etc. picture, then carries out the operation of step 2.The implication of these property parameters was introduced in the above-described embodiments, did not repeat them here.。
Step 2: server judges the form of picture, if picture format is PNG, first Lossless Compression is carried out to original PNG picture, then judge whether original PNG picture exists transparent pixel (whether being namely the translucent picture of band), in this way, perform step 3, if not, perform step 4.If picture is not PNG form and is JPG form, then perform step 6.
Step 3: carry out the picture that lossy compression method is converted into the transparent png8 form of band alpha simultaneously to original PNG picture, because former figure is PNG, so select the compression ratio of 75% during lossy compression method, is preferred value through a large amount of figure built-in testing 75%.
Step 4: picture is the PNG picture that there is not transparent pixels point, now judge the area of original image, area as original image is less than 100*100 pixel or picture color value is less than 30000 kinds, then the picture after Lossless Compression in step 2 is transferred to the picture of PNG8 form.If not, perform step 5.
Step 5: the PNG picture after Lossless Compression in step 2 is converted to JPG form, then the picture of this JPG form is carried out lossy compression method, and the PNG picture after Lossless Compression is also carried out lossy compression method, compression ratio is all 75%, picture volume again after contrast compression, export the little picture of volume as the picture after process, and be stored in the hard disk of server.
Step 6: picture is JPG form, first obtains the former compression ratio of picture, if compression ratio is greater than 75%, specifies the compression ratio of follow-up lossy compression method to be 75%, if be less than 75%, specifies the compression ratio of follow-up lossy compression method to be the former compression ratio of picture.If picture area is less than 100*100, picture is transferred to the picture of PNG8 form.If not, perform step 7.
Step 7: picture is converted to PNG form, PNG24 or PNG32 can be converted into as required herein, PNG32 form is converted in the present embodiment, original JPG picture is carried out lossy compression method and obtains JPG picture 1, this PNG format image is carried out lossy compression method and obtains PNG picture 2, the compression ratio that compression ratio obtains according to step 6.If original image color value be greater than 30000 and the volume deviation of JPG picture 1 and PNG picture 2 is less than 50k time, then adopt JPG picture 1 as the picture after preferably; Otherwise, if picture color value is less than 30000 or the volume deviation of JPG picture 1 and PNG picture 2 when being more than or equal to 50k, then contrasts the picture volume of two kinds of forms, select the picture of the form that volume is little as the picture after process, be stored in the hard disk of server.The volume deviation of two width pictures in the present embodiment is in fact with regard to the difference of the volume of two width pictures.
Step 8: execute above step, server obtain one consistent with former bitmap-format or converted the picture of picture format, if obtain the picture different from original image form, the compressed picture identical with original image form is obtained after then continuing that a lossy compression method is carried out to original image, picture after the process exporting this compressed picture simultaneously and converted form, is stored in the hard disk of server, if obtain the identical picture of picture format, direct output, is stored in the hard disk of server.Now can also carry out once format conversion by converted the picture after format analysis processing, being converted to the form of original image, then output in the hard disk of server in the lump.The picture/mb-type exported can be selected according to the needs of user, and performs step 9.
Step 9: the picture (chrome support) for subsequent use exporting a WEBP form for former figure, is stored in the hard disk of server.
Step 10: all picture presentations that above-mentioned process can also export by server afterwards, in the computer interface of user, are selected for user, also can be user's recommendation wherein one or more simultaneously.
Image processing method in the present embodiment, may be used for server and processes picture, supports User Defined compression ratio and batch process.Can automatically for user select suitable picture format, avoid the picture volume that causes because picture format is incorrect excessive, the problems such as bandwidth waste.
In addition, for the picture of extended formatting as the original image of the forms such as bmp, gif, also can under the enlightenment of the present invention's design, according to the own characteristic of these picture formats and the feature of these other property parameters of picture, carry out format conversion and compression optimization, the picture be optimized.
Such as, if original image is dynamic gif picture, then do not process, if original image is static gif, be then converted to the picture of jpg form, then reduced volume, because jpg is better than gif in image quality, but volume not necessarily, finally chooses the little picture of volume as the picture exported.
embodiment 6:
There is provided a kind of picture processing device in the present embodiment, for processing the picture of PNG form, structured flowchart as shown in Figure 8, comprises
Property extracting module: the attribute information determining original image, wherein said original image is PNG format image, and described attribute information comprises transparent characteristic, area, color value;
Lossless compression modules: Lossless Compression is carried out to original image and obtains intermediate picture;
Judge modular converter: the transparent characteristic judging described original image, when there is not transparent pixels point, judge area or the color value of original image, if original image area is less than area threshold or original image color value is less than color threshold, then described intermediate picture is converted into PNG8 format picture; Otherwise described intermediate picture is compressed, and compresses again after described intermediate picture is converted to JPG form, compare the volume of two width pictures after compression, select the picture that the rear volume of compression is little.
Preferably, judge modular converter also for judging when there is transparent pixels point, then the picture being with transparent PNG8 form is converted into middle picture compression.
Further preferably, judge that the described compression in modular converter is lossy compression method.
The compression ratio of lossy compression method described in the present embodiment is 75%, and described area threshold is 10000 pixels, and described color threshold is 30000 kinds of different colours.In other implementations, the compression ratio of described lossy compression method is 70%-80%, and described area threshold is 500 pixel to 22500 pixels, and described color threshold is 20000 to 35000 kinds of different colours.
Picture processing device in the present embodiment can realize the optimization process to PNG format image, for the original image that user provides, in conjunction with contents attribute and the format characteristic of picture, be optimized process, obtain preferred form and the form of expression, optimize the expression way of picture.
embodiment 7:
There is provided another picture processing device in the present embodiment, for processing the picture of JPG form, structured flowchart as shown in Figure 9, comprises
Extraction module: the attribute information obtaining original image, described original image is JPG format picture, and the attribute information of described picture comprises picture area and picture color value;
Judge module: judge whether the area of original image is less than area threshold, as no, then original image is carried out compression and obtain the first format picture, and carry out compression after original image is converted into PNG form and obtain the second format picture, calculate the volume deviation of the first format picture and the second format picture, if this volume deviation is less than deviation threshold and the color value of original image is greater than color threshold, select the first format picture, otherwise select the picture that the volume in the first format picture and the second format picture is little.
Preferably, original image also for judging whether the area of original image is less than area threshold, in this way, is then converted to PNG8 format picture by described judge module.
In addition, the described boil down in described judge module is lossy compression method.
In other implementations, described attribute information also comprises the former compression ratio of original image, described judge module also comprises acquisition compression ratio submodule: the compression ratio obtaining described lossy compression method, if the former compression ratio of original image is greater than 75%, then using 75% as the compression ratio of described lossy compression method; If the former compression ratio of original image is less than 75%, then compression ratio when being described lossy compression method with the former compression ratio of original image.
In the present embodiment, described first format picture is JPG format picture, and described second format picture is PNG format image.Described area threshold is 10000 pixels, and described color threshold is 30000 kinds of different colours, and described volume deviation threshold value is 50k.In other embodiments.Described area threshold is 500 pixel to 22500 pixels, and described color threshold is 20000-35000 kind different colours, and described volume deviation threshold value can select 20K to 50k.
Picture processing device in the present embodiment can realize the optimization process to JPG format picture, for the original image that user provides, in conjunction with contents attribute and the format characteristic of picture, be optimized process, obtain preferred form and the form of expression, optimize the expression way of picture.
embodiment 8:
A kind of picture processing platform is provided in the present embodiment, comprise the picture processing device in above-described embodiment 6 and 7 and memory device simultaneously, this picture processing device is used for processing picture, this memory device is used for the picture after stores processor, described picture is processed, can be used for the picture uploading in website, share, in the service such as storage.In other picture processing platform, also can only include any one the picture processing device in above-described embodiment 6 or 7.
This picture processing platform is a kind of intelligent image platform, also referred to as intelligence figure platform.User is when use one pictures, and often wish that picture quality is good, volume is little, and this needs between picture image quality and volume, do one and weighs.The picture compression demand of PNG, JPEG, GIF multiple format blends into one by intelligence figure platform, the operability of more convenient user and selectivity.
Meanwhile, intelligence figure platform body is now intelligent.User is when selection picture format, often a not clear pictures should use PNG form or jpeg format, use PNG32 or PNG8, or alpha+PNG8, so the picture processing device in intelligence figure platform helps user automatically to change suitable and optimum picture format, be pushed to user as recommendation form.Because the picture of WEBP form now starts gradually popular, intelligence figure platform also will change the picture of a WEBP form for user, the picture volume of WEBP form can be less relative to JPEG, and image quality is better.
The technology used mainly comprises HTML5FileAPI, ImageMagick storehouse, PNGCRUSH storehouse, PNGQUANT storehouse, and the picture optimized treatment method in above-described embodiment.Wherein, HTML5FileAPI: provide user to pull uploading pictures and the foreground interface clicking uploading pictures.ImageMagick provides picture switching foundation, provides picture compression, picture WEBPization image converting method of Denging.PNGCRUSH realizes PNG lossless compression algorithm storehouse.PNGQUANT realizes PNG Lossy Compression Algorithm storehouse.
In the handling procedure of picture processing device, make use of the image processing method in other embodiments above-mentioned, process according to the form of photo current and attribute, if, former figure is JPEG, first obtain former figure attribute, again according to former figure attribute, parameter (colour number, area value, transparency etc.) for picture judges the whether suitable picture transferring PNG or PNG8 to of picture, finally the volume of contrast front and back picture, preferentially adopts.All introduce in detail in the embodiment of concrete method above, repeat no more.
Concrete operations are as follows:
(1) enter the page, a pictures is uploaded in user's click or a pictures (picture format can be PNG, JPEG, GIF) is uploaded in pulling
(2) picture processing platform is automatically selected suitable compression quality for user and is recommended suitable picture format.
(3) user can contrast the image quality of new picture and former figure on the page, provides panorama sketch to contrast and thumbnail contrast.
(4) if the image quality volume of dissatisfied picture, user can select other compression ratios compressed picture again.
(5) user can download the new picture after conversion.
(6) batch uploading pictures is supported, batch download pictures.
Picture processing platform in the present embodiment, by need upload or share picture by uploading after above-mentioned process, improve the quality of picture.
Obviously, above-described embodiment is only for clearly example being described, and the restriction not to execution mode.For those of ordinary skill in the field, can also make other changes in different forms on the basis of the above description.Here exhaustive without the need to also giving all execution modes.And thus the apparent change of extending out or variation be still among the protection range of the invention.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.

Claims (16)

CN201410484687.0A2014-09-192014-09-19Picture processing method, picture processing device, picture processing platform and storage mediumActiveCN105430393B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201410484687.0ACN105430393B (en)2014-09-192014-09-19Picture processing method, picture processing device, picture processing platform and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201410484687.0ACN105430393B (en)2014-09-192014-09-19Picture processing method, picture processing device, picture processing platform and storage medium

Publications (2)

Publication NumberPublication Date
CN105430393Atrue CN105430393A (en)2016-03-23
CN105430393B CN105430393B (en)2020-02-11

Family

ID=55508288

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201410484687.0AActiveCN105430393B (en)2014-09-192014-09-19Picture processing method, picture processing device, picture processing platform and storage medium

Country Status (1)

CountryLink
CN (1)CN105430393B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107333135A (en)*2017-06-052017-11-07贵阳朗玛信息技术股份有限公司The rendering method and device of image picture
CN108154542A (en)*2017-12-222018-06-12北京小鱼在家科技有限公司A kind of method for increasing translucent attribute to JPG files
CN108681449A (en)*2018-05-172018-10-19北京航空航天大学Digital satellite load information compresses multiple connection source code artificial intelligence Writing method
CN109271540A (en)*2018-09-262019-01-25浙江万朋教育科技股份有限公司A kind of implementation method of combination picture lossy compression and record transparence information
WO2019192324A1 (en)*2018-04-022019-10-10腾讯科技(深圳)有限公司Image sharing method, computer apparatus, and storage medium
CN110322381A (en)*2019-07-302019-10-11江西师范大学A kind of PS teaching method Internet-based and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR100736750B1 (en)*2006-03-072007-07-06케이티하이텔솔루션(주) Mobile content provision system and method
WO2007099327A2 (en)*2006-03-012007-09-07Symbian Software LimitedData compression
CN102291506A (en)*2010-06-212011-12-21腾讯科技(深圳)有限公司Picture uploading method and device
CN102546899A (en)*2010-12-102012-07-04上海晨兴希姆通电子科技有限公司Cell phone and picture processing method of cell phone
CN102611823A (en)*2012-01-132012-07-25百度在线网络技术(北京)有限公司Method and equipment capable of selecting compression algorithm based on picture content
CN102957906A (en)*2011-08-292013-03-06广州九游信息技术有限公司Method and system for image classifying compression
CN103826028A (en)*2012-11-192014-05-28腾讯科技(深圳)有限公司Method and device for compressing picture in lossless way

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2007099327A2 (en)*2006-03-012007-09-07Symbian Software LimitedData compression
KR100736750B1 (en)*2006-03-072007-07-06케이티하이텔솔루션(주) Mobile content provision system and method
CN102291506A (en)*2010-06-212011-12-21腾讯科技(深圳)有限公司Picture uploading method and device
CN102546899A (en)*2010-12-102012-07-04上海晨兴希姆通电子科技有限公司Cell phone and picture processing method of cell phone
CN102957906A (en)*2011-08-292013-03-06广州九游信息技术有限公司Method and system for image classifying compression
CN102611823A (en)*2012-01-132012-07-25百度在线网络技术(北京)有限公司Method and equipment capable of selecting compression algorithm based on picture content
CN103826028A (en)*2012-11-192014-05-28腾讯科技(深圳)有限公司Method and device for compressing picture in lossless way

Cited By (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107333135A (en)*2017-06-052017-11-07贵阳朗玛信息技术股份有限公司The rendering method and device of image picture
CN108154542A (en)*2017-12-222018-06-12北京小鱼在家科技有限公司A kind of method for increasing translucent attribute to JPG files
CN108154542B (en)*2017-12-222021-11-02上海小度技术有限公司Method for adding semitransparent property to JPG file
WO2019192324A1 (en)*2018-04-022019-10-10腾讯科技(深圳)有限公司Image sharing method, computer apparatus, and storage medium
US11483414B2 (en)2018-04-022022-10-25Tencent Technology (Shenzhen) Company LimitedPicture sharing method, computer device, and storage medium
CN108681449A (en)*2018-05-172018-10-19北京航空航天大学Digital satellite load information compresses multiple connection source code artificial intelligence Writing method
CN109271540A (en)*2018-09-262019-01-25浙江万朋教育科技股份有限公司A kind of implementation method of combination picture lossy compression and record transparence information
CN109271540B (en)*2018-09-262021-05-25浙江万朋教育科技股份有限公司Implementation method for combining picture lossy compression and recording transparency information
CN110322381A (en)*2019-07-302019-10-11江西师范大学A kind of PS teaching method Internet-based and system

Also Published As

Publication numberPublication date
CN105430393B (en)2020-02-11

Similar Documents

PublicationPublication DateTitle
CN105430393A (en)Picture processing method, picture processing device and picture processing platform
CN105491398A (en)Picture processing method, picture processing device and picture processing platform
CN108810622B (en)Video frame extraction method and device, computer readable medium and electronic equipment
KR100900342B1 (en)Panoramic Image processing method
CN102291506B (en)The method of picture uploading and device
CN114640783B (en)Photographing method and related equipment
WO2020192692A1 (en)Image processing method and related apparatus
CN106165409B (en)Image processing apparatus, photographic device, image processing method and program
CN103765473B (en)The method and device of the digital image representation of the adjustment of view are provided
CN111480158B (en) File management method and electronic equipment
WO2021008348A1 (en)Image display method and device, mobile terminal, and storage medium
CN117915088A (en)Video processing method, video processing device, electronic equipment and computer readable storage medium
CN105975168A (en)OSD menu fading-in and fading-out method and device
CN116048323B (en)Image processing method and electronic equipment
CN110956572A (en)Image processing method, device and system
CN117671042A (en)Compression method and device of mapping resource, storage medium and electronic equipment
CN108235024B (en)Method and device for compressing image
EP4548297A1 (en)High dynamic range video formats with low dynamic range compatibility
CN104463790A (en)Image processing method, apparatus and system
CN114385847B (en)Picture data processing method and device, computer equipment and storage medium
CN116304396A (en) Page rendering method, device, electronic device and storage medium
CN115460343A (en) Image processing method, device and storage medium
KR20070095031A (en) Convert offline two-dimensional images to three-dimensional images
CN113935902A (en) Image stitching method, device, electronic device and storage medium
CN110378973A (en) Image information processing method, device, and electronic device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp