Media processing method and device and electronic equipment

By displaying the canvas of the target size in the screen area and using gesture operations to zoom and move the media, and combining the extended area to generate a mask bitmap, the problem that known media sizes do not meet the usage needs is solved, and efficient media expansion and user experience improvement is achieved.

CN120428899APending Publication Date: 2025-08-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410160537.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

In the prior art, it is known that when the size of the media does not meet the usage needs, it lacks efficient expansion solutions, and the user's operation is inconvenient, which affects the user's experience.

Method used

By obtaining the media to be expanded and determining the target size, displaying a canvas that meet the target size in the screen area, using gesture operations to scale and move the media within the limit conditions, combining the extended area to generate a mask bitmap, and using a machine learning model or server to perform expansion processing to obtain a target media that meets the target size.

Benefits of technology

It realizes efficient expansion of known media, improves user settings and operation convenience before expansion, and improves the effect and user experience of media expansion processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120428899A_ABST
    Figure CN120428899A_ABST
Patent Text Reader

Abstract

The invention provides a media processing method and device and electronic equipment, and a specific implementation mode of the method comprises the steps: obtaining a to-be-expanded media, and determining a target size; based on the target size, a canvas meeting the target size is displayed in the screen area, and the to-be-expanded media are displayed in the area of the canvas; a transparent view with a gesture operation function covers the canvas; zooming and moving the media to be expanded within the limiting conditions based on gesture operation of a user on the canvas; determining an expansion area around the to-be-expanded media according to the zooming and moving results of the to-be-expanded media; and in combination with the expansion area, obtaining a target media meeting the target size after the media to be expanded is expanded. According to the embodiment, the purpose of expanding the known to-be-expanded media is achieved, a user can perform more convenient setting operation on the to-be-expanded media before the media are expanded, the media expansion processing effect is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of media processing technologies, and particularly to a media processing method, apparatus, and electronic device. Background Art

[0002] With the continuous development and improvement of media technologies such as digital images and videos, the application of digital media has become increasingly widespread. Digital media not only brings many conveniences to people, but also adds more fun to people's lives. In some cases, people need to expand known media. For example, when the size of the known media cannot meet the usage requirements, or when people hope to obtain richer media materials based on the known media, an efficient solution for expanding the known media is needed. Summary of the Invention

[0003] The present disclosure provides a media processing method, apparatus, and electronic device.

[0004] According to a first aspect, a media processing method is provided. The method includes:

[0005] Obtain a media to be expanded and determine a target size;

[0006] Based on the target size, display a canvas that meets the target size in a screen area, and display the media to be expanded in an area of the canvas;

[0007] Based on a gesture operation of a user on the canvas, scale and move the media to be expanded within a restricted condition;

[0008] Determine an expansion area around the media to be expanded according to the result of scaling and moving the media to be expanded;

[0009] Combine the expansion area to obtain a target media that meets the target size after expanding the media to be expanded.

[0010] According to a second aspect, a media processing apparatus is provided. The apparatus includes:

[0011] A first acquisition module, configured to obtain a media to be expanded and determine a target size;

[0012] A generation module, configured to display a canvas that meets the target size in a screen area based on the target size, and display the media to be expanded in an area of the canvas;

[0013] An operation module, configured to scale and move the media to be expanded within a restricted condition based on a gesture operation of a user on the canvas;

[0014] A determination module, configured to determine an expansion area around the to-be-expanded media according to the results of scaling and moving the to-be-expanded media;

[0015] A second acquisition module, configured to obtain a target media that meets the target size after expanding the to-be-expanded media in combination with the expansion area.

[0016] According to a third aspect, there is provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the method according to any one of the above first aspects.

[0017] According to a fourth aspect, there is provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the method according to any one of the first aspects.

[0018] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0019] A media processing method and apparatus provided by an embodiment of the present disclosure obtain a to-be-expanded media, determine a target size, and based on the target size, display a canvas that meets the target size in a screen area, and display the to-be-expanded media in an area of the canvas, and a transparent view with gesture operation function is covered above the canvas. Based on the user's gesture operations on the canvas, scale and move the to-be-expanded media within the restricted conditions, determine the expansion area around the to-be-expanded media according to the results of scaling and moving the to-be-expanded media, and obtain a target media that meets the target size after expanding the to-be-expanded media in combination with the expansion area. Thus, the purpose of expanding the known to-be-expanded media is achieved, and moreover, the user can perform more convenient setting operations on the to-be-expanded media before media expansion, improving the effect of media expansion processing and enhancing the user experience.

[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 It is a schematic diagram of an exemplary system architecture for applying the embodiments of the present disclosure;

[0023] Figure 2 Schematic diagram of a link scenario for extended media shown according to an exemplary embodiment;

[0024] Figure 3 Flowchart of a media processing method shown according to an exemplary embodiment of the present disclosure;

[0025] Figure 4 Schematic diagram of a media processing scenario shown according to an exemplary embodiment of the present disclosure;

[0026] Figure 5 Block diagram of a media processing device shown according to an exemplary embodiment of the present disclosure;

[0027] Figure 6 Schematic block diagram of an electronic device provided in some embodiments of the present disclosure. Detailed implementation manners

[0028] In order to enable those skilled in the art of the present technology to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this specification.

[0029] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0030] The terms used in the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit the present disclosure. The singular forms of "a", "the", and "said" used in the present disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0031] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0032] See Figure 1 , which is a schematic diagram of an exemplary system architecture for applying the embodiments of this disclosure.

[0033] As Figure 1 shown, the system architecture 100 may include terminal devices 102, a network 103, and a server 104. It should be understood that Figure 1 the number or type of terminal devices, networks, and servers in

[0034] is merely illustrative. According to the implementation requirements, there may be any number or type of terminal devices, networks, and servers.

[0035] The network 103 is used to provide a medium for communication links between terminal devices and servers. The network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0036] The terminal device 102 may interact with the server through the network 103 to receive or send requests, information, etc. The terminal device 102 may be various electronic devices, including but not limited to smartphones, tablets, laptop portable computers, desktop computers, and smart wearable devices, etc.

[0037] Based on Figure 1The system architecture shown. In an embodiment of the present disclosure, user 101 can input the media to be extended and text guidance information through terminal device 102, and set the target size and extended area for generating the target media through terminal device 102. Then, terminal device 102 can send the media to be extended, the target size, the extended area, and the text guidance information to server 104 through network 103. After receiving the media to be extended, the target size, the extended area, and the text guidance information, server 104 can perform extension processing on the media to be extended based on the target size, the extended area, and the text guidance information to obtain the target media. Finally, server 104 can return the target media to terminal device 102 through network 103, enabling user 101 to view the effect of the target media through terminal device 102 and save the target media.

[0038] See Figure 2 , which is a schematic diagram of a link scenario for extending media shown according to an exemplary embodiment.

[0039] As Figure 2 shown, first, the user can input the original media A through a third-party application installed on the terminal device, and the original media A can be displayed in the media editing interface of the third-party application. The user can edit the original media A through the media editing interface, and after the editing is completed, trigger the activation of the media extension function. The third-party application can display the media extension interface, generate a default canvas in the media extension interface, and use the edited media as the media B to be extended, and display the media B to be extended in the area of the default canvas.

[0040] The user can perform setting operations through the media extension interface, such as setting the aspect ratio of the canvas or setting the multiple of media extension. The third-party application can determine the target size for generating the target media according to the setting operations of the user through the media extension interface, and display a canvas that meets the target size in the media extension interface, and display the media B to be extended in the new canvas area. The user can also perform media adjustment operations through the media extension interface, such as zooming in or out on the media B to be extended, or adjusting the position area of the media B to be extended in the canvas. The third-party application can determine the area that needs to be extended around the media B to be extended according to the adjustment operations of the user through the media extension interface. The user can also input text guidance information through the media extension interface, and the text guidance information is used to guide the extension of the media B to be extended.

[0041] Next, the third-party application can generate a mask bitmap C based on the size of the canvas after being set (i.e., the target size) and the area occupied by the media B to be extended in the canvas. The size of the mask bitmap C is the same as the target size. The area occupied by the media B to be extended in the mask bitmap C is black, and the area to be extended around the media B to be extended is white. Then, the terminal device uploads the media B to be extended and the mask bitmap C to the storage device in the service platform respectively, and obtains the resource locators of the media B to be extended and the mask bitmap C respectively. The third-party application can generate a media extension task request based on the resource locators of the media B to be extended and the mask bitmap C respectively and the text guidance information. And the terminal device sends the media extension task request to the computing device in the service platform.

[0042] Finally, the computing device in the service platform can complete the media extension task based on the media extension task request. Specifically, based on the above-mentioned resource locators included in the media extension task request, the computing device can obtain the media B to be extended and the mask bitmap C from the storage device in the service platform, and under the guidance of the text guidance information included in the media extension task request, perform the extension of the media B to be extended based on the mask bitmap C to obtain the target media D after extension. After the computing device in the service platform completes the media extension task, it can return the target media D to the terminal device, and the terminal device can display the target media D to the user through the result display interface of the third-party application.

[0043] The present disclosure will be described in detail below with reference to specific embodiments.

[0044] Figure 3 FIG. is a flowchart of a media processing method according to an exemplary embodiment. This method can be applied to a terminal device. In this embodiment, for ease of understanding, a terminal device capable of installing a third-party application is used as an example. Those skilled in the art can understand that the terminal device may include, but is not limited to, mobile terminal devices such as smart phones, smart wearable devices, tablet computers, and the like. It should be noted that the media involved in this embodiment may be an image or a video, etc. This method may include the following steps:

[0045] As Figure 3 shown, in step 301, obtain the media to be extended, determine the target size, and in step 302, based on the target size, display a canvas that meets the target size in the screen area, so that the media to be extended is displayed in the area of the canvas.

[0046] In this embodiment, a third-party application for processing media is installed in the terminal device. The user can start the third-party application and input existing original media through the media processing interface provided by the third-party application. The original media can be a newly taken photo or video, or can be selected from the picture library or video stored in the terminal device. It can be understood that this embodiment is not limited in this regard. In one implementation, the original media can be directly used as the media to be extended.

[0047] In another implementation, the original media can also be edited, and the media after the editing process is used as the media to be extended. Specifically, the original media can be displayed in the media editing interface provided by the third-party application, and various media editing tools are provided in the media editing interface. The user can perform various editing operations on the original media through the media editing tools provided in the editing interface. The original media can be edited based on the user's operations. Among them, the editing process of the original media can include but is not limited to cropping the original media, adding new elements to the original media, color correcting the original media, adding special effects to the original media, etc. After the user completes the editing operation on the original media, a preset operation can be performed to trigger the activation of the media extension function. The preset operation can include but is not limited to the operation of clicking a preset button, a preset gesture operation, etc. In response to the user's preset operation, the media after the above editing process can be used as the media to be extended.

[0048] Since this embodiment can edit the media before extending the media, there is no need to store and then upload the edited media first, which improves the efficiency of media extension and also enhances the user experience.

[0049] In this embodiment, after the media extension function is activated, the third-party application can provide a media extension interface on the terminal device. In the media extension interface, the initial canvas can be initially displayed in the default size, and the media to be extended is displayed in the initial canvas area. The default size can be the size after magnifying the media to be extended by a preset multiple according to the aspect ratio of the width and height of the media to be extended.

[0050] Setting tools are displayed in the media extension interface. The user can set the aspect ratio of the canvas or the magnification factor of media extension through the setting tools provided in the media extension interface. For example, the user can set the aspect ratio of the canvas to be the same as the aspect ratio of the media to be extended through the setting tools, or can set the aspect ratio of the canvas to a specified aspect ratio, or can customize the aspect ratio of the canvas. Among them, when the aspect ratio of the canvas is set to be the same as the aspect ratio of the media to be extended, the magnification factor of media extension can be further set.

[0051] When the user completes each setting, the size of the canvas can be determined based on the user's settings. For example, if the aspect ratio of the canvas is the same as the aspect ratio of the media to be expanded, the magnification factor of the media expansion is further obtained. Based on the size of the media to be expanded and the magnification factor of the media expansion, the size of the canvas can be determined. If the aspect ratio of the canvas is set to a specified aspect ratio, the size of the canvas pre-set for this specified aspect ratio can be obtained. If the aspect ratio of the canvas is set to a custom aspect ratio, the size of the canvas can be calculated according to a pre-set calculation rule.

[0052] Take the finally determined size of the canvas as the target size. Therefore, if the user does not set the aspect ratio of the canvas, the default size of the above initial canvas can be used as the target size. If the user sets the aspect ratio of the canvas at least once, the size of the canvas set last can be used as the target size.

[0053] In this embodiment, after determining the target size of the canvas, a canvas meeting the target size can be displayed in the media expansion interface, and the media to be expanded can be displayed in the area of the canvas. For example, the media to be expanded can be displayed in the central area of the canvas. A transparent view with gesture operation function can be overlaid on the canvas, and a layer scaling function can be added to this transparent view. The user can perform zooming and moving operations on the media to be expanded through the transparent view above the canvas. After the transparent view captures the relevant gesture operations, it can trigger the zooming and moving of the layer of the media to be expanded.

[0054] In step 303, based on the user's gesture operation on the canvas, the media to be expanded is scaled and moved within the limiting conditions.

[0055] In this embodiment, in response to the user's gesture operation on the canvas, the media to be expanded can be scaled and moved within the limiting conditions. Specifically, the limiting conditions can at least include two aspects. On the one hand, it can be the limitation on the position area where the media to be expanded is located, and the range of the canvas can be used as the limitation on the position area where the media to be expanded is located. On the other hand, it can be the limitation on the magnification factor of the media to be expanded. For example, it can be to limit the maximum magnification size and the minimum reduction size of the media to be expanded.

[0056] Specifically, the first aspect ratio of the media to be expanded and the second aspect ratio of the canvas can be determined first. If the first aspect ratio is less than the second aspect ratio, when the height of the media to be expanded is the same as the height of the canvas, the size of the media to be expanded is determined as the maximum magnification size, and the size smaller than the maximum magnification size by a preset multiple is determined as the minimum reduction size. Figure 4As shown, the aspect ratio of the media to be expanded 401 is smaller than the aspect ratio of the canvas 402. Therefore, when the height of the media to be expanded is the same as the height of the canvas, the size of the media to be expanded 401a at this time can be used as the maximum magnification size, and the size of the media to be expanded 401b that is a preset multiple smaller than the size of the media to be expanded 401a can be determined as the minimum reduction size.

[0057] If the first aspect ratio is equal to the second aspect ratio, the size of the canvas can be determined as the maximum magnification size, and the size that is a preset multiple smaller than the maximum magnification size can be determined as the minimum reduction size. As Figure 4 shown, the aspect ratio of the media to be expanded 403 is equal to the aspect ratio of the canvas 404. Therefore, the size of the canvas 404 can be used as the maximum magnification size, and the size of the media to be expanded 403a that is a preset multiple smaller than the size of the canvas 404 can be determined as the minimum reduction size.

[0058] If the first aspect ratio is greater than the second aspect ratio, when the width of the media to be expanded is the same as the width of the canvas, the size of the media to be expanded can be determined as the maximum magnification size, and the size that is a preset multiple smaller than the maximum magnification size can be determined as the minimum reduction size. As Figure 4 shown, the aspect ratio of the media to be expanded 405 is smaller than the aspect ratio of the canvas 406. Therefore, when the width of the media to be expanded is the same as the width of the canvas, the size of the media to be expanded 405a at this time can be used as the maximum magnification size, and the size of the media to be expanded 405b that is a preset multiple smaller than the size of the media to be expanded 405a can be determined as the minimum reduction size.

[0059] It should be noted that the above preset multiple can be any reasonable value determined based on experience, and the specific value of the above preset multiple is not limited in this embodiment.

[0060] After determining the maximum magnification size and the minimum reduction size of the media to be expanded, according to the user's zoom gesture operation on the media to be expanded on the canvas, within the canvas range, the media to be expanded can be scaled between the maximum magnification size and the minimum reduction size. And, according to the user's move gesture operation on the media to be expanded on the canvas, the media to be expanded can be moved within the canvas range. For example, if the media to be expanded has reached the maximum magnification size and the user still continues to perform an operation to expand the media to be expanded, the expansion of the media to be expanded can be stopped. If the media to be expanded has reached the minimum reduction size and the user still continues to perform an operation to reduce the media to be expanded, the reduction of the media to be expanded can be stopped. If the edge of the media to be expanded has coincided with the edge of the canvas and the user still continues to perform an operation to expand the media to be expanded or move it to an area outside the canvas, the expansion or movement of the media to be expanded can be stopped.

[0061] Since the maximum magnification size and the minimum reduction size of the media to be extended are set in this embodiment, it is possible to avoid the poor media extension effect caused by the improper operation of the user, which helps to improve the media extension effect.

[0062] In step 304, according to the result of scaling and moving the media to be extended, the extension area around the media to be extended is determined.

[0063] In this embodiment, after the user finishes scaling and moving the media to be extended, the user can trigger a media extension instruction. In response to the media extension instruction triggered by the user, the extension area around the media to be extended can be determined. Among them, the media extension instruction can be that the user clicks a preset media extension start button, or a preset media extension start gesture operation, etc. Specifically, according to the result of scaling and moving the media to be extended and the size of the canvas, the position area of the media to be extended in the canvas can be obtained, and the area outside the media to be extended in the canvas is used as the extension area around the media to be extended, so as to fill the extension area.

[0064] In one implementation, the mask bitmap corresponding to the target media can be determined according to the result of scaling and moving the media to be extended. The mask bitmap is used to indicate the position area of the media to be extended in the target media and the extension area around the media to be extended. Specifically, according to the target size and the position area occupied by the media to be extended in the canvas, a mask bitmap can be generated such that the size of the mask bitmap is the same as the target size, the area occupied by the media to be extended in the mask bitmap is black, and the area to be extended around the media to be extended is white.

[0065] Since this embodiment uses the mask bitmap to indicate the position area of the media to be extended in the target media and the extension area around the media to be extended, the media extension effect is improved.

[0066] In step 305, in combination with the extension area, a target media that meets the target size after extending the media to be extended is obtained.

[0067] In this embodiment, the extension area around the media to be extended can be combined to perform an extension process on the media to be extended to obtain a target media that meets the target size. In one implementation, the terminal device can be provided with a pre-trained machine learning model. The information of the media to be extended and the extension area can be input into the machine learning model, and the machine learning model extends the media to be extended to fill the media in the extension area to obtain the target media.

[0068] In another implementation, the terminal device can also upload the media to be extended and the mask bitmap to the server, so that the server extends the media to be extended based on the mask bitmap to obtain the target media and returns the target media to the terminal device. Specifically, the terminal device can upload the media to be extended and the mask bitmap, obtain the resource locators corresponding to the media to be extended and the mask bitmap respectively, and the terminal device can also obtain the text guidance information input by the user. Then, the terminal device can generate a media extension task request based on the resource locators corresponding to the media to be extended and the mask bitmap respectively and the text guidance information, and send the media extension task request to the server. Under the indication of the media extension task request, the server obtains the media to be extended and the mask bitmap based on the resource locators corresponding to the media to be extended and the mask bitmap respectively, and then, using a pre-trained machine learning model, under the guidance of the text guidance information, generates an extended media based on the mask bitmap and the media to be extended, and then replaces the area occupied by the media to be extended in the extended media with the media to be extended. To avoid edge jumps, the edges of the media to be extended in the extended media after replacement can be blurred to obtain the target media, and then the server returns the target media to the terminal device.

[0069] A media processing method provided by the present disclosure obtains a media to be extended, determines a target size, and based on the target size, displays a canvas that meets the target size in the screen area, so that the media to be extended is displayed in the area of the canvas, and a transparent view with gesture operation function is covered above the canvas. Based on the user's gesture operations on the canvas, the media to be extended is scaled and moved within the restricted conditions, and according to the results of scaling and moving the media to be extended, the extended area around the media to be extended is determined, and combined with the extended area, the target media that meets the target size after extending the media to be extended is obtained. Thus, the purpose of extending the known media to be extended is achieved, and the user can perform more convenient setting operations on the media to be extended before media extension, improving the effect of media extension processing and enhancing the user experience.

[0070] It should be noted that although in the above embodiments, the operations of the method of the embodiments of the present disclosure are described in a specific order, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can be changed in the execution order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.

[0071] Corresponding to the foregoing embodiments of the media processing method, the present disclosure also provides an embodiment of a media processing apparatus.

[0072] As Figure 5 shown,Figure 5 FIG. Figure 5 is a block diagram of a media processing device according to an exemplary embodiment of the present disclosure. The device may include: a first acquisition module 501, a generation module 502, an operation module 503, a determination module 504, and a second acquisition module 505.

[0073] The first acquisition module 501 is configured to acquire a media to be extended and determine a target size.

[0074] The generation module 502 is configured to display a canvas that meets the target size in the screen area based on the target size, and display the media to be extended in the area of the canvas.

[0075] The operation module 503 is configured to scale and move the media to be extended within the limit conditions based on the gesture operation of the user on the canvas.

[0076] The determination module 504 is configured to determine an extended area around the media to be extended according to the results of scaling and moving the media to be extended.

[0077] The second acquisition module 505 is configured to obtain a target media that meets the target size after extending the media to be extended by combining the extended area.

[0078] In some embodiments, the first acquisition module 501 is configured to: display the original media in the media editing interface, perform editing processing on the original media based on the operation of the user on the original media through the editing interface, and in response to a preset operation of the user, acquire the media after editing processing as the media to be extended.

[0079] In some other embodiments, the operation module 503 is configured to: determine the maximum magnification size and the minimum reduction size of the media to be extended, scale the media to be extended between the maximum magnification size and the minimum reduction size within the canvas range according to the zoom gesture operation of the user on the media to be extended on the canvas, and move the media to be extended within the canvas range according to the move gesture operation of the user on the media to be extended on the canvas.

[0080] In some other embodiments, the operation module 503 determines the maximum magnification size and the minimum reduction size of the media to be extended in the following manner: determining the first aspect ratio of the media to be extended and the second aspect ratio of the canvas. If the first aspect ratio is less than the second aspect ratio, the size of the media to be extended when its height is the same as the height of the canvas is determined as the maximum magnification size, and the size that is a preset multiple smaller than the maximum magnification size is determined as the minimum reduction size. If the first aspect ratio is equal to the second aspect ratio, the size of the canvas is determined as the maximum magnification size, and the size that is a preset multiple smaller than the maximum magnification size is determined as the minimum reduction size. If the first aspect ratio is greater than the second aspect ratio, the size of the media to be extended when its width is the same as the width of the canvas is determined as the maximum magnification size, and the size that is a preset multiple smaller than the maximum magnification size is determined as the minimum reduction size.

[0081] In some other embodiments, the determination module 504 is configured to: determine a mask bitmap corresponding to the target media according to the results of scaling and moving the media to be extended, and the mask bitmap is used to indicate the position area of the media to be extended in the target media and the extended area around the media to be extended.

[0082] In some other embodiments, the second acquisition module 505 is configured to: upload the media to be extended and the mask bitmap to the server, so that the server performs extension based on the mask bitmap and the media to be extended to obtain the target media. Receive the target media sent by the server.

[0083] In some other embodiments, the device may further include: an input module (not shown in the figure).

[0084] The input module is used to obtain the text guidance information input by the user.

[0085] The second acquisition module 505 may upload the media to be extended and the mask bitmap to the server in the following manner, so that the server performs extension based on the mask bitmap and the media to be extended: upload the media to be extended and the mask bitmap, and obtain the resource locators corresponding to the media to be extended and the mask bitmap respectively. Based on the resource locators and the text guidance information, generate a media extension task request, and send the media extension task request to the server to instruct the server to perform extension on the media to be extended based on the media extension task request.

[0086] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present disclosure. A person of ordinary skill in the art can understand and implement it without creative work.

[0087] An electronic device provided by some embodiments of the present disclosure. The electronic device includes a processor and a memory, and can be used to implement a client or a server. The memory is used to non-transiently store computer-executable instructions (such as one or more computer program modules). The processor is used to run the computer-executable instructions, and when the computer-executable instructions are run by the processor, one or more steps in the media processing method described above can be executed, thereby implementing the media processing method described above. The memory and the processor can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0088] For example, the processor can be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) can be of X86 or ARM architecture, etc. The processor can be a general-purpose processor or a dedicated processor, and can control other components in the electronic device to perform the desired functions.

[0089] For example, the memory can include any combination of one or more computer program products. The computer program products can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory can, for example, include random access memory (RAM) and / or cache memory, etc. Non-volatile memory can, for example, include read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules can be stored on the computer-readable storage media, and the processor can run one or more computer program modules to implement various functions of the electronic device. Various application programs and various data, as well as various data used and / or generated by the application programs, can also be stored in the computer-readable storage media.

[0090] It should be noted that in the embodiments of the present disclosure, the specific functions and technical effects of the electronic device can be referred to the description of the media processing method above, and will not be elaborated here.

[0091] Figure 6 A schematic block diagram of an electronic device provided for some embodiments of the present disclosure. The electronic device 920 is, for example, suitable for implementing the media processing method provided by the embodiments of the present disclosure. The electronic device 920 may be a terminal device or the like, and may be used to implement a client or a server. The electronic device 920 may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that Figure 6 The illustrated electronic device 920 is merely an example and will not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0092] As Figure 6 shown, the electronic device 920 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 921, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 922 or a program loaded from a storage device 928 into a random access memory (RAM) 923. In the RAM 923, various programs and data required for the operation of the electronic device 920 are also stored. The processing device 921, the ROM 922, and the RAM 923 are connected to each other through a bus 924. An input / output (I / O) interface 925 is also connected to the bus 924.

[0093] Generally, the following devices may be connected to the I / O interface 925: an input device 926 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 927 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 928 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 929. The communication device 929 may allow the electronic device 920 to communicate with other electronic devices wirelessly or wiredly to exchange data. Although Figure 6 the illustrated electronic device 920 has various devices, it should be understood that it is not required to implement or include all the illustrated devices, and the electronic device 920 may alternatively implement or include more or fewer devices.

[0094] For example, according to an embodiment of the present disclosure, the above media processing method can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium. The computer program includes program code for executing the above media processing method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 929, or installed from a storage device 928, or installed from a ROM 922. When the computer program is executed by a processing device 921, the functions defined in the media processing method provided by the embodiment of the present disclosure can be realized.

[0095] A storage medium provided by some embodiments of the present disclosure. For example, the storage medium can be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions. When the non-transitory computer-executable instructions are executed by a processor, the media processing method described in the embodiments of the present disclosure can be realized. For example, when the non-transitory computer-executable instructions are executed by a processor, one or more steps of the media processing method described above can be executed.

[0096] For example, the storage medium can be applied to the above electronic device. For example, the storage medium can include the memory in the electronic device.

[0097] For example, the storage medium can include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a flash memory, or any combination of the above storage media, and can also be other applicable storage media.

[0098] For example, the description of the storage medium can refer to the description of the memory in the embodiment of the electronic device, and the repeated parts will not be elaborated. The specific functions and technical effects of the storage medium can refer to the description of the media processing method above, and will not be elaborated here.

[0099] It should be noted that, in the context of the present disclosure, a computer-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. And in the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0100] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0101] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A media processing method, comprising: Get the media to be expanded and determine the target size; Based on the target size, displaying a canvas meeting the target size in a screen area so that the media to be expanded is displayed in the area of the canvas; Based on the user's gesture operation on the canvas, scaling and moving the media to be expanded within the constraints; determining an expansion area around the media to be expanded according to a result of scaling and moving the media to be expanded; Combined with the expansion area, a target medium that meets the target size is obtained after the medium to be expanded is expanded.

2. The method according to claim 1, wherein The acquiring of the media to be expanded includes: Display original media in the media editing interface; Editing the original media based on the user's operation on the original media through the editing interface; In response to a preset operation of the user, the media after the editing process is obtained as the media to be expanded.

3. The method according to claim 1, wherein The scaling and moving of the to-be-expanded media within the constraints based on the user's gesture operation on the canvas includes: Determining a maximum enlargement size and a minimum reduction size of the medium to be expanded; According to a user's zoom gesture operation on the media to be expanded on the canvas, within the canvas range, the media to be expanded is zoomed in and out between the maximum zoom-in size and the minimum zoom-out size; and According to the user's gesture operation on the media to be expanded on the canvas, the media to be expanded is moved within the range of the canvas.

4. The method according to claim 3, wherein: Determining the maximum enlargement size and the minimum reduction size of the medium to be expanded includes: Determining a first aspect ratio of the to-be-expanded media and a second aspect ratio of the canvas; If the first aspect ratio is smaller than the second aspect ratio, the size of the medium to be expanded when the height of the medium to be expanded is the same as the height of the canvas is determined as the maximum enlargement size, and the size that is smaller than the maximum enlargement size by a preset multiple is determined as the minimum reduction size; If the first aspect ratio is equal to the second aspect ratio, determining the size of the canvas as the maximum enlarged size, and determining a size that is smaller than the maximum enlarged size by the preset multiple as the minimum reduced size; If the first aspect ratio is greater than the second aspect ratio, the size of the medium to be expanded when the width of the medium to be expanded is the same as the width of the canvas is determined as the maximum enlargement size, and the size that is smaller than the maximum enlargement size by the preset multiple is determined as the minimum reduction size.

5. The method according to claim 1, wherein The step of determining an expansion area around the media to be expanded according to the result of scaling and moving the media to be expanded includes: According to the results of scaling and moving the medium to be expanded, a mask bitmap corresponding to the target medium is determined; the mask bitmap is used to indicate the location area of the medium to be expanded in the target medium and the expansion area around the medium to be expanded.

6. The method according to claim 5, wherein: The step of combining the expansion area to obtain target media that meets the target size after expanding the medium to be expanded includes: Uploading the media to be expanded and the mask bitmap to a server, so that the server performs expansion based on the mask bitmap and the media to be expanded to obtain target media; Receiving is the target media sent by the server.

7. The method according to claim 6, wherein: The method further includes obtaining text guidance information input by the user; The step of uploading the medium to be expanded and the mask bitmap to a server, so that the server performs expansion based on the mask bitmap and the medium to be expanded, includes: Uploading the media to be expanded and the mask bitmap, and obtaining resource locators corresponding to the media to be expanded and the mask bitmap respectively; Generate a media extension task request based on the resource locator and the text guide information; The media extension task request is sent to the server to instruct the server to perform extension processing on the image to be extended based on the media extension task request.

8. A media processing device, comprising: A first acquisition module is used to acquire the media to be expanded and determine the target size; a generating module, configured to display a canvas meeting the target size in a screen area based on the target size, so that the media to be expanded is displayed in the area of the canvas; An operation module, configured to scale and move the media to be expanded within a constraint condition based on a user's gesture operation on the canvas; a determining module, configured to determine an expansion area around the media to be expanded based on a result of scaling and moving the media to be expanded; The second acquisition module is configured to obtain target media that meets the target size after expanding the medium to be expanded, in combination with the expansion area.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.