CN105139341A - GIF image editing method and device - Google Patents

GIF image editing method and device Download PDF

Info

Publication number
CN105139341A
CN105139341A CN201510603608.8A CN201510603608A CN105139341A CN 105139341 A CN105139341 A CN 105139341A CN 201510603608 A CN201510603608 A CN 201510603608A CN 105139341 A CN105139341 A CN 105139341A
Authority
CN
China
Prior art keywords
image file
convergent
divergent
original image
intercepting
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
CN201510603608.8A
Other languages
Chinese (zh)
Other versions
CN105139341B (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.)
Youku Culture 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

A GIF image editing method provided by the present invention comprises the steps of utilizing a zoom factor to carry out the zoom processing on an original image file to obtain a zoomed image file; determining an interception range from the zoomed image file, and according to the interception range and the zoom factor, determining the relative position of the interception range in the original image file; according to the size of the original image file, saving the relative position of the original image file in an edited image file. By the above scheme, the pixel points carrying the image information can be prevented from losing to a certain extent and can be retained as soon as possible, and the image quality after edit may be constant.

Description

A kind of GIF image edit method and device
Technical field
The present invention relates to data processing field, particularly a kind of GIF image edit method and device.
Background technology
Graphic interchange format (English: GraphicsInterchangeFormat, be called for short: GIF) be a kind of image file format.Usually, it is (English: FileHeader), GIF data stream is (English: GIFDataStream) and file terminator (English: Trailer) that gif file can comprise file header, wherein, can to comprise gif file signature (English: Signature) and version number's (English: Version) for file header; It is (English: ControlBlock) and data block (English: DataBlocks) that GIF data stream can comprise controll block, controll block is used for the broadcasting behavior of control data block, data block can store multiple image file, if read by width by described multiple image file and play, then animation effect can be formed; File terminator is for representing the end of file.
At present, video GIF recording process can be presented as: the video views intercepting current broadcasting, directly converts video views to multiple image file, and according to above introduce the gif file that generation one comprises file header, GIF data stream and file terminator.
When carrying out gif file and recording, according to practical application request, editing and processing can be carried out to image file.For example, editing and processing is specially amplifies image file, and detailed process can be summarized as follows: the first pixel of direct enlarged image on the basis of original image; Secondly according to the size of original image file, preserve the image after amplifying, obtain the image file after amplifying process.It should be noted that, when image file size is constant, editing and processing like this may cause the pixel of part carry information in image to lose, and causes the poor quality images of the gif file after editor, affects result of broadcast.
Summary of the invention
The embodiment of the present invention provides a kind of GIF image edit method and device, in order to solve the technical matters of the poor quality images that GIF picture editting causes in prior art.
A kind of GIF image edit method, described method comprises:
Utilize zoom factor, convergent-divergent process is carried out to original image file, image file after acquisition convergent-divergent;
After described convergent-divergent, determine intercepting scope image file, and according to described intercepting scope and described zoom factor, determine the relative position of described intercepting scope in described original image file;
According to the size of described original image file, the relative position in described original image file is saved as the rear image file of editor.
Preferably, determine that the mode of described zoom factor is:
In response to convergent-divergent instruction, determine the zoom factor described original image file being carried out to convergent-divergent process.
Preferably, determine that the mode of described intercepting scope is:
In response to intercepting instruction, determine the position of described intercepting scope image file after described convergent-divergent.
Preferably, determine that the mode of described intercepting scope is:
According to video ratio, determine the described position of intercepting scope after described convergent-divergent in image file.
Preferably, according to described intercepting scope and described zoom factor, determine the relative position of described intercepting scope in described original image file, comprising:
Obtain the position coordinates of four end points of described intercepting scope;
Utilize the position coordinates of described four end points respectively divided by described zoom factor, obtain the relative coordinate of described four end points in described original image file;
Described relative position is determined according to described relative coordinate.
A kind of GIF image editing apparatus, described device comprises:
Convergent-divergent processing unit, for utilizing zoom factor, carries out convergent-divergent process to original image file, image file after acquisition convergent-divergent;
Intercepting scope determining unit, for determining intercepting scope in image file after described convergent-divergent;
Relative position determining unit, for according to described intercepting scope and described zoom factor, determines the relative position of described intercepting scope in described original image file;
Storage unit, for the size according to described original image file, saves as the rear image file of editor by the relative position in described original image file.
Preferably, described convergent-divergent processing unit, specifically in response to convergent-divergent instruction, determines the zoom factor described original image file being carried out to convergent-divergent process.
Preferably, described intercepting scope determining unit, specifically in response to intercepting instruction, determines the position of described intercepting scope image file after described convergent-divergent.
Preferably, described intercepting scope determining unit, specifically for according to video ratio, determines the described position of intercepting scope after described convergent-divergent in image file.
Preferably, described relative position determining unit comprises:
Position coordinates obtains unit, for obtaining the position coordinates of four end points of described intercepting scope;
Relative coordinate obtains unit, for utilizing the position coordinates of described four end points respectively divided by described zoom factor, obtains the relative coordinate of described four end points in described original image file;
Relative position determination subelement, for determining described relative position according to described relative coordinate.
Compared with prior art, the GIF image edit method that the embodiment of the present invention provides and device, zoom factor is utilized to carry out convergent-divergent process to original image file, image file after acquisition convergent-divergent, and intercepting scope is determined from image file after convergent-divergent, just can utilize zoom factor and intercepting scope, calculate the relative position of intercepting scope in original image file, and then the image file after the view generation editor utilizing this relative position.Hinge structure utilizes the image file after the view generation editor of intercepting scope, the present invention program, the pixel carrying image information just can be avoided to a certain extent to lose, and retain this part pixel, after just can making editor, picture quality remains unchanged and becomes possibility as far as possible.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of embodiment of the present invention GIF image edit method;
Fig. 2 is the structured flowchart of embodiment of the present invention GIF image editing apparatus.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
With reference to figure 1, show the process flow diagram of a kind of GIF image edit method of the embodiment of the present invention, can comprise the following steps:
S101, utilizes zoom factor, carries out convergent-divergent process to original image file, image file after acquisition convergent-divergent.
It should be noted that, the editing and processing major embodiment that the embodiment of the present invention relates to is the convergent-divergent processing procedure of image.First, convergent-divergent process to original image file can be completed according to zoom factor, obtain image file after convergent-divergent.Be treated to example to amplify, this step can be presented as, according to zoom factor, amplifies the pixel in original image file.
As a kind of example, specifically by with under type determination zoom factor:
Mode one, can receive the convergent-divergent instruction of outside input, extract zoom factor, and then complete convergent-divergent process according to zoom factor from convergent-divergent instruction.
Mode two, also can first according to image file after user operation acquisition convergent-divergent, and after recycling original image file and convergent-divergent, image file calculates zoom factor.For example, user by this operational motion of roll mouse, completes the convergent-divergent process to original image file, obtains image file after convergent-divergent, then compares image file size after original image file and convergent-divergent, obtains zoom factor.
S102, determines intercepting scope image file after described convergent-divergent.
By image file after convergent-divergent process acquisition convergent-divergent, just can therefrom determine intercepting scope, namely, after convergent-divergent, image file centre circle makes the position that user wishes the view place retained, or, it is also understood that into, determine finally needs to present which partial view after editing and processing.
As a kind of example, specifically by determining intercepting scope with under type:
Mode one, can receive the intercepting instruction of outside input, according to the instruction intercepting instruction, after convergent-divergent, determine intercepting scope image file.For example, the position coordinates that can comprise four end points of intercepting scope in instruction is intercepted.
Mode two, according to video ratio, can determine intercepting scope image file after convergent-divergent.Wherein, video ratio can be understood as the video pictures length of video player broadcasting and wide ratio, and e.g., video ratio can be 4:3,16:9 etc.Intercept scope according to video ratio-dependent, can effectively avoid in image file, occurring black surround phenomenon, make image file only include to carry the pixel of image information as far as possible.
Mode three, in conjunction with intercepting instruction and video ratio, comprehensively can determine intercepting scope, specifically can refer to above-mentioned two kinds of modes and realize, repeat no more herein.
S103, according to described intercepting scope and described zoom factor, determines the relative position of described intercepting scope in described original image file.
S104, according to the size of described original image file, saves as the rear image file of editor by the relative position in described original image file.
After obtaining zoom factor and intercepting scope, clearly can go out need the view that presents at the relative position of original image file according to the two, when carrying out preservation operation, directly to utilize the view of this relative position in original image file, image file after Generation Edit.Hinge structure carries out preservation operation for image after convergent-divergent, scheme like this, and the pixel carrying image information just can be avoided to a certain extent to lose, and retain this part pixel, after just can making editor, picture quality remains unchanged and becomes possibility as far as possible.
As a kind of example, specifically by determining described relative position with under type, can comprise: first, in conjunction with the coordinate system used of image file after convergent-divergent, obtaining the position coordinates of four end points of described intercepting scope; Secondly, utilize the position coordinates of described four end points respectively divided by described zoom factor, obtain the relative coordinate of described four end points in described original image file; Finally, according to four relative coordinates obtained, in source image file, described relative position is determined.
It should be noted that, only be treated to example to amplify above, the editing process of the embodiment of the present invention is done and explains explanation, consider in convergent-divergent processing procedure, the number of carrying the pixel of image information after convergent-divergent in image file does not change, no matter and be to pixel carry out amplification process or reduce process, its relative original image file, all can produce the problem of poor quality images, therefore, embodiment of the present invention scheme is also applicable to image down processing procedure, specific implementation process can refer to above introduce, repeat no more herein.
In addition, it should be noted that, if in GIF recording process, from broadcasting video, intercept conversion obtain at least two GIF image files, then before carrying out picture editting, also can response external input instruction, from least two GIF image files, choose a GIF image file as the original image file in the embodiment of the present invention.
With method mentioned above accordingly, see Fig. 2, the embodiment of the present invention additionally provides a kind of GIF image editing apparatus, specifically can comprise:
Convergent-divergent processing unit 201, for utilizing zoom factor, carries out convergent-divergent process to original image file, image file after acquisition convergent-divergent;
Intercepting scope determining unit 202, for determining intercepting scope in image file after described convergent-divergent;
Relative position determining unit 203, for according to described intercepting scope and described zoom factor, determines the relative position of described intercepting scope in described original image file;
Storage unit 204, for the size according to described original image file, saves as the rear image file of editor by the relative position in described original image file.
Alternatively, described convergent-divergent processing unit, specifically in response to convergent-divergent instruction, determines the zoom factor described original image file being carried out to convergent-divergent process.
Alternatively, described intercepting scope determining unit, specifically in response to intercepting instruction, determines the position of described intercepting scope image file after described convergent-divergent.
Alternatively, described intercepting scope determining unit, specifically for according to video ratio, determines the described position of intercepting scope after described convergent-divergent in image file.
Alternatively, described relative position determining unit comprises:
Position coordinates obtains unit, for obtaining the position coordinates of four end points of described intercepting scope;
Relative coordinate obtains unit, for utilizing the position coordinates of described four end points respectively divided by described zoom factor, obtains the relative coordinate of described four end points in described original image file;
Relative position determination subelement, for determining described relative position according to described relative coordinate.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For device class embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Finally, also it should be noted that, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
Above a kind of GIF image edit method provided by the present invention is described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. a GIF image edit method, is characterized in that, described method comprises:
Utilize zoom factor, convergent-divergent process is carried out to original image file, image file after acquisition convergent-divergent;
After described convergent-divergent, determine intercepting scope image file, and according to described intercepting scope and described zoom factor, determine the relative position of described intercepting scope in described original image file;
According to the size of described original image file, the relative position in described original image file is saved as the rear image file of editor.
2. method according to claim 1, is characterized in that, determines that the mode of described zoom factor is:
In response to convergent-divergent instruction, determine the zoom factor described original image file being carried out to convergent-divergent process.
3. method according to claim 1, is characterized in that, determines that the mode of described intercepting scope is:
In response to intercepting instruction, determine the position of described intercepting scope image file after described convergent-divergent.
4. method according to claim 1, is characterized in that, determines that the mode of described intercepting scope is:
According to video ratio, determine the described position of intercepting scope after described convergent-divergent in image file.
5. method according to claim 1, is characterized in that, according to described intercepting scope and described zoom factor, determines the relative position of described intercepting scope in described original image file, comprising:
Obtain the position coordinates of four end points of described intercepting scope;
Utilize the position coordinates of described four end points respectively divided by described zoom factor, obtain the relative coordinate of described four end points in described original image file;
Described relative position is determined according to described relative coordinate.
6. a GIF image editing apparatus, is characterized in that, described device comprises:
Convergent-divergent processing unit, for utilizing zoom factor, carries out convergent-divergent process to original image file, image file after acquisition convergent-divergent;
Intercepting scope determining unit, for determining intercepting scope in image file after described convergent-divergent;
Relative position determining unit, for according to described intercepting scope and described zoom factor, determines the relative position of described intercepting scope in described original image file;
Storage unit, for the size according to described original image file, saves as the rear image file of editor by the relative position in described original image file.
7. device according to claim 6, is characterized in that, described convergent-divergent processing unit, specifically in response to convergent-divergent instruction, determines the zoom factor described original image file being carried out to convergent-divergent process.
8. device according to claim 6, is characterized in that, described intercepting scope determining unit, specifically in response to intercepting instruction, determines the position of described intercepting scope image file after described convergent-divergent.
9. device according to claim 6, is characterized in that, described intercepting scope determining unit, specifically for according to video ratio, determines the described position of intercepting scope after described convergent-divergent in image file.
10. device according to claim 6, is characterized in that, described relative position determining unit comprises:
Position coordinates obtains unit, for obtaining the position coordinates of four end points of described intercepting scope;
Relative coordinate obtains unit, for utilizing the position coordinates of described four end points respectively divided by described zoom factor, obtains the relative coordinate of described four end points in described original image file;
Relative position determination subelement, for determining described relative position according to described 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 true CN105139341A (en) 2015-12-09
CN105139341B 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)

Cited By (3)

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

Citations (4)

* 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
US20130243317A1 (en) * 2008-08-02 2013-09-19 Vantrix Corporation Method and system for predictive scaling of color mapped images
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

Patent Citations (4)

* 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
US20130243317A1 (en) * 2008-08-02 2013-09-19 Vantrix Corporation Method and system for predictive scaling of color mapped images
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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018095253A1 (en) * 2016-11-28 2018-05-31 优酷网络技术(北京)有限公司 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
WO2020047691A1 (en) * 2018-09-03 2020-03-12 深圳市大疆创新科技有限公司 Method, device, and mobile platform for generating dynamic image and storage medium

Also Published As

Publication number Publication date
CN105139341B (en) 2018-05-29

Similar Documents

Publication Publication Date Title
US10861133B1 (en) Super-resolution video reconstruction method, device, apparatus and computer-readable storage medium
CN103428427B (en) Image size readjusts method and image size readjusts device
CN109064399B (en) Image super-resolution reconstruction method and system, computer device and storage medium thereof
JP2018198421A (en) Method and apparatus for encoding and decoding two-dimension point clouds
CN110708589B (en) Information sharing method and device, storage medium and electronic device
US10235795B2 (en) Methods of compressing a texture image and image data processing system and methods of generating a 360 degree panoramic video thereof
JP6735908B2 (en) Panorama video compression method and apparatus
WO2019020061A1 (en) Video dialogue processing method, video client, video server, and computer readable storage medium
CN111738917B (en) Picture telescoping method, device, equipment and storage medium
CN105139341A (en) GIF image editing method and device
US20140325409A1 (en) Active & Efficient Monitoring of a Graphical User Interface
CN112887794A (en) Video editing method and device
CN105184838A (en) Picture processing method and terminal
US20170019615A1 (en) Image processing method, non-transitory computer-readable storage medium and electrical device thereof
WO2021227919A1 (en) Method and device for image data encoding, display method and device, and electronic device
WO2022001648A1 (en) Image processing method and apparatus, and device and medium
CN104469178A (en) Image display method and electronic device
CN105138695A (en) Method and device for graphics interchange format (GIF) recording
US20160111129A1 (en) Image edits propagation to underlying video sequence via dense motion fields
CN111757177B (en) Video clipping method and device
WO2022160914A1 (en) Effect processing method and apparatus, and device and storage medium
CN107197372B (en) Method and device for shearing batch vertical screen videos and electronic equipment
TWI586144B (en) Multiple stream processing for video analytics and encoding
CN110582021A (en) Information processing method and device, electronic equipment and storage medium
CN117319736A (en) Video processing method, device, electronic equipment and storage medium

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.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240701

Address after: 101400 Room 201, 9 Fengxiang East Street, Yangsong Town, Huairou District, Beijing

Patentee after: Youku Culture Technology (Beijing) Co.,Ltd.

Country or region after: China

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

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

Country or region before: China