Zooming method and electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2025-08-07
- Publication Date
- 2026-06-05
Smart Images

Figure CN122162159A_ABST
Abstract
Description
Image expansion method and electronic device
[0001] The present application claims priority to the Chinese patent application No. 202411403147.5, filed on September 30, 2024, and entitled "Image expansion method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of image processing, in particular to an image expansion method and an electronic device. BACKGROUND
[0003] Artificial intelligence (AI) image expansion is an operation of expanding and optimizing an image by using an artificial intelligence algorithm. Through AI image expansion, the subject, background, color, light, and other factors in the photo can be deeply analyzed to intelligently generate new content consistent with the style of the original image, thereby seamlessly expanding the background of the image and enhancing the visual effect of the image.
[0004] Currently, in the process of expanding an image with a watermark, there are problems such as expansion of only the watermark area and abnormal display of the watermark. Therefore, how to improve the image expansion effect of an image with a watermark is a technical problem to be solved. SUMMARY
[0005] The present application provides an image expansion method and an electronic device, which can improve the image expansion effect of an image with a watermark.
[0006] In a first aspect, an image expansion method is provided. The method is applied to an electronic device and includes: in response to an instruction to expand a first image, obtaining position information and element information of a first watermark in the first image; removing the first watermark at a first position in the first image according to the element information of the first watermark to obtain a second image, the first position being a position indicated by the position information of the first watermark; expanding the second image to obtain a third image; and supplementing a second watermark at a second position in the third image according to the element information of the first watermark to obtain a fourth image.
[0007] In the technical solution of the present application, the watermark in the image is removed before the image is expanded, and the image after the watermark is removed is expanded on this basis, thereby avoiding problems such as expansion of only the watermark area, blurring of the watermark, and abnormal position of the watermark during the expansion of the image. After the expansion, the watermark is added to the expanded image to obtain the final image. Through the above solution, various abnormal problems that may occur when an image with a watermark is expanded can be fundamentally solved, and the image expansion effect of the image with a watermark is improved.
[0008] It should be noted that the present application is only applicable to the image expansion processing of the image carrying the watermark, and if the image expansion indication for an image is received and it is determined that the image does not carry the watermark, the subsequent steps of obtaining the position information and element information corresponding to the image and the subsequent steps are not performed.
[0009] Optionally, in a possible implementation manner of the first aspect, the method further includes: in response to a shooting operation of a user, collecting an original image and saving watermark information of the original image, the watermark information of the original image including position information and element information of the first watermark; and adding the first watermark at the first position in the original image according to the element information of the first watermark to obtain the first image. Wherein, the electronic device first shoots an original image without a watermark through a camera, at this time, corresponding watermark information of the original image is generated, the watermark information can include position information and element information, and can also include device model, shooting time, shooting location, shooting parameter and the like, and finally the original image and the watermark information are combined to generate the first image with the watermark.
[0010] Optionally, in another possible implementation manner of the first aspect, the method further includes: cropping the original image to obtain and save a first tile, the position of the first tile in the original image being the first position indicated by the position information of the first watermark, and the first tile not including the first watermark; and removing the first watermark at the first position in the first image according to the element information of the first watermark to obtain the second image, including: covering a second tile in the first image with the first tile to obtain the second image, wherein the second tile includes the first watermark, and the second tile has the same size as the first tile. Since the watermark needs to be removed before the image expansion of the first image, the function of removing the watermark is usually realized by using the watermark position background image (an example of the first tile), therefore, the present application needs to save the watermark position background image corresponding to the first image at the same time when the first image is generated, and then cover the corresponding position (i.e. the second tile) of the first image with the watermark position background image to realize the image watermark removal.
[0011] Optionally, in another possible implementation manner of the first aspect, the image expansion of the second image to obtain the third image includes: expanding the second image along N preset directions to obtain the third image, wherein the size of the third image in the nth preset direction is greater than the size of the second image in the nth preset direction, n≤N and N and n are positive integers. The expansion direction can include the upward direction, the downward direction, the leftward direction, the rightward direction and / or the diagonal direction, and the like, which are not limited by the present application.
[0012] Optionally, in another possible implementation manner of the first aspect, the element information according to the first watermark is used to supplement the second watermark at the second position in the third image to obtain the fourth image, including: determining a target size of the second watermark according to a size of the third image; determining the second position according to the size of the third image and the position information of the first watermark; and supplementing the second watermark at the second position in the third image according to the target size to obtain the fourth image. After the image expansion, the watermark needs to be supplemented. The watermark supplementing process first needs to enlarge the size of each watermark to adapt to the size of the third image after the enlargement, then determines the position of each watermark in the third image, and finally supplements each enlarged watermark into the third image to obtain the fourth image, and completes the watermark supplementing process.
[0013] Optionally, in another possible implementation manner of the first aspect, the supplementing the second watermark at the second position in the third image according to the target size to obtain the fourth image includes: receiving a watermark resource of the second watermark with the target size from a cloud device; and supplementing the second watermark at the second position in the third image according to the watermark resource of the second watermark with the target size to obtain the fourth image. Since the fixed-size watermark is prone to distortion when the size is changed, the cloud watermark resource with a suitable size is selected from the cloud device according to the size of the enlarged watermark, and is used for the watermark supplementing process of the third image.
[0014] Optionally, in another possible implementation manner of the first aspect, the method further includes: during the generation of the third image, intercepting the third image at the second position in the third image to obtain a third tile and save the third tile; and the third tile is used for expanding the fourth image. After the third image is obtained, the watermark position background image (an example of the third tile) is saved, so that if the fourth image needs to be expanded again, the corresponding expansion process can be performed by using the newly saved watermark position background image.
[0015] Optionally, in another possible implementation manner of the first aspect, a size of the second watermark in the fourth image is greater than or equal to a size of the first watermark in the first image. Generally, after the image expansion, the size of the image is increased, and the size of the watermark is also increased to adapt to the size of the new image after the enlargement. However, in a possible implementation scenario, taking the watermark at the bottom of the image as an example, assuming that the image is expanded only upwards, since the size of the left and right sides of the image does not change, the size of the new watermark can be the same as the size of the old watermark.
[0016] Optionally, in another possible implementation manner of the first aspect, the third image includes a first region and a second region, the first region is a region corresponding to the second image, and the second region is a new image region added by the expansion.
[0017] In a second aspect, an embodiment of the present application provides an image expansion device, which comprises a unit for executing the image expansion method of the first aspect, and the unit is composed of software and / or hardware.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the electronic device is capable of implementing any of the methods of the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system comprises one or more processors, and the one or more processors are used to invoke computer instructions so that the electronic device is capable of executing any of the methods of the first aspect.
[0020] Optionally, the chip system further comprises a memory, and the memory is electrically connected with the processor.
[0021] Optionally, the chip system further comprises a communication interface.
[0022] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, which comprises instructions, and when the instructions run on an electronic device, the electronic device is capable of executing any of the methods of the first aspect.
[0023] In a sixth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program, and when the computer program is executed by an electronic device, the electronic device is capable of implementing any of the methods of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below, and obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0025] FIG. 1 is a flow diagram of an image expansion process;
[0026] FIG. 2 is a comparison diagram of an image before and after image expansion, which contains a bar watermark;
[0027] FIG. 3 is a comparison diagram of an image before and after image expansion, which contains a frame watermark;
[0028] FIG. 4 is a comparison diagram of an image before and after image expansion, which contains an embedded watermark;
[0029] FIG. 5 is an execution process example diagram of an image expansion method provided by an embodiment of the present application.
[0030] FIG. 6 is a schematic diagram of a preprocessing process in an image with watermark acquisition process according to an embodiment of the present application;
[0031] FIG. 7 is an example of image cropping according to an embodiment of the present application;
[0032] FIG. 8 is a schematic diagram of a bottom layer implementation of a preprocessing process according to an embodiment of the present application;
[0033] FIG. 9 is a schematic diagram of data interaction of a preprocessing process according to an embodiment of the present application;
[0034] FIG. 10 is a schematic diagram of data interaction of an image expansion process according to an embodiment of the present application;
[0035] FIG. 11 is a schematic diagram of data interaction of a watermark supplement process according to an embodiment of the present application;
[0036] FIG. 12 is a schematic diagram of a processing flow of an image expansion method according to an embodiment of the present application;
[0037] FIG. 13 is a schematic diagram of a flow of an image expansion method according to an embodiment of the present application;
[0038] FIG. 14 is a schematic diagram of a structure of an image expansion apparatus according to an embodiment of the present application;
[0039] FIG. 15 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the drawings.
[0041] Artificial intelligence (AI) image expansion is an operation of expanding and optimizing an image by using an artificial intelligence algorithm. Through the AI image expansion operation, the subject, background, color, light, etc. in the photo can be deeply analyzed, and new content consistent with the style of the original image can be intelligently generated, so as to seamlessly expand the background of the image and enhance the visual effect of the image. Through the image expansion operation, the image can be expanded in at least one direction, and the direction of expansion can be determined by the AI algorithm. In the expansion area, the AI algorithm can generate an intelligent background in combination with the image content.
[0042] FIG. 1 shows a schematic diagram of a flow of an image expansion process. As shown in FIG. 1, an image is uploaded to an image expansion service through an image expansion interface. The image expansion service does not perform special processing on the image after receiving the image, and directly performs image expansion.
[0043] The watermark is a mark added in an image, a document or a video, and is usually used to indicate copyright, ownership or provide additional information. The watermark has various styles, such as embedded watermark, horizontal strip watermark, frame watermark and the like. The watermark information includes position information and element information. The position information can include a starting position, a width, and the like. Different watermark styles contain different watermark elements, and common watermark elements include a device model, a shooting time, a shooting location, shooting parameters (focal length, ISO, and the like), special graphics, special seals, and the like. Different watermark styles can contain different watermark elements.
[0044] Currently, in the process of expanding an image with a watermark, there are problems such as expansion of only the watermark area and abnormal display of the watermark. The following describes some problems that can exist in the current expansion processing of an image with a watermark.
[0045] FIG. 2 shows a comparison of an image with a strip watermark before and after expansion. The image to be processed is shown in FIG. 2(a), where the bottom gray area is the watermark area of the strip watermark, and the strip watermark contains three watermark elements, namely a device model, shooting parameters and a shooting time. The image obtained by performing expansion processing on the image to be processed shown in FIG. 2(a) is shown in FIG. 2(b), where the dashed line represents the position of the upper edge, the lower edge, the left edge and the right edge of the image to be processed. It can be seen that only the bottom watermark area is expanded, and the image itself is not expanded, and the expansion effect is poor.
[0046] For example, the shooting parameters in FIG. 2 can include focal length, ISO and the like, such as 57mm, ISO1000, indicating that the focal length of the camera of the electronic device is 57mm and the ISO is 1000.
[0047] FIG. 3 shows a comparison of an image with a frame watermark before and after expansion. The image to be processed is shown in FIG. 3(a), where the gray area around the image to be processed is the watermark area of the frame watermark. The image obtained by performing expansion processing on the image to be processed shown in FIG. 3(a) is shown in FIG. 3(b), where the dashed line represents the edge position of the image to be processed. It can be seen that only the watermark area corresponding to the frame watermark is expanded, and the image itself is not expanded, and the expansion effect is poor.
[0048] Figure 4 shows a comparison of an image before and after expansion. The image to be processed is shown in Figure 3(a), and the embedded watermark includes three watermark elements, namely the device model, the shooting time and the shooting location, which are displayed at the bottom of the image to be processed. The image obtained by expanding the image shown in Figure 4(a) is shown in Figure 4(b), where the dashed line represents the edge position of the image to be processed. It can be seen that the watermark font is blurred, and the watermark height is abnormal. After expansion, the watermark should also be displayed at the bottom of the image.
[0049] It should be understood that, as can be seen from Figures 2 to 4, expansion is not simply stretching and enlarging the image to be processed, but further expanding the original image to generate new image content.
[0050] Therefore, the embodiment of the present application provides an expansion method, which mainly removes the watermark in the image before expanding the image, and then expands the image after removing the watermark, so as to avoid problems such as only the watermark area being expanded, the watermark being blurred, and the watermark position being abnormal during the expansion of the image. After expansion, the watermark is added to the expanded image to obtain the final image. Through the above scheme, various abnormal problems that may occur when the image with watermark is expanded can be fundamentally solved, and the expansion effect of the image with watermark is improved.
[0051] Referring to Figure 5, an execution process diagram of an expansion method provided by the embodiment of the present application is shown. Figure 5 takes a bar watermark image as an example, and the processing process of other watermark types is similar, which will not be described here. The image to be processed is shown in Figure 5(a), wherein the gray area at the bottom is the watermark area of the bar watermark, and the bar watermark includes three watermark elements, namely the device model, the shooting parameter and the shooting time. For convenience of understanding, the image to be processed shown in Figure 5(a) is referred to as the first image. First, when the expansion instruction for the first image is received, the watermark information of the watermark in the first image is obtained, and then the watermark in the first image is removed according to the watermark information to obtain the second image as shown in Figure 5(b). Then, the second image is expanded to obtain the third image as shown in Figure 5(c). Finally, the third image is supplemented with watermark to obtain the fourth image as shown in Figure 5(d), wherein the position of the watermark in the fourth image corresponds to the position of the watermark in the first image, and both are located at the bottom of the image.
[0052] Figure 6 shows a flow diagram of a pre-processing process in the acquisition process of an image with watermark provided by the embodiment of the present application. The steps shown in Figure 6 will be described below.
[0053] Step 601, obtaining an original image by shooting.
[0054] The electronic device can obtain a raw image without a watermark through the camera.
[0055] Step 602: generating watermark information.
[0056] The watermark information can include device model, shooting time, shooting location, shooting parameter, special pattern, special seal, and other watermark element information, and position information of the watermark, which is determined according to actual application scenarios and requirements, and is not limited in the present application.
[0057] Step 603: generating a watermark image by combining the raw image and the watermark information.
[0058] The watermark can be added to the raw image according to the corresponding position information, so as to generate the watermark image. Optionally, the watermark image can be the first image shown in (a) of FIG. 5.
[0059] The steps 601-603 are a general watermark image generation process. Since the watermark needs to be removed from the watermark image before the watermark image is expanded, for example, the process of (a)-(b) in FIG. 5. The function of removing the watermark usually needs to use a watermark position background image, so the present application embodiment also performs the following steps in the watermark image acquisition process.
[0060] Step 604: obtaining a watermark position background image corresponding to the watermark image according to the position information of the watermark.
[0061] The watermark position background image corresponding to the watermark image is used to remove the watermark from the watermark image.
[0062] For example, FIG. 7 shows an image cutting example provided by the present application. The raw image to be cut is shown in (a) of FIG. 7, and the watermark image is generated by combining the raw image with the bottom bar watermark. On this basis, the raw image is cut according to the watermark position information (i.e. the bottom area of the raw image) corresponding to the bottom bar watermark, and the obtained watermark position background image is shown in (b) of FIG. 7.
[0063] Step 605: encoding the watermark position background image.
[0064] Image encoding, also known as image compression, is a technology for representing an image or information contained in an image with fewer bits under the condition of meeting certain quality (signal-to-noise ratio requirement or subjective evaluation score). Image encoding can optimize storage and transmission efficiency while ensuring image quality and compatibility.
[0065] Step 606: reading image additional information of the watermark image.
[0066] In one embodiment, the watermark information of the watermarked image includes image additional information, which can be saved in the form of an image file directory (IFD) data structure. The IFD is a structure used to store metadata of an image file, commonly found in image files in the tag image file format (TIFF) and exchangeable image file format (Exif). The IFD contains multiple tags, each storing specific image information, such as the 0th IFD, Exif IFD, global positioning system (GPS) IFD, interop IFD, 1st IFD, etc. Among them, the 0th IFD is the basic information part of the image, containing some general image properties, such as image width, height, color space, etc. The Exif IFD contains metadata related to camera settings and shooting conditions, such as shutter speed, aperture, ISO, shooting time, etc., which are usually automatically recorded by the camera when shooting. The GPS IFD contains geographic location information related to the image, such as longitude, latitude, altitude, etc., which is usually available in images taken on electronic devices that support GPS. The interop IFD is used to store interoperability information related to other formats (such as TIFF), which is usually used to ensure compatibility between different devices and software. The 1st IFD is the first additional information part of the image file, usually used to store additional image data.
[0067] Step 607, adding the encoding result of the watermark position background map in the image additional information.
[0068] In one embodiment, the encoding result of the watermark position background map can be stored in the Exif in the image additional information. It should be understood that the encoding result of the watermark position background map can also be stored in other positions in the image additional information, which can be set according to actual application scenarios and needs. Optionally, the encoding result of the watermark position background map can be written behind the 0x9001 tag in the Exif, which is usually used to store some additional information.
[0069] Step 608, saving the watermarked image and the encoding result of the corresponding watermark position background map.
[0070] The preprocessing procedure in the watermarked image acquisition process provided by the embodiments of the present application mainly considers that the watermark in the watermarked image needs to be removed before the watermarked image is expanded, and the function of removing the watermark usually needs to use a watermark position background image, so the present application needs to save the watermark position background image corresponding to the first image while the first image is generated, to prepare for the subsequent watermark removal processing.
[0071] In order to better understand the preprocessing procedure provided by the embodiments of the present application, the underlying implementation procedure of the preprocessing procedure is introduced as follows.
[0072] For example, FIG. 8 is an underlying implementation schematic diagram of a preprocessing procedure provided by an embodiment of the present application. The hardware abstraction (hardware abstraction layer, HAL) layer is an interface layer between the kernel layer of the operating system of the electronic device and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, provides a virtual hardware platform for the operating system, and makes it hardware-independent, which can be transplanted on multiple platforms. From the perspective of software and hardware testing, the software and hardware testing work can be respectively completed based on the hardware abstraction layer, so that the parallel implementation of the software and hardware testing work becomes possible. The application program layer can include a series of application program packages, such as a gallery, and can also include calendar, map, WLAN, music, short message, call, navigation, Bluetooth, video, etc.
[0073] As shown in FIG. 8, first, in the watermark adding module in the HAL layer, the original image data in YUV format, XML data, a watermark position background image and at least one watermark are acquired. The YUV format image includes one luminance component Y and two chrominance components U component and V component, the luminance component Y represents brightness, that is, a gray scale value, and the chrominance components U component and V component represent image color and saturation. The XML data is metadata related to the original image, such as shooting information, shooting parameters and the like. Then the above data is encoded and saved in the HAL layer to generate a fused JPG file, which includes the XML data, a watermark in PNG format and a watermark position background image in JPG format. Finally, the fused JPG file is passed to the gallery in the application layer, and in the gallery, the file is saved and all information contained therein can be accessed. In the gallery, the image can respond to the operation of the user, so as to realize the editing function of the image, such as AI image expansion, that is, the user can select a picture to be processed for image expansion through the upper application function such as the gallery or the album, and can correct the problems of poor original image composition and subject edge sticking.
[0074] On the basis of the bottom layer implementation schematic diagram shown in FIG. 8, FIG. 9 shows a data interaction schematic diagram of a preprocessing process provided in an embodiment of the present application, including the following steps: step 901, obtaining original image data in YUV format by shooting. Step 902, acquiring watermark element information and a watermark position background image, and recording and writing in the Exif of the original image. Step 903, encoding to obtain a fused JPG file, adding a watermark, and finally outputting a watermark-containing image.
[0075] The acquisition method of the watermark-containing image has been described in detail above, and the image expansion process of the watermark-containing image will be introduced below. First, the watermark needs to be removed to obtain a watermark-removed image (for example, a second image) before image expansion, such as the process of (a)-(b) in FIG. 5. After the watermark is removed, the watermark-removed image is expanded to obtain a new size image (for example, a third image) and output, such as the process of (b)-(c) in FIG. 5.
[0076] Specifically, refer to FIG. 10, which shows a data interaction schematic diagram of an image expansion process provided in an embodiment of the present application. The steps shown in FIG. 10 will be introduced below.
[0077] Step 1001, acquiring watermark information corresponding to the watermark-containing image to obtain a watermark position background image.
[0078] In one embodiment, the watermark information can be generated and saved in advance through the foregoing steps 601-607. The watermark position background map can be obtained by reading the picture extension information of the image containing the watermark.
[0079] It should be noted that the present application is only applicable to the picture extension processing of images carrying watermarks. If the picture extension indication for an image is received and it is determined that the image does not carry a watermark, steps 1001 and subsequent steps are not performed.
[0080] Step 1002: The watermark in the image containing the watermark is covered by using the watermark position background map corresponding to the image containing the watermark, to obtain a watermark-removed image.
[0081] The position of the watermark position background map covered in the image containing the watermark corresponds to the watermark position information. That is, the watermark information saved in advance includes the watermark position background map, which is directly covered at the watermark position in the image containing the watermark by using the watermark position background map, to achieve the watermark-removed effect.
[0082] Step 1003: The watermark-removed image is subjected to picture extension processing, and the new size image (without watermark) after picture extension is output and saved.
[0083] In one embodiment, the watermark-removed image is input into the picture extension interface, to generate an expansion area. The expansion direction can be upward, downward, leftward, rightward, diagonal, or the like, which is not limited in the present embodiment. The size of the expansion area is calculated by the AI algorithm according to the size of the watermark-removed image. The content filled in the expansion area is generated by the AI algorithm according to the content in the original image. That is, the watermark-removed image can be subjected to picture extension along N preset directions to obtain a new size image, wherein the size of the new size image in the nth preset direction is greater than the size of the watermark-removed image in the nth preset direction, 1≤n≤N and N and n are integers.
[0084] In one possible implementation, the watermark needs to be supplemented after picture extension is completed, such as the process of (c)-(d) in FIG. 5. The watermark supplementing process first needs to enlarge the size of each watermark to adapt to the size of the new size image after enlargement, then determines the position of each watermark in the new size image, and finally supplements the enlarged watermark into the new size image according to the position information to obtain the final image, such as the fourth image shown in (d) in FIG. 5, so that the watermark supplementing process is completed. That is, the target size of each watermark can be first determined according to the size of the new size image; then the target position corresponding to each watermark is determined according to the size of the new size image and the position information of the watermark; finally, each target size of the new watermark is supplemented at each target position in the new size image according to the target size, to obtain the final image.
[0085] In one embodiment, since the fixed size watermark is prone to cause watermark distortion when the size is transformed, the embodiment of the application selects a cloud watermark resource with a suitable size from the cloud device according to the size of the enlarged watermark, and uses it for watermark processing. That is, the watermark resource of the target size watermark can be first received from the cloud device; and the new watermark is supplemented at the second position in the new size image according to the watermark resource of the target size watermark, to obtain the final image. Optionally, the cloud device can be a cloud watermark resource library.
[0086] In one embodiment, after obtaining the new size image without watermark, the watermark position background graph corresponding to the new size image can also be saved, so that after the new size image is supplemented with watermark, if there is a demand for expansion again, the above expansion process can be repeated to realize expansion again by using the newly saved watermark position background graph. That is, the new size image can be intercepted at the position of the watermark to be added in the new size image during the generation of the new size image, to obtain and save the watermark position background graph, which is used for expanding the image with watermark again after expansion.
[0087] For the convenience of understanding, a data interaction diagram of a detailed watermark supplement process is described below in combination with FIG. 11. FIG. 11 includes the following steps.
[0088] Step 1101, input the new size image, read the watermark information and the size of the new size image.
[0089] Here, the read watermark information is the watermark information corresponding to the image with watermark (for example, the first image shown in (a) of FIG. 5) in the foregoing embodiment.
[0090] Step 1102, calculate the target size of the watermark.
[0091] Here, the watermark information of the new size image after expansion is read to obtain the watermark elements required for watermark supplement and the size of the image after expansion, and the target size of the watermark is calculated.
[0092] In one embodiment, the target size of the watermark needs to be adapted to the size of the enlarged new size image. Assuming that the new size image is enlarged by 1.5 times compared with the original image, the target size of each watermark can also be 1.5 times the original size.
[0093] Step 1103, new watermark cloud download.
[0094] Here, since the fixed size watermark is prone to cause watermark distortion when the size is transformed, the embodiment of the application selects a cloud watermark resource with a suitable size from the cloud device according to the size of the enlarged watermark, and uses it for watermark processing.
[0095] Step 1104, the target position of the new watermark is calculated.
[0096] The target position of the watermark in the new size image should correspond to the position of the watermark in the image with the watermark before the image is expanded, so as to avoid the problem of abnormal display of the position of the watermark after the image is expanded.
[0097] Step 1105, the watermark position background image of the new size image is saved.
[0098] After the new size image without the watermark is obtained, the watermark position background image corresponding to the new size image can also be saved, so that if there is a demand for expansion again after the new size image is supplemented with the watermark, the expansion process in the above embodiment can be repeated to realize expansion again by using the newly saved watermark position background image.
[0099] Step 1106, the watermark information is refreshed.
[0100] The watermark information is refreshed from the watermark information of the image after the image is expanded.
[0101] Step 1107, the new watermark is pasted, and the image with the watermark after expansion is output.
[0102] The new watermark is pasted to obtain the image with the watermark after expansion, and the image with the watermark after expansion carries new watermark information, so that secondary editing operations such as expansion again on the image with the watermark after expansion are not affected.
[0103] To make the scheme in the above embodiment clearer, a detailed expansion process is provided below. Referring to FIG. 12, a processing flow diagram of an expansion method provided by an embodiment of the present application is shown. As shown in FIG. 12, first, in the watermark information editing link, an original image is obtained by shooting, and watermark information is saved to obtain an image with a watermark. After the watermark information saving process, a watermark information index and a watermark position background image are obtained, and the two kinds of data are saved as additional information together with the image with the watermark. Then, the expansion process is entered, and it is learned from the image additional information that the image is an image with a watermark. Then, the watermark position background image corresponding to the image with the watermark is obtained by using the watermark information index, and de-watermarking processing is performed. Further, the de-watermarked image is expanded. Finally, the de-watermarked image is supplemented with a watermark to obtain a final image with a watermark after expansion.
[0104] Referring to FIG. 13, a flow diagram of an expansion method provided by an embodiment of the present application is shown. For the convenience of understanding, FIG. 13 takes the processes (a)-(d) in FIG. 5 as an example to describe an expansion method for expanding a first image to obtain a fourth image. The steps shown in FIG. 13 are described below.
[0105] In response to the instruction of zooming in the first image, the position information and the element information of the first watermark in the first image are acquired.
[0106] The position information of the watermark can include the start position, width, height, etc. of the watermark. The watermark element can include the device model, shooting time, shooting location, shooting parameter (focal length, ISO, etc.), special pattern, special seal, etc.
[0107] It should be understood that the first image can be any image carrying a watermark in addition to the image shown in (a) of FIG. 5, and the same applies to the second image, the third image and the fourth image, which are not limited by the present application.
[0108] It should be noted that the zooming-in method in the embodiments of the present application is only applicable to images carrying a watermark. If the zooming-in instruction for an image is received and it is determined that the image does not carry a watermark, step 1301 and the subsequent steps are not performed.
[0109] In one embodiment, before performing the above-mentioned step 1301, the electronic device first obtains a raw image without a watermark by shooting through the camera, at this time, the watermark information corresponding to the raw image is generated accordingly, which can include position information and element information, and can also include device model, shooting time, shooting location, shooting parameter, etc. Finally, the raw image and the watermark information are combined to generate the first image with a watermark. That is, the raw image can be collected and the watermark information of the raw image can be saved in response to the shooting operation of the user, the watermark information of the raw image includes the position information and the element information of the first watermark; the first watermark is added at the first position in the raw image according to the element information of the first watermark, and the first image is obtained.
[0110] It should be understood that the specific process of generating the first image can refer to the foregoing description of FIG. 6, which will not be described here.
[0111] In one embodiment, since the watermark in the first image needs to be removed before zooming in the first image, and the function of removing the watermark usually needs to use the watermark position background image (an example of the first tile) to achieve, the present application needs to save the watermark position background image corresponding to the first image at the same time of generating the first image. Therefore, the raw image can be cropped to obtain and save the first tile, the position of the first tile in the raw image is the first position indicated by the position information of the first watermark, and the first tile does not include the first watermark.
[0112] It should be understood that the specific process of cropping the raw image can refer to the foregoing description of FIG. 7, for example, the area shown in (b) of FIG. 7 is an example of the first tile.
[0113] At step 1302, the first watermark at the first position in the first image is removed according to the element information of the first watermark, to obtain a second image.
[0114] It should be noted that the first position is the position indicated by the position information of the first watermark.
[0115] In an embodiment, the image watermark removal can be implemented by covering the corresponding position (i.e., the second tile) of the first image with the watermark position background image. The above removing the first watermark at the first position in the first image according to the element information of the first watermark, to obtain a second image, includes: covering the second tile in the first image with the first tile to obtain the second image, where the second tile includes the first watermark, and the second tile has the same size as the first tile.
[0116] At step 1303, the second image is expanded to obtain a third image.
[0117] It should be noted that the third image includes a first region and a second region, the first region is a region corresponding to the second image, for example, the region inside the dashed line in (c) of FIG. 5, and the second region is a new image region added by the expansion, for example, the region outside the dashed line in (c) of FIG. 5.
[0118] In an embodiment, the second image can be expanded to obtain a third image, including: expanding the second image along N preset directions to obtain the third image, where the size of the third image in the nth preset direction is greater than the size of the second image in the nth preset direction, n≤N and N and n are positive integers. The expansion direction can include the top, bottom, left, right and / or diagonal direction, etc., which is not limited in the embodiments of the present application.
[0119] In an embodiment, during the generation of the third image, the third image is intercepted at the second position in the third image to obtain a third tile and save it; the third tile is used for expanding the fourth image. Wherein, the watermark position background image (an example of the third tile) is saved after the third image is obtained, so that if the fourth image needs to be expanded again after it is obtained, the corresponding expansion processing can be performed by using the newly saved watermark position background image.
[0120] It should be understood that the foregoing watermark removal process and the expansion process can refer to the foregoing description of FIG. 10, which will not be repeated here.
[0121] At step 1304, the second watermark is supplemented at the second position in the third image according to the element information of the first watermark, to obtain a fourth image.
[0122] Wherein, the position of the watermark in the fourth image corresponds to the position information of the watermark.
[0123] In one embodiment, the target size of the second watermark can be determined according to the size of the third image; the second position can be determined according to the size of the third image and the position information of the first watermark; and the second watermark can be supplemented at the second position in the third image according to the target size to obtain the fourth image. After the expansion, the watermark needs to be supplemented. The supplementing of the watermark needs to first enlarge the size of each watermark to adapt to the size of the third image after expansion, then determine the position of each watermark in the third image, and finally supplement each enlarged watermark into the third image according to the position information to obtain the fourth image, and complete the supplementing of the watermark.
[0124] In one embodiment, since the fixed-size watermark element is prone to distortion when the size is changed, the application selects a cloud watermark resource with a suitable size from the cloud device according to the size of the enlarged watermark element, and uses it for the supplementing of the watermark of the third image. Therefore, the second watermark can be supplemented at the second position in the third image according to the target size to obtain the fourth image, including: receiving a watermark resource of the second watermark with a target size from a cloud device; and supplementing the second watermark at the second position in the third image according to the watermark resource of the second watermark with the target size to obtain the fourth image.
[0125] In one embodiment, the size of the second watermark in the fourth image is greater than or equal to the size of the first watermark in the first image. Generally, after expansion, the image size becomes larger, and the watermark also becomes larger to adapt to the size of the new image after expansion. However, in a possible implementation scenario, taking the watermark at the bottom of the image as an example, assuming that the expansion is only upward, since the size of the left and right sides of the image does not change, the new watermark size can be the same as the old watermark size.
[0126] It should be understood that the foregoing supplementing of the watermark process can refer to the foregoing description of FIG. 11, which will not be described again here.
[0127] The expansion method disclosed in the foregoing embodiments of the application mainly removes the watermark in the image before expanding the image, expands the image after removing the watermark, avoids problems such as only the watermark area being expanded, the watermark being blurred, and the position of the watermark being abnormal during the expansion of the image, adds the watermark to the expanded image after the expansion to obtain the final image. Through the foregoing scheme, various abnormal problems that can occur when the image with the watermark is expanded can be fundamentally solved, and the expansion effect of the image with the watermark is improved.
[0128] The method of the embodiments of the present application is described above mainly in connection with the drawings. It should be understood that although each step in the flowchart involved in each of the above-described embodiments is shown in sequence, these steps are not necessarily executed in the order shown in the figure. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above-described embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or stages. The device of the embodiments of the present application is described below in connection with the drawings.
[0129] Referring to FIG. 14, a structural schematic diagram of an expansion device provided by an embodiment of the present application is shown, and only parts related to the embodiments of the present application are shown for ease of description. As shown in FIG. 14, the expansion device 1400 includes an acquisition unit 1401 and a processing unit 1402. The expansion device 1400 can be integrated in an electronic device. For example, the expansion device 1400 can also be used to execute the processes shown in FIG. 6, FIG. 8, FIG. 9, FIG. 10, FIG. 11, FIG. 12 or FIG. 13.
[0130] The expansion device 1400 can be used to execute any of the above methods. For example, the acquisition unit 1401 can be used to execute step 1301, and the processing unit 1402 can be used to execute steps 1302-1304.
[0131] The expansion device provided by the embodiments of the present application mainly removes the watermark in the image before expanding the image, and then expands the image after removing the watermark, thereby avoiding problems such as only the watermark area being expanded, the watermark being blurred, and the watermark position being abnormal during the expansion of the image. After expansion, the watermark is added to the expanded image to obtain the final image. Through the above scheme, various abnormal problems that may occur when the image with watermark is expanded can be fundamentally solved, and the expansion effect of the image with watermark is improved.
[0132] It should be noted that the above explanation and description of the expansion method embodiments also apply to the expansion device 1400 of this embodiment, which will not be described here again.
[0133] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
[0134] FIG. 15 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in FIG. 15, the electronic device 1500 can include a processor (central processing unit, CPU) 1510, an external memory interface 1520, an internal memory 1521, a universal serial bus (universal serial bus, USB) interface 1530, a charge management module 1540, a power management module 1541, a battery 1542, an antenna 1, an antenna 2, a mobile communication module 1550, a wireless communication module 1560, an audio module 1570, a speaker 1570A, a receiver 1570B, a microphone 1570C, a headset interface 1570D, a sensor module 1580, a key 1590, a motor 1591, an indicator 1592, a camera 1593, a display screen 1594, and a subscriber identification module (subscriber identification module, SIM) card interface 1595, etc. Among them, the sensor module 1580 can include a pressure sensor 1580A, a gyroscope sensor 1580B, an air pressure sensor 1580C, a magnetic sensor 1580D, an acceleration sensor 1580E, a distance sensor 1580F, a proximity light sensor 1580G, a fingerprint sensor 1580H, a temperature sensor 1580J, a touch sensor 1580K, an ambient light sensor 1580L, a bone conduction sensor 1580M, etc. It should be understood that the steps in the foregoing method embodiments are performed by the processor 1510 of the electronic device.
[0135] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 1500. In other embodiments of the present application, the electronic device 1500 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0136] Exemplarily, the processor 1510 shown in FIG. 15 can include one or more processing units, for example: the processor 1510 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0137] Among them, the controller can be the nerve center and command center of the electronic device 1500. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.
[0138] The memory can also be provided in the processor 1510 for storing instructions and data. In some embodiments, the memory in the processor 1510 is a cache memory. The memory can save instructions or data that have just been used or recycled by the processor 1510. If the processor 1510 needs to use the instructions or data again, it can be directly called from the memory. Avoiding repeated access, reducing the waiting time of the processor 1510, thus improving the efficiency of the system.
[0139] In some embodiments, the MIPI interface can be used to connect the processor 1510 and peripheral devices such as the display screen 1594 and the camera 1593. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. The processor 1510 and the display screen 1594 communicate through the DSI interface to realize the display function of the electronic device 1500.
[0140] In some embodiments, the GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. The GPIO interface can be used to connect the processor 1510 to the camera 1593, the display screen 1594, the wireless communication module 1560, the audio module 1570, the sensor module 1580, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, and the like.
[0141] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 1500. In some other embodiments of the present application, the electronic device 1500 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0142] The electronic device 1500 implements a display function through a GPU, the display screen 1594, and an application processor, and the like. The GPU is a microprocessor for image processing, connected to the display screen 1594 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1510 can include one or more GPUs that execute program instructions to generate or change display information.
[0143] The display screen 1594 is used to display images, videos, and the like. The display screen 1594 includes a display panel. In some embodiments, the electronic device 1500 can include 1 or N display screens 1594, N being a positive integer greater than 1.
[0144] The internal memory 1521 can be used to store computer executable program codes including instructions. The processor 1510 executes various function applications and data processing of the electronic device 1500 by running the instructions stored in the internal memory 1521. The internal memory 1521 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, and the like), and the like. The data storage area can store data created during use of the electronic device 1500 (such as audio data, a phone book, and the like), and the like. In addition, the internal memory 1521 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
[0145] The pressure sensor 1580A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 1580A can be disposed on the display screen 1594. The pressure sensor 1580A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 1580A, the capacitance between the electrodes changes. The electronic device 1500 determines the intensity of the force based on the change in capacitance. When a touch operation is applied to the display screen 1594, the electronic device 1500 detects the intensity of the touch operation based on the pressure sensor 1580A. The electronic device 1500 can also calculate the position of the touch based on the detection signal of the pressure sensor 1580A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to the short message application icon, an instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0146] The touch sensor 1580K, also referred to as a "touch panel". The touch sensor 1580K can be disposed on the display screen 1594, and the touch sensor 1580K and the display screen 1594 together form a touch screen, also referred to as a "touch screen". The touch sensor 1580K is configured to detect a touch operation applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 1594. In other embodiments, the touch sensor 1580K can also be disposed on the surface of the electronic device 1500, which is different from the position where the display screen 1594 is located.
[0147] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought by them can be referred to the method embodiments part, and will not be repeated here.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of mutual distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0149] The embodiments of the present application also provide an electronic device, which comprises one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, and the one or more processors execute the computer program to enable the electronic device to implement the steps in any of the foregoing methods. The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and the computer program is executed by an electronic device to implement the steps in each of the foregoing method embodiments.
[0150] The computer-readable medium can at least include any entity or device capable of carrying the computer program code to the photographing device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. For example, a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunications signal.
[0151] The embodiments of the present application provide a computer program product, which comprises a computer program, and when the computer program is executed by an electronic device, the steps in each of the foregoing method embodiments can be implemented. The computer program comprises computer program code, which can be in the form of source code, object code, an executable file, or some intermediate form, etc.
[0152] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0153] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or in a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solutions. A person skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0154] In the embodiments provided in the present application, it should be understood that the disclosed apparatuses / devices and methods can be implemented in other ways. For example, the above-described apparatus / device embodiments are merely illustrative, for example, the division of the modules or units is merely a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between each other can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0155] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0156] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or sets thereof.
[0157] It should also be understood that the term "and / or" used in the description of the present application and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0158] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0159] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "in a various embodiment" or "in some embodiments" in various places throughout this specification are not necessarily referring to the same embodiment, but can, but not necessarily, refer to different embodiments. The terms "including," "comprising," "having" and variations thereof are meant to encompass the items listed thereafter, but do not exclude other items from also being present. The term "consisting of" is meant to exclude any item not specified, but "consisting essentially of" does not exclude other items that do not "materially" affect the essential characteristics of the application.
[0160] The above-described embodiments are merely intended to illustrate the technical solutions of the present application, but not to limit the same; even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features therein; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An image expansion method applied to an electronic device, characterized by, The method comprises: in response to an instruction of zooming in on a first image, acquiring position information and element information of a first watermark in the first image; according to the element information of the first watermark, removing the first watermark at a first position in the first image to obtain a second image, the first position being indicated by the position information of the first watermark; zooming in on the second image to obtain a third image; according to the element information of the first watermark, supplementing a second watermark at a second position in the third image to obtain a fourth image.
2. The method of claim 1, wherein, The method further comprises: in response to a shooting operation of a user, collecting an original image and saving watermark information of the original image, the watermark information of the original image comprising the position information and the element information of the first watermark; according to the element information of the first watermark, adding the first watermark at the first position in the original image to obtain the first image.
3. The method of claim 2, wherein, The method further comprises: cropping the original image to obtain a first tile and save, the position of the first tile in the original image being the first position indicated by the position information of the first watermark, and the first tile not including the first watermark; the removing the first watermark at the first position in the first image according to the element information of the first watermark to obtain the second image comprises: covering a second tile in the first image with the first tile to obtain the second image, wherein the second tile comprises the first watermark, and the second tile has the same size as the first tile.
4. The method according to any of claims 1 to 3, characterized in that, The zooming in on the second image to obtain the third image comprises: zooming in on the second image along N preset directions to obtain the third image, wherein the size of the third image in the nth preset direction is greater than the size of the second image in the nth preset direction, n≤N, and N and n are positive integers.
5. The method according to any of claims 1 to 4, characterized in that, The supplementing the second watermark at the second position in the third image according to the element information of the first watermark to obtain the fourth image comprises: determining a target size of the second watermark according to the size of the third image; determining the second position according to the size of the third image and the position information of the first watermark; supplementing the second watermark at the second position in the third image according to the target size to obtain the fourth image.
6. The method of claim 5, wherein, The supplementing the second watermark at the second position in the third image according to the target size to obtain the fourth image comprises: receiving a watermark resource of the second watermark of the target size from a cloud device; supplementing the second watermark at the second position in the third image according to the watermark resource of the second watermark of the target size to obtain the fourth image.
7. The method according to any of claims 1 to 6, characterized in that The method further comprises: during the generation of the third image, cropping the third image at the second position in the third image to obtain a third tile and save; the third tile is used for zooming in on the fourth image.
8. The method according to any one of claims 1 to 7, characterized in that, The size of the second watermark in the fourth image is greater than or equal to the size of the first watermark in the first image.
9. The method according to any of claims 1 to 8, characterized in that, The third image includes a first region and a second region, the first region being a region corresponding to the second image, and the second region being a new image region added by image expansion.
10. An electronic device, comprising: The electronic device includes one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method according to any one of claims 1 to 9.
11. A chip system, characterized by The chip system is applied to an electronic device, and the chip system includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium includes instructions configured to cause an electronic device to perform the method according to any one of claims 1 to 9 when the instructions are executed on the electronic device.
13. A computer program product, characterised in that, The computer program product includes a computer program configured to cause an electronic device to perform the method according to any one of claims 1 to 9 when the computer program is executed on the electronic device.