CN105139341B - A kind of GIF image edit methods and device - Google Patents

A kind of GIF image edit methods and device Download PDF

Info

Publication number
CN105139341B
CN105139341B CN201510603608.8A CN201510603608A CN105139341B CN 105139341 B CN105139341 B CN 105139341B CN 201510603608 A CN201510603608 A CN 201510603608A CN 105139341 B CN105139341 B CN 105139341B
Authority
CN
China
Prior art keywords
image file
scaling
original image
interception
zoom factor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510603608.8A
Other languages
Chinese (zh)
Other versions
CN105139341A (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.)
Alibaba China Co Ltd
Youku Network Technology Beijing Co Ltd
Original Assignee
1Verge Internet Technology Beijing 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 1Verge Internet Technology Beijing Co Ltd filed Critical 1Verge Internet Technology Beijing Co Ltd
Priority to CN201510603608.8A priority Critical patent/CN105139341B/en
Publication of CN105139341A publication Critical patent/CN105139341A/en
Application granted granted Critical
Publication of CN105139341B publication Critical patent/CN105139341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Television Signal Processing For Recording (AREA)
  • Studio Circuits (AREA)
  • Studio Devices (AREA)

Abstract

The present invention provides a kind of GIF image edit methods, the described method includes:Using zoom factor, processing is zoomed in and out to original image file, image file after being scaled;Interception scope is determined from image file after the scaling, and according to the interception scope and the zoom factor, determines relative position of the interception scope in the original image file;According to the size of the original image file, the relative position in the original image file is saved as to image file after editing.Such scheme, so that it may the pixel for carrying image information be avoided to lose to a certain extent, retain this partial pixel point as far as possible, so that it may make it possible that picture quality remains unchanged after editor.

Description

A kind of GIF image edit methods and device
Technical field
The present invention relates to data processing field, more particularly to a kind of GIF image edit methods and device.
Background technology
Graphic interchange format (English:Graphics Interchange Format, referred to as:GIF) it is a kind of image file Form.In general, a gif file may include file header (English:File Header), GIF data stream (English:GIF Data Stream) and file terminator is (English:Trailer), wherein, file header can include gif file signature (English: Signature) and version number is (English:Version);GIF data stream may include control block (English:Control Block) and Data block (English:Data Blocks), control block is used to control the broadcasting behavior of data block, and data block can store several figures As file, if reading and playing the multiple image file by width, animation effect can be formed;File terminator is used to represent The end of file.
At present, video GIF recording process can be presented as:Currently playing video views are intercepted, directly turn video views It changes multiple image file into, and generates one according to introduction made above to include file header, GIF data stream and file terminator Gif file.
When carrying out gif file recording, can editing and processing be carried out to image file according to practical application request.Citing For, editing and processing is specially that image file is amplified, and detailed process can be summarized as follows:First on the basis of original image Directly amplify the pixel of image;Secondly the size according to original image file preserves amplified image, after obtaining enhanced processing Image file.It should be noted that in the case where image file size is constant, such editing and processing is likely to result in image The pixel that middle part carries information is lost, and causes the poor quality images of edited gif file, influences result of broadcast.
The content of the invention
The embodiment of the present invention provides a kind of GIF image edit methods and device, to solve GIF images volume in the prior art Caused by volume the technical issues of poor quality images.
A kind of GIF image edit methods, the described method includes:
Using zoom factor, processing is zoomed in and out to original image file, image file after being scaled;
Interception scope is determined from image file after the scaling, and scope and the zoom factor are intercepted according to described, Determine relative position of the interception scope in the original image file;
According to the size of the original image file, the relative position in the original image file is saved as to image after editing File.
Preferably, the mode for determining the zoom factor is:
It is instructed in response to scaling, determines to zoom in and out the original image file zoom factor of processing.
Preferably, determine that the mode for intercepting scope is:
It is instructed in response to interception, determines the position of interception scope image file after the scaling.
Preferably, determine that the mode for intercepting scope is:
According to video ratio, position of the interception scope after the scaling in image file is determined.
Preferably, according to the interception scope and the zoom factor, determine the interception scope in original image text Relative position in part, including:
Obtain the position coordinates of four endpoints of the interception scope;
Using the position coordinates difference of four endpoints divided by the zoom factor, four endpoints are obtained described Relative coordinate in original image file;
The relative position is determined according to the relative coordinate.
A kind of GIF image editing apparatus, described device include:
Processing unit is scaled, for utilizing zoom factor, processing is zoomed in and out to original image file, image after being scaled File;
Scope determination unit is intercepted, for determining interception scope from image file after the scaling;
Relative position determination unit, for according to the interception scope and the zoom factor, determining the interception scope Relative position in the original image file;
For the size according to the original image file, the relative position in the original image file is protected for storage unit Save as image file after editing.
Preferably, the scaling processing unit, specifically in response to scaling instruct, determine to the original image file into The zoom factor of row scaling processing.
Preferably, the interception scope determination unit specifically for being instructed in response to interception, determines that the interception scope exists The position of image file after the scaling.
Preferably, the interception scope determination unit, specifically for according to video ratio, determining the interception scope in institute State the position in image file after scaling.
Preferably, the relative position determination unit includes:
Position coordinates obtaining unit, for obtaining the position coordinates of four endpoints of the interception scope;
Relative coordinate obtaining unit, for utilizing the position coordinates of four endpoints difference divided by the zoom factor, Obtain relative coordinate of four endpoints in the original image file;
Relative position determination subelement, for determining the relative position according to the relative coordinate.
Compared with prior art, GIF image edit methods and device provided in an embodiment of the present invention, utilize zoom factor pair Original image file zooms in and out processing, image file after being scaled, and determines interception scope in image file after scaling, Zoom factor and interception scope can be utilized, relative position of the interception scope in original image file is calculated, and then utilizes the phase To the edited image file of the view generation of position.The edited figure of the view generation for intercepting scope is utilized compared with the prior art As file, the present invention program, so that it may the pixel for carrying image information be avoided to lose to a certain extent, retain this part as far as possible Pixel, so that it may make it possible that picture quality remains unchanged after editor.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for For those of ordinary skill in the art, without having to pay creative labor, it can also be obtained according to these attached drawings His attached drawing.
Fig. 1 is the flow chart of GIF image edit methods of the embodiment of the present invention;
Fig. 2 is the structure diagram of GIF image editing apparatus of the embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work Embodiment belongs to the scope of protection of the invention.
With reference to figure 1, a kind of flow chart of GIF image edit methods of the embodiment of the present invention is shown, can include following step Suddenly:
S101 using zoom factor, zooms in and out processing, image file after being scaled to original image file.
It should be noted that the present embodiments relate to editing and processing be mainly reflected in the scaling processing procedure of image. First, can be completed to handle the scaling of original image file according to zoom factor, image file after being scaled.Using enhanced processing as Example, the step can be presented as, according to zoom factor, amplify the pixel in original image file.
As a kind of example, zoom factor can be specifically determined in the following manner:
Mode one can receive externally input scaling instruction, zoom factor is extracted in being instructed from scaling, and then according to scaling The factor completes scaling processing.
Mode two, image file after can also first being scaled according to user's operation, after recycling original image file and scaling Image file calculates zoom factor.For example, user is completed by this operational motion of roll mouse to original image file Scaling processing, image file after scale, then compare original image file and scaling after image file size, acquisition scale because Son.
S102 determines interception scope from image file after the scaling.
Image file after being scaled by scaling processing can therefrom determine interception scope, i.e. the image text after scaling Part centre circle makes user and wishes position where the view retained, alternatively, it is also understood that being to determine after compiled processing most Any need that partial view is presented eventually.
As a kind of example, interception scope can be specifically determined in the following manner:
Mode one, can receive it is externally input interception instruction, according to interception instruction instruction, after scaling in image file Determine interception scope.For example, the position coordinates of four endpoints of interception scope can be included in interception instruction.
Mode two can determine interception scope according to video ratio after scaling in image file.Wherein, video ratio The video pictures length of video player broadcasting and wide ratio are can be understood as, e.g., video ratio can be 4:3、16:9 etc.. Scope is intercepted according to video ratio-dependent, can effectively avoid in image file and black surround phenomenon occur, as far as possible image file is made only to wrap Include the pixel for carrying image information.
Mode three can combine interception instruction and video ratio, comprehensive to determine interception scope, specifically can refer to above two Mode realizes that details are not described herein again.
S103 according to the interception scope and the zoom factor, determines the interception scope in the original image file In relative position.
Relative position in the original image file according to the size of the original image file, is saved as editor by S104 Image file afterwards.
After obtaining zoom factor and interception scope, you can clearly go out the view for needing to present in original image file according to the two Relative position, when carrying out preserving operation, directly to utilize the view of the relative position in original image file, generation volume Image file after volume.Compared with the prior art preservation operation, such scheme, so that it may to a certain extent are carried out for image after scaling The pixel for carrying image information is avoided to lose, retains this partial pixel point as far as possible, so that it may which picture quality is kept not after making editor It is turned into possibility.
As a kind of example, the relative position can be specifically determined in the following manner, it may include:First, with reference to scaling Coordinate system used in image file afterwards obtains the position coordinates of four endpoints of the interception scope;Secondly, described four ends are utilized The position coordinates difference of point divided by the zoom factor obtain opposite seat of four endpoints in the original image file Mark;Finally, according to the four of acquisition relative coordinates, the relative position is determined in source image file.
It should be noted that the editing process of the embodiment of the present invention is illustrated only by taking enhanced processing as an example above, In view of in scaling processing procedure, the number for carrying the pixel of image information after scaling in image file does not change, And processing or diminution processing are whether amplified to pixel, for original image file, it can generate image matter The problem of quantitative change is poor, therefore, the embodiment of the present invention are also suitable for image down processing procedure, and specific implementation process can refer to Introduction made above, details are not described herein again.
In addition, it is necessary to explanation, if in GIF recording process, at least two are obtained from interception conversion in video is played GIF image files then before picture editting is carried out, may also be responsive to externally input instruction, from least two GIF image files One GIF image file of middle selection is as the original image file in the embodiment of the present invention.
With method as described above correspondingly, referring to Fig. 2, the embodiment of the present invention additionally provides a kind of GIF picture edittings dress It puts, can specifically include:
Processing unit 201 is scaled, for utilizing zoom factor, processing is zoomed in and out to original image file, after being scaled Image file;
Scope determination unit 202 is intercepted, for determining interception scope from image file after the scaling;
Relative position determination unit 203, for according to the interception scope and the zoom factor, determining the interception model The relative position being trapped among in the original image file;
Storage unit 204, for the size according to the original image file, by the relative position in the original image file Save as image file after editing.
Optionally, the scaling processing unit, specifically in response to scaling instruct, determine to the original image file into The zoom factor of row scaling processing.
Optionally, the interception scope determination unit specifically for being instructed in response to interception, determines that the interception scope exists The position of image file after the scaling.
Optionally, the interception scope determination unit, specifically for according to video ratio, determining the interception scope in institute State the position in image file after scaling.
Optionally, the relative position determination unit includes:
Position coordinates obtaining unit, for obtaining the position coordinates of four endpoints of the interception scope;
Relative coordinate obtaining unit, for utilizing the position coordinates of four endpoints difference divided by the zoom factor, Obtain relative coordinate of four endpoints in the original image file;
Relative position determination subelement, for determining the relative position according to the relative coordinate.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight Point explanation is all difference from other examples, and just to refer each other for identical similar part between each embodiment. For device class embodiment, since it is basicly similar to embodiment of the method, so description is fairly simple, related part ginseng See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, term " comprising ", "comprising" or its any other variant are intended to Cover non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only include those Element, but also including other elements that are not explicitly listed or further include as this process, method, article or set Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that Also there are other identical elements in the process, method, article or apparatus that includes the element.
A kind of GIF image edit methods provided by the present invention are described in detail above, tool used herein Body example is set forth the principle of the present invention and embodiment, and the explanation of above example is only intended to help to understand this hair Bright method and its core concept;Meanwhile for those of ordinary skill in the art, thought according to the invention, specific real There will be changes in mode and application range are applied, in conclusion this specification content should not be construed as the limit to the present invention System.

Claims (10)

1. a kind of GIF image edit methods, which is characterized in that the described method includes:
Using zoom factor, processing is zoomed in and out to original image file, image file after being scaled;Wherein described zoom factor It extracts in being instructed from scaling or is calculated according to image file after original image file and scaling;
Interception scope is determined from image file after the scaling, and according to the interception scope and the zoom factor, is determined Relative position of the interception scope in the original image file;
According to the size of the original image file, image is literary after the relative position in the original image file is saved as editor Part.
2. according to the method described in claim 1, it is characterized in that, the mode for determining the zoom factor is:
It is instructed in response to scaling, determines to zoom in and out the original image file zoom factor of processing.
3. according to the method described in claim 1, it is characterized in that, the mode for determining the interception scope is:
It is instructed in response to interception, determines the position of interception scope image file after the scaling.
4. according to the method described in claim 1, it is characterized in that, the mode for determining the interception scope is:
According to video ratio, position of the interception scope after the scaling in image file is determined.
5. according to the method described in claim 1, it is characterized in that, according to the interception scope and the zoom factor, determine Relative position of the interception scope in the original image file, including:
Obtain the position coordinates of four endpoints of the interception scope;
Using the position coordinates difference of four endpoints divided by the zoom factor, four endpoints are obtained in the artwork As the relative coordinate in file;
The relative position is determined according to the relative coordinate.
6. a kind of GIF image editing apparatus, which is characterized in that described device includes:
Processing unit is scaled, for utilizing zoom factor, processing is zoomed in and out to original image file, image text after being scaled Part;Wherein described zoom factor is extracted in being instructed from scaling or calculated according to image file after original image file and scaling;
Scope determination unit is intercepted, for determining interception scope from image file after the scaling;
Relative position determination unit, for according to the interception scope and the zoom factor, determining the interception scope in institute State the relative position in original image file;
For the size according to the original image file, the relative position in the original image file is saved as storage unit Image file after editor.
7. device according to claim 6, which is characterized in that the scaling processing unit, specifically in response to scaling Instruction determines to zoom in and out the original image file zoom factor of processing.
8. device according to claim 6, which is characterized in that it is described interception scope determination unit, specifically in response to Interception instruction determines the position of interception scope image file after the scaling.
9. device according to claim 6, which is characterized in that the interception scope determination unit is regarded specifically for basis Frequency ratio example determines position of the interception scope after the scaling in image file.
10. device according to claim 6, which is characterized in that the relative position determination unit includes:
Position coordinates obtaining unit, for obtaining the position coordinates of four endpoints of the interception scope;
Relative coordinate obtaining unit, for using the position coordinates of four endpoints difference divided by the zoom factor, obtaining Relative coordinate of four endpoints in the original image file;
Relative position determination subelement, for determining the relative position according to the relative coordinate.
CN201510603608.8A 2015-09-21 2015-09-21 A kind of GIF image edit methods and device Active CN105139341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510603608.8A CN105139341B (en) 2015-09-21 2015-09-21 A kind of GIF image edit methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510603608.8A CN105139341B (en) 2015-09-21 2015-09-21 A kind of GIF image edit methods and device

Publications (2)

Publication Number Publication Date
CN105139341A CN105139341A (en) 2015-12-09
CN105139341B true CN105139341B (en) 2018-05-29

Family

ID=54724674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510603608.8A Active CN105139341B (en) 2015-09-21 2015-09-21 A kind of GIF image edit methods and device

Country Status (1)

Country Link
CN (1) CN105139341B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657836A (en) * 2016-11-28 2017-05-10 合网络技术(北京)有限公司 Method and device for making graphics interchange format chart
CN107390986A (en) * 2017-07-05 2017-11-24 Tcl移动通信科技(宁波)有限公司 A kind of mobile terminal cuts out figure control method, storage device and mobile terminal
CN111034187A (en) * 2018-09-03 2020-04-17 深圳市大疆创新科技有限公司 Dynamic image generation method and device, movable platform and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4793723B2 (en) * 2006-04-27 2011-10-12 イーコンピュート株式会社 Server device and program related to server device
CN104268827A (en) * 2014-09-24 2015-01-07 三星电子(中国)研发中心 Method and device for amplifying local area of video image
CN104360803A (en) * 2014-10-30 2015-02-18 深圳市金立通信设备有限公司 Terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8107724B2 (en) * 2008-08-02 2012-01-31 Vantrix Corporation Method and system for predictive scaling of colour mapped images

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4793723B2 (en) * 2006-04-27 2011-10-12 イーコンピュート株式会社 Server device and program related to server device
CN104268827A (en) * 2014-09-24 2015-01-07 三星电子(中国)研发中心 Method and device for amplifying local area of video image
CN104360803A (en) * 2014-10-30 2015-02-18 深圳市金立通信设备有限公司 Terminal

Also Published As

Publication number Publication date
CN105139341A (en) 2015-12-09

Similar Documents

Publication Publication Date Title
CN104822088B (en) Video image zooming method and apparatus
EP3329682B1 (en) A system for compositing video with interactive, dynamically rendered visual aids
US10521468B2 (en) Animated seek preview for panoramic videos
CN103702040B (en) Real-time video figure ornament superposition processing method and system
US10235795B2 (en) Methods of compressing a texture image and image data processing system and methods of generating a 360 degree panoramic video thereof
WO2018059034A1 (en) Method and device for playing 360-degree video
CN104967893B (en) The video generation method and device of mancarried electronic aid
WO2016114930A2 (en) Systems and methods for augmented reality art creation
CN105139341B (en) A kind of GIF image edit methods and device
JP6064815B2 (en) Method for temporarily stopping video presentation, calculation processing system and program
Ruzinoor et al. A review on 3D terrain visualization of GIS data: techniques and software
CN108958609A (en) Generation method, device, storage medium and the terminal device of three-dimensional panorama surface plot
CN107133206A (en) A kind of digital content makes and demonstration tool and its application
JP5028263B2 (en) Presentation display device, computer control method and program
CN114339363B (en) Picture switching processing method and device, computer equipment and storage medium
CN106445439A (en) Method for online exhibiting pictures
US9036941B2 (en) Reducing moiré patterns
EP2634690A1 (en) Method and apparatus for setting user interface
CN101976195A (en) Method and device for setting user interface
CN106354381B (en) Image file processing method and device
JP2010272032A (en) Method and device for drawing outline of polygon
JP2001339597A (en) Method for embedding electronic watermark information to vector type map data
Kuchelmeister et al. The Amnesia Atlas. An immersive SenseCam interface as memory-prosthesis
CN102012914A (en) Method and device for processing web page images
JP5528410B2 (en) Viewer device, server device, display control method, electronic comic editing method and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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
CP01 Change in the name or title of a patent holder

Address after: 100080 Beijing Haidian District city Haidian street A Sinosteel International Plaza No. 8 block 5 layer A, C

Patentee after: Youku network technology (Beijing) Co.,Ltd.

Address before: 100080 Beijing Haidian District city Haidian street A Sinosteel International Plaza No. 8 block 5 layer A, C

Patentee before: 1VERGE INTERNET TECHNOLOGY (BEIJING) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200319

Address after: 310001 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 100080 Beijing Haidian District city Haidian street A Sinosteel International Plaza No. 8 block 5 layer A, C

Patentee before: Youku network technology (Beijing) Co.,Ltd.