Image editing rollback method and device, electronic equipment and medium
By acquiring and generating images after image editing operations, the problem of lack of image editing rollback in the prior art is solved, the rollback of edited images is realized, and user experience and image encoding management are improved.
Patent Information
- Application Number
- CN202310152505.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology lacks a method for editing and rolling back the edited image, which limits the user's operation options and affects the user's experience.
By obtaining the editing area and the original image after the image editing operation, generating the first image and the second image, and generating the target image based on these images during the rollback operation, the rollback of the edited image is implemented.
It provides users with more operation options, improves the user experience, facilitates the storage and management of image encoding data, and realizes the editing rollback of edited images.
Smart Images

Figure CN118537418A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and specifically provides an image editing rollback method, device, electronic equipment and medium. Background Art
[0002] With the development of smart terminal technology, the functions of smart terminals are becoming more and more diversified. For example, users can use smart terminals to take pictures and edit the pictures. However, the prior art lacks a method for rolling back the edited pictures, which limits the user's operation options and affects the user's experience.
[0003] Accordingly, the art needs a new image editing rollback method to solve the above problems. Summary of the invention
[0004] The present invention aims to solve the above technical problem, that is, to solve the problem that the prior art lacks a method for rolling back the edited image, thereby limiting the user's operation options and affecting the user's usage experience.
[0005] In order to achieve the above object, in a first aspect, the present invention provides an image editing rollback method, the method comprising the following steps:
[0006] In response to an image editing operation, an editing area corresponding to the editing operation is acquired, and a first image and a second image are acquired based on the editing area and an original image, wherein the first image is an image of the original image after the image editing operation is performed, and the second image is an image composed of the editing area of the original image;
[0007] storing the editing area, the first image, and the second image;
[0008] In response to a rollback operation of the editing operation, the stored editing area, the first image, and the second image are acquired, and a target image is generated based on the editing area, the first image, and the second image.
[0009] In an optional technical solution of the above-mentioned image editing rollback method, before acquiring the first image and the second image based on the editing area and the original image, the method further includes:
[0010] Acquire the original image and determine whether the editing area meets a preset condition based on the original image;
[0011] If the preset condition is met, acquiring the first image and the second image based on the editing area and the original image;
[0012] If the preset condition is not met, the editing area is adjusted.
[0013] In the optional technical solution of the above-mentioned image editing rollback method, the step of "determining whether the editing area meets the preset condition" includes:
[0014] It is determined whether the editing area is within the original image.
[0015] In an optional technical solution of the above-mentioned image editing rollback method, the image editing operation is an image overlay operation, and after responding to the image editing operation, the method further includes:
[0016] Obtain image material to be superimposed;
[0017] The step of “obtaining a first image based on the editing area and the original image” includes:
[0018] The first image is acquired based on the editing area, the original image and the image material to be superimposed.
[0019] In an optional technical solution of the above-mentioned image editing rollback method, the step of “storing the first image and the second image” includes:
[0020] Encoding the first image and the second image respectively to obtain first image data and second image data;
[0021] The first image data and the second image data are connected and stored.
[0022] In an optional technical solution of the above-mentioned image editing rollback method, the method further includes:
[0023] Acquire a first data length and a second data length and store the first data length and the second data length, wherein the first data length is the length of the first image data, and the second data length is the length of the second image data;
[0024] The step of “obtaining the stored first image and the second image” comprises:
[0025] Based on the connection of the stored first image data and the stored second image data, the first data length, and the second data length, the stored first image and the stored second image are acquired.
[0026] In an optional technical solution of the above-mentioned image editing rollback method, the step of “generating a target image based on the editing area, the first image and the second image” includes:
[0027] Based on the second image, the editing area in the first image is replaced to generate the target image.
[0028] In a second aspect, the present invention further provides an image editing rollback device, the device comprising:
[0029] An image editing module is configured to, in response to an image editing operation, obtain an editing area corresponding to the editing operation and obtain a first image and a second image based on the editing area and an original image, wherein the first image is an image of the original image after the image editing operation is performed, and the second image is an image composed of the editing area of the original image;
[0030] a storage module, configured to store the editing area, the first image, and the second image;
[0031] The editing rollback module is configured to obtain the stored editing area, the first image and the second image in response to a rollback operation of the editing operation, and generate a target image based on the editing area, the first image and the second image.
[0032] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image editing rollback method as described above when executing the computer program.
[0033] In a fourth aspect, the present invention further provides a readable storage medium, wherein a plurality of program codes are stored in the readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute the image editing rollback method as described in any one of the above.
[0034] It can be understood by those skilled in the art that in the technical solution of the present invention, by responding to an image editing operation, an editing area corresponding to the editing operation is obtained, and a first image and a second image are obtained based on the editing area and the original image, wherein the first image is an image after the image editing operation is performed on the original image, and the second image is an image composed of the editing area of the original image; the editing area, the first image, and the second image are stored; in response to a rollback operation of the editing operation, the stored editing area, the first image, and the second image are obtained, and a target image is generated based on the editing area, the first image, and the second image. Such a setting can realize the editing rollback of the edited image, thereby providing users with more operation options and improving the user experience.
[0035] Furthermore, the step of "storing the first image and the second image" includes: encoding the first image and the second image respectively to obtain the first image data and the second image data; and storing the first image data and the second image data in a connected manner. Such a setting is conducive to the storage management of the image encoding data, the extraction and decoding of the image encoding data, and further facilitates the editing rollback of the edited image. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:
[0037] Figure 1 is a flowchart of main steps of an image editing rollback method according to an embodiment of the present invention;
[0038] Figure 2 is a flowchart of main steps before acquiring a first image and a second image based on an editing area and an original image according to an embodiment of the present invention;
[0039] Figure 3 is a schematic diagram of an original image and an editing area that meets preset conditions according to an embodiment of the present invention;
[0040] Figure 4 is a schematic diagram of a second image according to an embodiment of the present invention;
[0041] Figure 5 is a schematic diagram of a coordinate system in an original image according to an embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of image materials to be superimposed according to an embodiment of the present invention;
[0043] Figure 7 is a schematic diagram of a first image generated according to an embodiment of the present invention;
[0044] Figure 8 is a schematic flow chart of main steps of storing a first image and a second image according to an embodiment of the present invention;
[0045] Fig. 9 is a schematic diagram of data in which the second image data is stored behind the first image data in the form of a buffer copy according to the present invention;
[0046] Fig.10 is a schematic diagram of a main structural block diagram of an image editing rollback device according to an embodiment of the present invention;
[0047] Fig.11 It is a schematic diagram of the main structural block diagram of an electronic device for executing the image editing rollback method of the present invention;
[0048] Reference numerals list :
[0049] 11: Image editing module; 12: Storage module; 13: Editing rollback module. DETAILED DESCRIPTION
[0050] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0001] In the description of the present invention, ordinal numbers such as "first" and "second" are only used to describe different technical features of the same type, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions or technical means between the various embodiments of the present application can be combined with each other as long as they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0051] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable media that can store program codes, such as disks, hard disks, optical disks, flash memories, read-only memories, random access memories, and the like. The singular terms "one" and "the" may also include plural forms.
[0052] As described in the background technology section, in order to solve the problem that the prior art lacks a method for rolling back an edited image, thereby limiting the user's operation options and affecting the user's experience, the present invention provides an image editing rollback method.
[0053] See attached Figure 1 , Figure 11 is a flow chart of the main steps of an image editing rollback method according to an embodiment of the present invention. The image editing rollback method can be executed by a smart terminal, a server, or a server and a smart terminal. Figure 1 As shown, the image editing rollback method of the present invention comprises the following steps:
[0054] Step S101: In response to an image editing operation, an editing area corresponding to the editing operation is obtained and a first image and a second image are obtained based on the editing area and the original image, wherein the first image is an image after the image editing operation is performed on the original image, and the second image is an image composed of the editing area of the original image.
[0055] Specifically, the image editing operation is the regional editing of the image, that is, only a part of the original image is edited. Exemplarily, the image editing operation can be at least one of an image overlay operation, an image erasing operation, an image graffiti operation, an image mosaic operation, and an image color adjustment operation, wherein the image overlay operation can be further divided into a watermark overlay operation and a label overlay operation. The above-mentioned image editing operation settings are only for illustrative purposes, and can be selected according to actual needs in actual applications.
[0056] Step S102: storing the editing area, the first image and the second image.
[0057] Step S103: in response to the rollback operation of the editing operation, acquiring the stored editing area, the first image and the second image, and generating a target image based on the editing area, the first image and the second image.
[0058] Based on the above steps S101 to S103, the present invention obtains the editing area corresponding to the editing operation in response to the image editing operation and obtains the first image and the second image based on the editing area and the original image, wherein the first image is the image after the image editing operation is performed on the original image, and the second image is the image composed of the editing area of the original image; stores the editing area, the first image and the second image; in response to the rollback operation of the editing operation, obtains the stored editing area, the first image and the second image, and generates the target image based on the editing area, the first image and the second image. Such a setting can realize the editing rollback of the edited image, thereby providing users with more operation options and improving the user experience.
[0059] See attached Figure 2 , Figure 2 FIG. 1 is a flow chart of the main steps before obtaining the first image and the second image based on the editing area and the original image according to an embodiment of the present invention. Figure 2As shown, before acquiring the first image and the second image based on the editing area and the original image, the method further includes the following steps:
[0060] Step S201: Acquire an original image and determine whether the editing area meets a preset condition based on the original image.
[0061] Step S202: if the preset condition is met, acquiring a first image and a second image based on the editing area and the original image;
[0062] Step S203: If the preset condition is not met, the editing area is adjusted.
[0063] Specifically, the image editing rollback method of this embodiment is applied to a smart terminal. When acquiring the original image, the smart terminal can acquire it by shooting with a camera installed on itself, or by receiving the original image sent by other smart terminals or servers. The original image can be an image that has not undergone any image editing, or an image that has undergone a certain image editing. Both types of images can be used as the original image in the present invention to accept the image editing operation in the present invention. When the editing area meets the preset conditions, the editing area in the original image is copied to generate a second image.
[0064] For example, the intelligent terminal may be a smart phone, a wearable device, a tablet computer, etc. The original image and the editing area that meets the preset conditions may be as follows: Figure 3 As shown, the edited area in the original image is copied to generate Figure 4 The above-mentioned intelligent terminal type setting, original image setting, editing area setting and second image setting are only for exemplary description, and can be selected according to actual needs in actual application.
[0065] In some embodiments, determining whether the editing area satisfies a preset condition includes: determining whether the editing area is within the original image.
[0066] Specifically, the user can customize the editing area through image editing operations. For example, the editing area can be represented by roi. roi (region of interest, roi) is a rectangular region of interest, and its format is (x, y, w, h). Figure 5 In the coordinate system shown, x is the x-coordinate value of the upper left corner of the region of interest, y is the y-coordinate value of the upper left corner of the region of interest, w is the width value of the region of interest, and h is the height value of the region of interest.
[0067] The width and height of the original image can be set to lw and lh, respectively. Determining whether the editing area is within the original image includes determining whether the X-axis coordinate values of the region of interest are all within the original image and determining whether the Y-axis coordinate values of the region of interest are all within the original image, wherein the determination of whether the X-axis coordinate values and the Y-axis coordinate values of the region of interest are within the original image can be performed simultaneously, or a certain determination order can be set, for example, first determining whether the X-axis coordinate values of the region of interest are all within the original image, and when it is determined that the X-axis coordinate values of the region of interest are all within the original image or the adjustment of the X-axis coordinate values of the region of interest that are not within the original image is completed, then determining whether the Y-axis coordinate values of the region of interest are all within the original image. Determining whether the X-axis coordinate values of the region of interest are all within the original image includes: determining whether x is within an interval greater than or equal to 0 and less than or equal to (lw-w), if x is within the interval, it means that the X-axis coordinate values of the region of interest are all within the original image. If x is not within the interval, for example, x is less than 0, the value of x is set to 0; or, if x is greater than (lw-w), the value of x is set to (lw-w).
[0068] Determining whether the Y-axis coordinate values of the region of interest are all within the original image includes: determining whether y is within an interval greater than or equal to 0 and less than or equal to (lh-h). If y is within the interval, it means that the Y-axis coordinate values of the region of interest are all within the original image. If y is not within the interval, for example, y is less than 0, the value of y is set to 0; or, if y is greater than (lh-h), the value of y is set to (lh-h). The above-mentioned setting method of the editing area and the method of determining whether the editing area is within the original image are only for exemplary description, and can be selected according to actual needs in actual applications.
[0069] In some embodiments, the image editing operation is an image overlay operation. After responding to the image editing operation, the method further includes: obtaining image material to be overlaid; based on the editing area and the original image, obtaining the first image includes: obtaining the first image based on the editing area, the original image and the image material to be overlaid.
[0070] Specifically, the image material to be superimposed is an image with a transparent channel. In computer graphics, a true color image of an RGB color model is composed of three color information channels: red, green, and blue. Each channel uses an 8-bit color depth and contains all color information. In order to achieve the transparent effect of the graphic, another 8-bit channel information is added during the processing and storage of the graphic file. This additional 8-bit channel information representing the transparency of each pixel in the graphic is the transparent channel. The transparent channel is also called the Alpha channel. The white Alpha is used to define opaque color pixels, while the black Alpha is used to define transparent pixels. The grayscale between black and white is used to define the semi-transparent part of the color image. The first image is obtained based on the editing area, the original image, and the image material to be superimposed, that is, the image material to be superimposed is superimposed on the editing area in the original image, and the superimposed image generated is the first image.
[0071] In some embodiments, the editing area can be represented by a roi, whose format is (x, y, w, h); based on the editing area, the original image and the image material to be superimposed, obtaining the first image can be described by the following code:
[0072] for(int i=y;i≤y+h;++i)
[0073] for(intj=x;j≤x+w;++j){
[0074] Int alpha = Mwm[i,j].a; / / Transparency channel of the image material to be superimposed
[0075] Mout[i,j].rgb=Msrc[i,j].rgb*alpha+Mwm[i,j].rgb*(255.-alpha);
[0076] }
[0077] Wherein, Mout is the generated first image, Msrc is the original image, and Mwm is the image material to be superimposed. For example, the original image and the editing area that meets the preset conditions can be as follows: Figure 3 As shown, the image material to be superimposed can be Figure 6 As shown, the first image generated is Figure 7 The above-mentioned settings of the original image, the editing area, the image material to be superimposed, and the first image are only for illustrative purposes, and can be selected according to actual needs in actual applications.
[0078] See attached Figure 8 , Figure 81 is a schematic diagram of the main steps of storing a first image and a second image according to an embodiment of the present invention. Storing the first image and the second image includes the following steps:
[0079] Step S301: Encode the first image and the second image respectively to obtain first image data and second image data.
[0080] Step S302: connect and store the first image data and the second image data.
[0081] Specifically, image coding, also known as image compression, refers to the technology of representing an image or the information contained in the image with fewer bits under the condition of meeting a certain quality (signal-to-noise ratio requirements or subjective evaluation scores). Fig. 9 As shown, the second image data is stored behind the first image data in the form of a buffer copy to generate the third image data; the third image data is stored to realize the connection and storage of the first image data and the second image data. Such a setting is conducive to the storage management of the image coding data, the extraction and decoding of the image coding data, and further facilitates the editing rollback of the edited image.
[0082] It should be noted that, although it is described here that the second image data is stored in the form of a buffer copy behind the first image data, this is not restrictive, and those skilled in the art can also store the second image data in the form of a buffer copy in front of the first image data to generate the fourth image data; storing the fourth image data realizes the connection storage of the first image data and the second image data. The adjustment of the connection order between the first image data and the second image data does not deviate from the basic principle of the present invention, and therefore falls within the protection scope of the present invention.
[0083] In some embodiments, the method also includes: obtaining a first data length and a second data length and storing the first data length and the second data length, wherein the first data length is the length of the first image data and the second data length is the length of the second image data; obtaining the stored first image and the second image includes: obtaining the stored first image and the second image based on connecting the stored first image data and the second image data, the first data length, and the second data length.
[0084] Specifically, the first image is encoded to obtain the first image data and the first data length; the second image is encoded to obtain the second image data and the second data length. The image editing rollback method of this embodiment is applied to an intelligent terminal, which is provided with a media database, so the connected first image data and the second image data, the editing area, the first data length and the second data length are all stored in the media database.
[0085] The first data length may be Lout_buffer, and the second data length may be Lroi_buffer. When the second image data is stored in the form of a buffer copy behind the first image data to generate the third image data, based on the connection between the stored first image data and the second image data, the first data length, and the second data length, obtaining the stored first image and the second image includes: taking out the [0, Lout_buffer-1] interval data in the third image data from the media database, and decoding it to obtain the first image; taking out the [Lout_buffer, Lout_buffer+Lroi_buffer] interval data in the third image data from the media database, and decoding it to obtain the second image.
[0086] Or, when the second image data is stored in the form of a buffer copy in front of the first image data to generate the fourth image data, based on the connection between the stored first image data and the second image data, the first data length, and the second data length, obtaining the stored first image and the second image includes: taking out the [0, Lroi_buffer-1] interval segment data in the fourth image data from the media database, and decoding it to obtain the second image; taking out the [Lroi_buffer, Lroi_buffer+Lout_buffer] interval segment data in the fourth image data from the media database, and decoding it to obtain the first image.
[0087] In some embodiments, generating a target image based on the editing area, the first image, and the second image includes: replacing the editing area in the first image based on the second image to generate the target image. Specifically, replacing pixels in the editing area in the first image according to the second image to generate the target image; and updating relevant information to display the generated target image.
[0088] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0089] Furthermore, the present invention also provides an image editing rollback device.
[0090] See attached Fig.10 , Fig.10 FIG. 1 is a schematic diagram of the main structural block diagram of an image editing rollback device according to an embodiment of the present invention. Fig.10As shown, the image editing rollback device in the embodiment of the present invention mainly includes an image editing module 11, a storage module 12 and an editing rollback module 13. In some embodiments, one or more of the image editing module 11, the storage module 12 and the editing rollback module 13 can be combined into one module. In some embodiments, the image editing module 11 can be configured to respond to the image editing operation, obtain the editing area corresponding to the editing operation, and based on the editing area and the original image, obtain the first image and the second image, wherein the first image is the image after the image editing operation is performed on the original image, and the second image is the image composed of the editing area of the original image. The storage module 12 can be configured to store the editing area, the first image and the second image. The editing rollback module 13 can be configured to respond to the rollback operation of the editing operation, obtain the stored editing area, the first image and the second image, and generate the target image based on the editing area, the first image and the second image.
[0091] In some embodiments, the image editing module 11 obtains the original image and determines whether the editing area meets the preset conditions based on the original image; if the preset conditions are met, the first image and the second image are obtained based on the editing area and the original image; if the preset conditions are not met, the editing area is adjusted.
[0092] In some embodiments, the image editing module 11 determines whether the editing area is within the original image.
[0093] In some embodiments, the image editing module 11 obtains the image material to be superimposed; the image editing module 11 obtains the first image based on the editing area, the original image and the image material to be superimposed.
[0094] In some embodiments, the storage module 12 encodes the first image and the second image respectively to obtain first image data and second image data; and stores the first image data and the second image data in a connected manner.
[0095] In some embodiments, the storage module 12 obtains a first data length and a second data length and stores the first data length and the second data length, wherein the first data length is the length of the first image data and the second data length is the length of the second image data; the editing rollback module 13 obtains the stored first image and the second image based on the connection between the stored first image data and the second image data, the first data length, and the second data length.
[0096] In some embodiments, the edit rollback module 13 replaces the edited area in the first image based on the second image to generate a target image.
[0097] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0098] Furthermore, the present invention also provides an electronic device.
[0099] See attached Fig.11 , Fig.11 1 is a schematic diagram of the main structure of an electronic device for executing the image editing rollback method of the present invention. Fig.11 As shown, the present invention further provides an electronic device for executing the image editing rollback method of the present invention, the electronic device comprising: a processor 21, a memory 22, and a computer program 23 stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program 23, the steps in the above-mentioned various method embodiments are implemented. Alternatively, when the processor 21 executes the computer program 23, the functions of the modules / units in the above-mentioned embodiments are implemented.
[0100] Exemplarily, the processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0101] Exemplarily, the memory 22 may be an internal storage unit of the electronic device, for example, a hard disk or memory of the electronic device; the memory 22 may also be an external storage device of the electronic device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 22 may also include both an internal storage unit of the electronic device and an external storage device. The memory 22 is used to store computer programs and other programs and data required by the electronic device. The memory 22 may also be used to temporarily store data that has been output or is to be output.
[0002] In some possible implementations, the electronic device may include multiple processors 21 and memories 22. The program for executing the image editing rollback method of the above method embodiment may be divided into multiple subprograms, and each subprogram may be loaded and run by the processor 21 to execute different steps of the image editing rollback method of the above method embodiment. Specifically, each subprogram may be stored in different memories 22, respectively, and each processor 21 may be configured to execute the programs in one or more memories 22 to jointly implement the image editing rollback method of the above method embodiment, that is, each processor 21 executes different steps of the image editing rollback method of the above method embodiment, to jointly implement the image editing rollback method of the above method embodiment.
[0102] The above-mentioned multiple processors 21 may be processors deployed on the same device. For example, the above-mentioned electronic device may be a high-performance device composed of multiple processors, and the above-mentioned multiple processors 21 may be processors configured on the high-performance device. In addition, the above-mentioned multiple processors 21 may also be processors deployed on different devices. For example, the above-mentioned electronic device may be a server cluster, and the above-mentioned multiple processors 21 may be processors on different servers in the server cluster.
[0003] The electronic device may be a desktop computer, a notebook, a PDA, a cloud server, etc. The electronic device may include but is not limited to a processor 21 and a memory 22. Those skilled in the art will appreciate that Fig.11 These are merely examples of electronic devices and do not constitute a limitation of the electronic device. The electronic device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0103] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the image editing rollback method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned image editing rollback method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0104] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0105] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0106] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. An image editing rollback method, characterized in that: The method comprises the following steps: In response to an image editing operation, an editing area corresponding to the editing operation is acquired, and a first image and a second image are acquired based on the editing area and an original image, wherein the first image is an image of the original image after the image editing operation is performed, and the second image is an image composed of the editing area of the original image; storing the editing area, the first image, and the second image; In response to a rollback operation of the editing operation, the stored editing area, the first image, and the second image are acquired, and a target image is generated based on the editing area, the first image, and the second image.
2. The image editing rollback method according to claim 1, characterized in that: Before acquiring the first image and the second image based on the editing area and the original image, the method further includes: Acquire the original image and determine whether the editing area meets a preset condition based on the original image; If the preset condition is met, acquiring the first image and the second image based on the editing area and the original image; If the preset condition is not met, the editing area is adjusted.
3. The image editing rollback method according to claim 2, characterized in that: The step of "determining whether the editing area meets the preset conditions" includes: It is determined whether the editing area is within the original image.
4. The image editing rollback method according to claim 1, characterized in that: The image editing operation is an image overlay operation. After responding to the image editing operation, the method further includes: Obtain image material to be superimposed; The step of “obtaining a first image based on the editing area and the original image” includes: The first image is acquired based on the editing area, the original image and the image material to be superimposed.
5. The image editing rollback method according to claim 1, characterized in that: The step of “storing the first image and the second image” comprises: Encoding the first image and the second image respectively to obtain first image data and second image data; The first image data and the second image data are connected and stored.
6. The image editing rollback method according to claim 5, characterized in that: The method further comprises: Acquire a first data length and a second data length and store the first data length and the second data length, wherein the first data length is the length of the first image data, and the second data length is the length of the second image data; The step of "obtaining the first image and the second image stored" comprises: Based on the connection of the stored first image data and the stored second image data, the first data length, and the second data length, the stored first image and the stored second image are acquired.
7. The image editing rollback method according to claim 1, characterized in that: The step of “generating a target image based on the editing area, the first image and the second image” includes: Based on the second image, the editing area in the first image is replaced to generate the target image.
8. An image editing rollback device, characterized in that: The device comprises: An image editing module is configured to, in response to an image editing operation, obtain an editing area corresponding to the editing operation and obtain a first image and a second image based on the editing area and an original image, wherein the first image is an image of the original image after the image editing operation is performed, and the second image is an image composed of the editing area of the original image; a storage module, configured to store the editing area, the first image, and the second image; The editing rollback module is configured to obtain the stored editing area, the first image and the second image in response to a rollback operation of the editing operation, and generate a target image based on the editing area, the first image and the second image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the image editing rollback method according to any one of claims 1 to 7 is implemented.
10. A readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the image editing rollback method according to any one of claims 1 to 7.
Citation Information
Cited By
Image processing method and apparatus, device, and medium
WO2026166460A1
