Picture editing method, user interface and related device

By detecting user editing operations and adjusting text parameters according to image elements, the problems of complex and inefficient image text editing in the prior art are solved, and the effect of simplifying operations and improving user experience is achieved.

CN119987625APending Publication Date: 2025-05-13HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311508458.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2025-05-13

Smart Images

  • Figure CN119987625A_ABST
    Figure CN119987625A_ABST
Patent Text Reader

Abstract

The invention discloses a picture editing method, a user interface and a related device, and the method can detect the operation of modifying a text in a picture by a user, modify the text content in the picture, and set parameters of the modified text according to elements in the picture in a picture display process. The parameters may include any one or more of the following: structure, shape, texture, and color. Therefore, the text content and the text parameters can be quickly adjusted through the simple operation of modifying the text by the user, the efficiency of modifying the picture by the user is improved, the text and the picture are kept in a consistent style, a better visual effect is obtained, and the personalized adjustment requirement of the user on the text in the picture is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and in particular to a picture editing method, a user interface and related devices. Background Art

[0002] In today's Internet age, users can see a variety of pictures every day. For pictures that meet personal daily needs, such as posters or emoticons, users sometimes want to adjust the text in the pictures, including adding, deleting, replacing text content, modifying text style, etc., to meet the user's personalized needs.

[0003] In order to adjust the text in the picture, a common way is to use various tools in picture editing applications (such as Photoshop) to perform relevant operations. However, using picture editing software to adjust the text in the picture is complicated for users to operate and has a high learning cost, which is not suitable for the general public. In addition, users need to constantly adjust the text style to obtain a picture with a good visual effect, which results in a poor user experience. Summary of the invention

[0004] The present application provides a picture editing method, a user interface and related devices, which realize the modification of text content in the picture and the adjustment of text parameters based on the user's editing operations on the picture, thereby meeting the user's personalized adjustment needs for the text in the picture.

[0005] In a first aspect, an embodiment of the present application provides a picture editing method, the method comprising: an electronic device displays a first picture; the electronic device detects a first operation of modifying a first text in the first picture; the electronic device modifies the first text in the first picture into a second text; the electronic device sets parameters of the second text according to elements contained in the first picture, the parameters comprising any one or more of the following: structure, shape, texture and color.

[0006] By implementing the method provided in the first aspect, the text content in the picture can be adjusted based on the user's editing operations on the picture, and one or more parameters of the text in the picture can be adjusted, thereby facilitating the user's operation and improving the efficiency of the user in modifying the text in the picture. Only simple operations are required to meet the user's personalized needs for modifying the text in the picture.

[0007] In combination with the first aspect, in a possible implementation, the first operation is a selection operation acting on the first text; after the electronic device detects the first operation, before modifying the first text in the first picture to the second text, the method also includes: the electronic device displays a first keyboard; the electronic device detects an operation in which a user inputs the second text through the first keyboard; or, the first operation is a selection operation acting on the first picture; after the electronic device detects the first operation, before modifying the first text in the first picture to the second text, the method also includes: the electronic device displays one or more texts identified from the first picture; the electronic device detects a selection operation acting on a first text among the one or more texts; the electronic device displays the first keyboard; the electronic device detects an operation in which a user inputs the second text through the first keyboard.

[0008] It can be seen that when the user needs to modify the text, he can directly act on the text that needs to be modified in the picture and quickly modify the text.

[0009] In combination with the first aspect, in a possible implementation method, the electronic device modifies the first text in the first picture into the second text, specifically including: the electronic device recognizes the first text in the first picture, splits the first picture into the first text and a first background, and the position of the first text in the first background does not contain pixels; the electronic device repairs the first background to the second background, and the position of the first text in the second background contains pixels determined based on the content in the first picture other than the first text; the electronic device superimposes the second text on the second background.

[0010] It can be seen that when an electronic device modifies text in a picture, it can ensure that there are no traces of modification in the picture after the text is modified by splitting the text and the background and repairing the background.

[0011] In combination with the first aspect, in a possible implementation method, the parameters include a structure, and the first image contains a first element; the electronic device sets the parameters of the second text according to the element contained in the first image, specifically including: the electronic device replaces the first text in the second text with the first element, and the similarity between the first element and the first text is greater than a first threshold; or, the electronic device replaces the first stroke in the first text in the second text with the first element, and the similarity between the first element and the first stroke is greater than a second threshold.

[0012] That is to say, adjusting the text structure may refer to replacing part of the text structure with elements in the picture background, thereby obtaining a more artistic text and keeping the style of the modified text consistent with that of the picture as much as possible.

[0013] In combination with the first aspect, in a possible implementation manner, a proportion of the replaced content in the second text to the total content of the second text is less than a third threshold.

[0014] Limiting the proportion of structural modifications to the text can prevent the modified text from being too fancy and maintain the beauty of the image.

[0015] In combination with the first aspect, in a possible implementation method, the parameters include a shape, and the first image contains a second element; the electronic device sets the parameters of the second text according to the element contained in the first image, specifically including: the electronic device adjusts the shape of the second text according to the shape of the second element.

[0016] That is, adjusting the text shape may refer to adjusting the shape of the text according to the shapes of elements contained in the picture background, so that the layout of the text can echo the outline of the elements in the picture, making the placement of the text more flexible and interesting.

[0017] In combination with the first aspect, in a possible implementation manner, the electronic device adjusts the shape of the second text according to the shape of the second element, specifically including: the electronic device adjusts the typesetting path of the second text according to the first contour curve of the second element.

[0018] The electronic device can adjust the text based on the boundary curve of the element included in the picture so that the layout of the text is more closely aligned with the shape of the element.

[0019] In combination with the first aspect, in a possible implementation manner, the second element is an element contained in the first image that is closest to the first text, and the first contour curve is a contour curve of a side of the second element facing the first text.

[0020] In other words, the layout of the text can be made to fit more closely with the shapes of the elements around it, making the text and the elements around it more harmonious on the screen.

[0021] In combination with the first aspect, in a possible implementation method, the parameters include texture, and the first image contains a third element; the electronic device sets the parameters of the second text according to the element contained in the first image, specifically including: the electronic device adds the first texture of the third element to the second text.

[0022] That is, adjusting the text texture may refer to adding the texture contained in the picture background to the text, so that the text can echo the pattern in the picture background.

[0023] In combination with the first aspect, in a possible implementation manner, the third element is an element in the first image whose distance from the first text is greater than a fourth threshold.

[0024] In this way, it is possible to prevent the electronic device from adding textures that are close to the text to the text, making it difficult to distinguish the text from surrounding elements.

[0025] In combination with the first aspect, in a possible implementation method, the parameters include color, and the first picture contains a fourth element; the electronic device sets the parameters of the second text according to the element contained in the first picture, specifically including: the electronic device sets the color of the second text to the color of the fourth element.

[0026] That is, adjusting the text color may refer to adjusting the text color to the color contained in the picture background, so that the text color can echo the color contained in the picture background.

[0027] In combination with the first aspect, in a possible implementation manner, the fourth element is an element in the first image that is farthest from the first text.

[0028] In this way, it can be avoided that the second text has the same color as the surrounding content, so that the text cannot be well distinguished from the surrounding content.

[0029] In combination with the first aspect, in a possible implementation method, the electronic device sets the parameters of the second text according to the elements contained in the first picture, specifically including: the electronic device sets the first parameter of the second text according to the elements contained in the first picture, and the first parameter is a parameter selected according to the priority of structure, shape, texture, and color.

[0030] That is to say, the electronic device can select the text parameters that need to be modified according to the priority, thereby reducing the trouble of the user in selecting parameters and providing the user with a more intelligent image adjustment service.

[0031] In combination with the first aspect, in a possible implementation method, in descending order of priority: structure>texture>color>shape; the electronic device sets the first parameter of the second text, specifically including: the electronic device first sets the structure of the first text; if the structure setting of the second text fails, the electronic device sets the texture of the second text; if the texture setting of the second text fails, the electronic device sets the color of the second text; if the color setting of the second text fails, the electronic device sets the shape of the second text.

[0032] In combination with the first aspect, in a possible implementation manner, before the electronic device sets parameters of the second text according to elements included in the first picture, the method further includes: the electronic device detects a second operation of setting parameters of the second text.

[0033] That is to say, after modifying the content of the text, the user can decide whether to modify the parameters of the text, thereby improving the operability of the user when editing pictures.

[0034] In combination with the first aspect, in one possible implementation, if the font of the first text is a font contained in the electronic device, the font of the second text is the font of the first text; if the font of the first text is not a font contained in the electronic device, the font of the second text is any one of the following fonts: a preset first font, a font selected by the user, a font most frequently used by the user, or a font contained in the electronic device that is most similar to the font of the first text.

[0035] That is to say, after modifying the text content, the electronic device can also adjust the font of the text, and can determine the font of the text based on whether the font is a font contained in the electronic device, thereby avoiding the trouble caused by infringement issues as much as possible.

[0036] In combination with the first aspect, in a possible implementation manner, the electronic device displays the first picture, specifically including: the electronic device displays the first picture through a gallery application.

[0037] In other words, the image editing method can be applied in a gallery application, so that users can quickly adjust the text in the image through this method while browsing images through the gallery application. While users are browsing images, the method can also meet users' needs for personalized modification of image text. Moreover, the adjusted text can maintain the same style as the image, making the picture more harmonious and beautiful. Users only need simple operations to adjust various parameters of the text in the image, thereby improving the user's efficiency in adjusting images.

[0038] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the method described in the first aspect or any one of the implementation methods in the first aspect.

[0039] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method as described in the first aspect or any one of the implementations of the first aspect.

[0040] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the method described in the first aspect or any one of the implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1A-1E , Figure 2A-2D , Figure 3A-3C , Figure 4A-4B , Figure 5A-5C , Figure 6A-6C , Figure 7Provide some user interfaces for embodiments of the present application;

[0042] Figure 8 A schematic diagram of a process flow of a picture editing method provided in an embodiment of the present application;

[0043] Fig. 9 A schematic diagram of a principle for modifying text content in a picture provided by an embodiment of the present application;

[0044] Fig.10 A schematic diagram of the principle of the structure of setting text provided in an embodiment of the present application;

[0045] Fig.11 A schematic diagram of the principle of setting the text shape provided in an embodiment of the present application;

[0046] Fig.12 A schematic diagram of the principle of setting text texture provided in an embodiment of the present application;

[0047] Fig.13 A schematic diagram of the principle of setting text color provided in an embodiment of the present application;

[0048] Fig.14 A schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application;

[0049] Fig.15 A software structure block diagram of the electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0051] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0052] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0053] An embodiment of the present application provides a picture editing method, which can detect a user's operation of modifying text in a picture during the display of the picture, modify the text content in the picture, and set parameters of the modified text according to elements in the picture. The parameters may include any one or more of the following: structure, shape, texture, and color.

[0054] When adjusting text content, the position of the adjusted text content can be as close as possible to the position of the text content before the adjustment, so as to minimize the layout change of the text in the picture after the text content is changed.

[0055] Adjusting the text structure may refer to replacing part of the text structure with elements in the image background, thereby obtaining a more artistic text and keeping the style of the modified text consistent with that of the image as much as possible.

[0056] Adjusting the text texture may refer to adding the texture contained in the picture background to the text, so that the text can echo the pattern in the picture background.

[0057] Adjusting the text color may refer to adjusting the text color to the color contained in the picture background, so that the text color can echo the color contained in the picture background.

[0058] Adjusting the text shape may refer to adjusting the shape of the text according to the shapes of elements contained in the picture background, so that the layout of the text can echo the outline of the elements in the picture, making the placement of the text more flexible and interesting.

[0059] For details about adjusting the text in the image, please refer to the subsequent description of the user interface, which will not be repeated here.

[0060] In general, the picture editing operation provided in the embodiment of the present application can adjust the text content in the picture based on the user's editing operation on the picture, and realize the adjustment of one or more parameters of the text in the picture, which facilitates the user's operation and improves the efficiency of the user in modifying the text in the picture. Only simple operations are required to meet the user's personalized needs for modifying the text in the picture, and the modified text can maintain the same style as the picture to obtain better visual effects, avoiding the trouble of users manually debugging text parameters.

[0061] The following describes the application scenarios of the image editing method provided by the embodiment of the present application:

[0062] 1) Application in gallery application

[0063] Applying this image editing method in a gallery application can enable users to quickly adjust the text in the image through this method while browsing images through the gallery application. While users are browsing images, the method can also meet users' personalized modification needs for image text. Moreover, the adjusted text can maintain a consistent style with the image, making the picture more harmonious and beautiful. Users only need simple operations to adjust various parameters of the text in the image, thereby improving the user's efficiency in adjusting images.

[0064] 2) Use in third-party image editing applications

[0065] Although third-party image editing applications usually include powerful image editing functions that can meet users' various image editing needs, the user's operation is relatively complicated, and users often need to constantly debug various parameters of the text to obtain the most satisfactory visual effect. However, the image editing method provided by the embodiment of the present application can adjust various parameters of the text according to the elements in the picture, quickly adjust the text style, and the adjusted text can maintain the same style as the picture, making the picture more harmonious and beautiful, while meeting the user's personalized adjustment needs for the text, and improving the user's adjustment efficiency for the picture.

[0066] It is understandable that the picture editing method provided in the embodiment of the present application may also have other application scenarios, and the embodiment of the present application does not limit this.

[0067] The following takes the application scenario of the image editing method in a gallery application as an example to describe the relevant user interfaces involved in the image editing method.

[0068] Figure 1A-1E , Figure 2A-2C A related user interface involved in modifying text content in a picture for the electronic device 100.

[0069] Figure 1AAn exemplary user interface 21 for an application menu on the electronic device 100 is exemplarily shown.

[0070] like Figure 1A As shown, the user interface 21 may include: a status bar 211, a calendar and weather indicator 212, and one or more application icons 213. Among them:

[0071] Status bar 211 may include one or more signal strength indicators of mobile communication signals, one or more signal strength indicators of wireless fidelity (Wi-Fi) signals, a battery status indicator, and a time indicator. Calendar and weather indicator 212 may be used to indicate the current time and weather type. One or more application icons 213 may be used to display icons of one or more applications. For example, see Figure 1A , one or more application icons 213 may include: a gallery icon 213A. The gallery icon 213A is an icon of a gallery application, which is an application for managing pictures and videos on electronic devices such as smartphones and tablets, and can also be called an "album". The present embodiment of the application does not limit the name of the gallery application.

[0072] like Figure 1A As shown, the electronic device 100 can detect a user operation on the gallery icon 213A, such as a click operation. In response to the operation, the electronic device 100 can open the gallery application and display Figure 1B The user interface 31 shown may be a photo display interface provided by a gallery application, and the photo display interface may be used to display thumbnails corresponding to one or more pictures and videos taken or saved by a user.

[0073] like Figure 1B As shown, the user interface 31 may include: a picture thumbnail 311. The picture thumbnail 311 may be a thumbnail corresponding to a picture taken or saved by the user.

[0074] When the electronic device 100 detects a user operation on the picture thumbnail 311, for example, a click operation, in response to the operation, the electronic device 100 may display a browsing interface of the picture (hereinafter referred to as picture 1) corresponding to the picture thumbnail 311, that is, Figure 1C User interface 41 is shown.

[0075] like Figure 1C As shown, the user interface 41 may include: a picture browsing area 411 and a menu bar 412. The picture browsing area 411 may be used to display picture 1, and the menu bar 412 may be used to display one or more functions provided by the gallery application, including sharing, collecting, editing, deleting pictures and other functions.

[0076] It can be seen from the picture 1 displayed in the picture browsing area 411 that the picture 1 displays the texts "Good morning!" and "Hi~". Figure 1C As shown, when the electronic device 100 detects a user operation on the area where the text "Good morning!" in the picture 1 is located, such as a click operation, in response to the operation, the electronic device 100 can update the current user interface 41 to Figure 1D User interface 41 is shown.

[0077] contrast Figure 1C , Figure 1D The user interface 41 shown in the figure has a newly displayed keyboard 413, and a newly displayed cursor 414 is added at the position where the user clicks on the text, for example, Figure 1D A cursor 414 is newly displayed between the characters "g" and "!", prompting the user to modify the text of the picture 1 at the cursor. Specifically, the electronic device 100 can detect the user's click operation on each key in the keyboard 413, input a new character at the cursor 414, or delete the character on the left side of the cursor 414.

[0078] In some embodiments, when the electronic device 100 detects that the user acts on Figure 1C In the picture browsing area 411 shown, the electronic device 100 can search for the text closest to the position in the picture 1, that is, "Good morning!", according to the position of the user in the picture browsing area 411, extract the found text from the picture 1, and repair the background of the picture 1 except the text, and convert it into a complete background without the extracted text, so that the modified text can be superimposed on the complete background. Figure 1D The keyboard 413 shown modifies the text extracted from Picture 1, including deleting text in the text, adding text to the text, etc., and superimposes the modified text on the complete background to obtain a new picture, such as Picture 2.

[0079] For example, if the electronic device 100 modifies "Good morning!" to "Good day!", the modified picture 2 may be displayed as Figure 1E The pictures displayed in the picture browsing area 411 are shown.

[0080] For example, when the electronic device 100 modifies "Good morning!" into "Good day!", the selection of the font of the modified text may be in the following situations:

[0081] 1) Use the font of the text before modification directly

[0082] Specifically, when the electronic device 100 modifies "Good morning!" into "Good day!", the electronic device 100 can identify the font used by the text before the modification, so that the modified text retains the same font as the text before the modification.

[0083] 2) First determine whether the font of the text before modification is the font included in the electronic device 100, and then determine whether to use the font in the modified text

[0084] Specifically, if the font of the text before modification is a font included in the electronic device 100, the font can be directly used; if the font of the text before modification is not a font included in the electronic device 100, the electronic device 100 can use the user's preferred font and / or a font included in the system that is similar to the font of the text before modification. The user's preferred font may refer to a font that the user prefers, which may be preset in the electronic device 100 in advance, or selected by the user when the electronic device 100 modifies the text in the picture.

[0085] Among them, using a font contained in the system that is similar to the font of the text before modification can make the modified text maintain the greatest style similarity with the text before modification. Using the user preferred font can set the font of the text according to the user's preference. At the same time, by determining whether the font is the font contained in the electronic device 100, the trouble caused by infringement issues can be avoided as much as possible.

[0086] In some embodiments, if the font of the text before modification is not a font included in the electronic device 100, the electronic device 100 may further search for a user preferred font. If a user preferred font exists, the user preferred font is used. If a user preferred font does not exist, the system is further searched for a font similar to the font of the text before modification, and the similar font is used as the font of the modified text.

[0087] Furthermore, if the electronic device 100 uses a similar font as the font of the modified text, the electronic device 100 may further save the similar font as the user preferred font.

[0088] It is understandable that the electronic device 100 can also set the font of the modified text in other ways, for example, the font of the modified text is a font selected by the user, a preset font, the font most frequently used by the user, etc. The font selection method in the embodiment of the present application is not limited.

[0089] from Figure 1A-1EIt can be seen that the electronic device 100 can extract the text in the picture and modify the text in the picture based on the user's operation of modifying the text content while the user is browsing the picture, and at the same time repair the background outside the picture to a complete background that does not contain the text, so that the modified text can be superimposed on the repaired background to obtain a picture without any traces of modification.

[0090] In addition, in one embodiment, the electronic device 100 can Figure 1C-Figure 1D In addition to the method of clicking the text in the picture to trigger the modification of the text in the picture, the electronic device 100 can also Figure 2A-2D The method shown triggers the modification of the text in the picture.

[0091] like Figure 2A As shown, if the electronic device 100 detects a user operation on the image browsing area 411, such as a click operation, in response to the operation, the electronic device 100 can recognize all the text contained in the image 1 and add a new display below the image browsing area 411 in the user interface 41. Figure 2B The text display box 415 is used to display all texts recognized by the electronic device 100 from the picture 1, including: "Good morning!", "Hi~". Furthermore, the electronic device 100 can also detect the selection operation on the text displayed in the text display box 415 and modify the text selected by the user.

[0092] like Figure 2B As shown, when the electronic device 100 detects the user's selection operation on the text display box 415, in response to the operation, the electronic device 100 can update the current user interface 41 to Figure 2C User interface 41 is shown.

[0093] contrast Figure 2B , Figure 2C The user interface 41 shown has a newly displayed keyboard 413, which is located below the text display box 415. At the same time, a cursor 415A is inserted in the text display box 415. Specifically, the electronic device 100 can detect the user's click operation on each key in the keyboard 413, input a new character at the cursor 415A, or delete the character on the left of the cursor 415A.

[0094] For example, if the electronic device 100 modifies "Good morning!" to "Good day!", the electronic device 100 may display the following: Figure 2DIn the user interface 41 shown in FIG. 4 , “Good morning!” in the text display box 415 is changed to “Good day!”. Afterwards, if the electronic device 100 detects a user operation on the confirmation icon 415B, such as a click operation, the electronic device 100 applies the text change to the picture 1 and displays the changed picture, such as displaying Figure 1E User interface 41 is shown.

[0095] That is to say, when the user is browsing a picture, the electronic device 100 can identify the text contained in the picture after detecting the user's operation on the picture. After the electronic device 100 further detects the user's editing operation on the selected text, it can modify the text selected by the user in the picture to the text edited by the user.

[0096] Figure 3A-3C A related user interface involved in adjusting the text structure in a picture for the electronic device 100.

[0097] Figure 3A The user interface 41 shown is a browsing interface for a picture (hereinafter referred to as picture 2) provided by the gallery application. For a detailed description of the browsing interface, please refer to the aforementioned Figure 1C The relevant content in will not be repeated here.

[0098] like Figure 3A As shown, when the electronic device 100 detects that the user performs an editing operation on the text "Good day!" in picture 2, such as a long press operation, in response to the operation, the electronic device 100 may display the following Figure 3B The option box 416 shown in the figure can be used to adjust the parameters of the currently edited text "Good day!". The option box 416 may include one or more options for adjusting the parameters of the text. The parameters may include: structure, texture, color, shape, size, shadow, etc.

[0099] In some embodiments, Figure 3B The illustrated option box 416 may be displayed adjacent to the text "Good day!", for example. Figure 3B As shown, option box 416 is displayed below the text "Good day!".

[0100] It is understandable that, in addition to performing editing operations on the text in the picture, the electronic device 100 can also trigger adjustments to the text structure in the picture in other ways.

[0101] For example, the electronic device 100 may detect an editing operation performed by a user on any area in the picture 2, such as a long press operation, a click operation, etc., and display a screen similar to Figure 3B Option box 416 is shown, and the option box 416 can be used to adjust the parameters of all texts in picture 2. Alternatively, electronic device 100 can further detect the user's selection operation on the text in picture 2, so that the option box 416 can be used to adjust the parameters of the text selected by the user. Alternatively, Figure 3B The option box 416 shown can be always displayed in the image browsing interface, for example, displayed in Figure 3A In the menu bar 412 shown in the figure, when the user browses the picture through the picture browsing interface, the parameters of the text in the picture can be adjusted directly through the options in the menu bar 412. Figure 3B The interactive manner of the illustrated option box 416 is not limiting.

[0102] like Figure 3B As shown, option box 416 may include: option 416A, option 416B, option 416C, and option 416D. Option 416A may be used to adjust text structure, option 416B may be used to adjust text shape, option 416C may be used to adjust text texture, and option 416D may be used to adjust text color.

[0103] like Figure 3B As shown, when the electronic device 100 detects a user operation on option 416A, such as a click operation, in response to the operation, the electronic device 100 can adjust the form of the text "Goodday!" in picture 2 according to the elements included in picture 2. Figure 3B The text "Good day!" is replaced by Figure 3C Word Art 417A is shown.

[0104] For example, the electronic device 100 may utilize Figure 3B Element 1 shown in the figure replaces the first "o" in the text "Good day!", thus obtaining Figure 3C Word Art 417A is shown.

[0105] In one implementation, after detecting a user operation on option 416A, the electronic device 100 can collect various elements in picture 2, which may refer to graphics contained in the picture other than text, and then calculate the similarity between each element and the overall or local structure of each word in the currently edited text to find the element that is most similar to the structure in the text, and then replace the structure in the text with the element that is most similar to it, thereby obtaining a reconstructed text with artistic effect.

[0106] For the specific adjustment principle of the text format, please refer to the subsequent content, which will not be elaborated here.

[0107] from Figure 3A-3C It can be seen that when the user is browsing pictures, the electronic device 100 can detect the user's adjustment operation on the text structure in the picture, and use the elements contained in the picture to replace part of the structure in the text, so that the text in the picture has more artistic effect and maintains the same style as the picture.

[0108] Figure 4A-4B A related user interface involved in adjusting the shape of text in a picture for the electronic device 100.

[0109] Figure 4A The user interface is displayed by the electronic device 100 after detecting that the user has performed an editing operation on the text "Good day!" in the picture 2. For a detailed description of the user interface, please refer to the aforementioned Figure 3A-3B The relevant content will not be repeated here.

[0110] like Figure 4A As shown, when the electronic device 100 detects a user operation on option 416B, such as a click operation, in response to the operation, the electronic device 100 may adjust the shape of the text “Good day!” according to the shapes of the elements included in picture 2.

[0111] In one implementation, the electronic device 100 may search for an element contained in the picture 2 that is closest to the text “Good day!”, that is, Figure 4A The element 2 shown in the figure determines the side of the element 2 close to the text "Good day!", that is, the top of the element 2, and moves the shape of the text "Good day!" close to the shape of the top of the element 2, so that the shape of the text "Good day!" is transformed into an arch shape, which corresponds to the curvature of the top contour of the element 2, and the result is Figure 4B Text 417B shown.

[0112] It can be understood that the electronic device 100 can adjust the layout of the text of the picture according to the shape of one or more elements contained in the picture, and the embodiment of the present application does not limit the number of such elements. In addition, the electronic device 100 can adjust the layout of the text according to the element in the picture that is closest to the text edited by the user, and can also adjust the layout of the text according to the element in the picture that is farthest from the text edited by the user. The embodiment of the present application does not limit the elements selected by the electronic device 100.

[0113] from Figure 4A-4B It can be seen that when the user is browsing pictures, the electronic device 100 can detect the user's adjustment operation on the shape of the text in the picture, and use the shape of the elements contained in the picture to adjust the shape of the text in the picture, so that the placement of the text is more flexible and interesting, and more in line with the style of the picture.

[0114] Figure 5A-5C A related user interface involved in adjusting the text texture in a picture for the electronic device 100.

[0115] Figure 5A The user interface is displayed by the electronic device 100 after detecting that the user has performed an editing operation on the text "Good day!" in the picture 2. For a detailed description of the user interface, please refer to the aforementioned Figure 3A-3B The relevant content will not be repeated here.

[0116] like Figure 5A As shown, when the electronic device 100 detects a user operation on option 416C, such as a click operation, in response to the operation, the electronic device 100 can search for the texture included in the picture 2, thereby adding a display such as Figure 5B The texture display box 418 shown contains one or more textures found from the picture 2.

[0117] Among them, texture can be considered as a relatively fine pattern. It is a visual feature that reflects the homogeneous phenomenon in the image and reflects the surface structure organization and arrangement properties of the object surface with slow or periodic changes. In addition, texture has three major characteristics: a certain local sequence is repeated continuously, non-random arrangement, and the texture area is roughly uniform.

[0118] Exemplarily, a neural network model may be used to extract a local binary pattern (LBP) feature vector in a picture to obtain the texture in the picture.

[0119] like Figure 5B As shown, the texture display box 418 may include: a texture option 418A, and the texture option 418A corresponds to a texture found by the electronic device 100 from the picture 2. When the electronic device 100 detects a user operation on the texture option 418A, such as a click operation, in response to the operation, the electronic device 100 may add the texture corresponding to the texture option 418A to the text "Good day!", thereby obtaining the following image: Figure 5C Text 417C shown.

[0120] For example, in Figure 5B In the example, when the electronic device 100 displays the texture found in the image 2 in the texture display box 418, the text "Good day!" currently edited by the user may be in a selected state, for example, compared to Figure 5A , Figure 5BThe text "Good day!" shown has a background texture added. The selected text is used to prompt the user that the texture selected will be added to the currently selected text. Further, after the texture is added, the text edited by the user will exit the selected state.

[0121] In some embodiments, the texture displayed in the texture display box 418 may be a texture that is far away from the currently edited text, that is, the texture display box 418 may not include a texture that is close to the currently edited text. In this way, it is possible to prevent the user from adding the texture around the text to the text, making the text indistinguishable from the surrounding patterns.

[0122] from Figure 5A-5C It can be seen that when the user is browsing pictures, the electronic device 100 can detect the user's adjustment operation on the text texture in the picture, and add the texture contained in the picture to the text in the picture, so that the style of the text is more consistent with the style of the picture.

[0123] Figure 6A-6C A related user interface involved in adjusting the text color in a picture for the electronic device 100.

[0124] Fig. 6A The user interface is displayed by the electronic device 100 after detecting that the user has performed an editing operation on the text "Good day!" in the picture 2. For a detailed description of the user interface, please refer to the aforementioned Figure 3A-3B The relevant content will not be repeated here.

[0125] like Fig. 6A As shown, when the electronic device 100 detects a user operation on option 416D, such as a click operation, in response to the operation, the electronic device 100 can search for the color included in the picture 2, thereby adding a display such as Figure 6B The color display box 419 shown displays one or more colors found in the picture 2.

[0126] like Figure 6B As shown, the color display box 419 may include: color option 419A, and the color option 419A corresponds to a color found by the electronic device 100 from the picture 2. When the electronic device 100 detects a user operation on the color option 419A, such as a click operation, in response to the operation, the electronic device 100 may replace the color of the text "Good day!" with the color corresponding to the color option 419A, thereby obtaining the following Figure 6C Text 417D shown.

[0127] For example, in Figure 6BIn the example, when the electronic device 100 displays the color found from the picture 2 in the color display box 419, the text "Good day!" currently edited by the user may be in a selected state, for example, compared to Fig. 6A , Figure 6B The text "Good day!" shown has a background texture added. The selected text is used to prompt the user that the texture selected will be added to the currently selected text. Further, after the texture is added, the text edited by the user will exit the selected state.

[0128] In some embodiments, in addition to displaying one or more colors found in the image 2, the color display box 419 may also display the color value of the color, such as the RGB value, so that the user who selects the color can understand the difference between different colors more clearly.

[0129] In some embodiments, the color displayed in the color display box 419 may be a color that is far away from the currently edited text, that is, the color display box 419 may not include a color that is close to the currently edited text. In this way, it can be avoided that the user uses the color around the text to adjust the color of the text, so that the text cannot be distinguished from the surrounding colors. Alternatively, the color displayed in the color display box 419 may not include a color that is close to the color of the currently edited text. In this way, it can be avoided that the color after the user adjusts is not much different from the color before the adjustment.

[0130] from Figure 6A-6C It can be seen that when the user is browsing pictures, the electronic device 100 can detect the user's adjustment operation on the text color in the picture, and use other colors contained in the picture to adjust the color of the text in the picture, so that the color of the text is more closely matched to the color of the picture, avoiding the color of the text being too abrupt.

[0131] It is understandable that although the above Figure 1A-1E , Figure 3A-3C , Figure 4A-4B , Figure 5A-5C , Figure 6A-6C Different adjustment processes of the electronic device 100 on the text content, text structure, text shape, text texture, and text color in the picture are shown separately. However, the electronic device 100 can simultaneously superimpose the above-mentioned multiple modifications on the text of the picture, for example, modifying the structure of the text while modifying the text content, or modifying the shape of the text while modifying the text structure, and so on.

[0132] For example, the above Figure 1A-1E , Figure 3A-3C , Figure 4A-4B , Figure 5A-5C , Figure 6A-6CTaking the adjustment of the text as an example, after the electronic device 100 simultaneously superimposes the adjustment of the content, structure, shape, texture, and color of the text on the above-mentioned picture 1, the adjusted picture (hereinafter referred to as picture 3) can be Figure 7 The pictures displayed in the picture browsing area 411 shown in the figure, the adjusted text may refer to Figure 7 Text 417E shown.

[0133] In some implementations, the electronic device 100 can detect the user's operation of adjusting multiple modification items in the content, structure, shape, texture, and color of the text in sequence, thereby adjusting multiple parameters in the text. In this way, the user can choose the modification method for the text by himself and quickly obtain a satisfactory modification effect.

[0134] In other embodiments, the electronic device 100 can detect the user's adjustment operations on the text, and adjust any one or more modification items of the text, thereby achieving the user's purpose of adjusting the text with "one click", facilitating the user's operation, and quickly obtaining text that meets personalized needs.

[0135] In other embodiments, the electronic device 100 can detect the user's operation of adjusting the text content, and adjust any one or more of the text's structure, shape, texture, color, and other parameters while adjusting the text content. In this way, while the user adjusts the text content in the picture, the electronic device 100 can automatically adjust the style of the text so that the modified text is consistent with the style of the picture, while reducing the user's operations.

[0136] For example, the electronic device 100 Figure 1A-Figure 1D When the text "Good morning!" in picture 1 is changed to the text "Good day!", the electronic device 100 can simultaneously adjust the form, layout, texture, and color of the text "Good day!" so that the electronic device 100 finally displays Figure 7 Alternatively, the electronic device 100 can browse pictures in the picture browsing area 411. Figure 1A-1B , Figures 2A-2D When the text "Good morning!" in picture 1 is modified to the text "Good day!", the electronic device 100 can simultaneously adjust the form, layout, texture, and color of the text "Good day!" so that when the electronic device 100 detects Figure 2D After the confirmation icon 415B is displayed, the electronic device 100 may display Figure 7 User interface 41 is shown.

[0137] It is understandable that the above Figure 1A-1E , Figure 2A-2D , Figure 3A-3C , Figure 4A-4B , Figure 5A-5C , Figure 6A-6C , Figure 7 The exemplary user interface provided for the embodiments of the present application does not constitute a limitation on the embodiments of the present application.

[0138] Figure 8 A flowchart of a method for editing pictures provided in an embodiment of the present application.

[0139] like Figure 8 As shown, the picture editing method may include:

[0140] S101. The electronic device 100 displays a first picture.

[0141] The electronic device 100 can display the first picture through a gallery application. In this way, the user can adjust the text in the picture while browsing the picture through the gallery application.

[0142] Exemplarily, the first picture may refer to Figure 1C Picture 1 is displayed in the picture browsing area 411 shown.

[0143] S102. The electronic device 100 detects a first operation of modifying a first text in a first picture.

[0144] Exemplarily, the modification may include modifying the content of the first text, or, further, the modification may also include setting parameters of the modified text, and the parameters may include any one or more of the following: structure, shape, texture and color.

[0145] The first operation may refer to a touch operation such as a click operation, a long press operation, or a voice command, etc. When the first operation is a touch operation, illustratively, the first operation may refer to an operation acting on any area in the first image, or may refer to an operation acting on text to be adjusted in the image, such as the first text.

[0146] The embodiment of the present application does not limit the operation form, operation position, etc. of the first operation.

[0147] In some embodiments, the first operation may refer to a selection operation acting on the first text. After the electronic device 100 detects the first operation, the electronic device 100 may display a first keyboard. The electronic device 100 may detect the user inputting the modified text (for example, the second text) through the first keyboard, thereby modifying the first text, i.e., triggering the execution of step S103.

[0148] Exemplarily, the first operation may refer to Figure 1CThe user actions shown act on the text "Good morning!".

[0149] In this way, the user can quickly modify the text content by selecting the text that needs to be modified in the picture, thereby improving the convenience of modifying the text in the picture.

[0150] In other embodiments, the first operation may refer to a selection operation acting on a picture. After the electronic device 100 detects the first operation, the electronic device 100 may display one or more texts recognized from the first picture. After the electronic device 100 detects the selection operation acting on the first text among the one or more texts, the electronic device 100 may display a first keyboard. Thereafter, the electronic device 100 may detect the operation of the user inputting the modified text (for example, the second text) through the first keyboard, thereby modifying the first text, i.e., triggering the execution of step S103.

[0151] In this way, the user can quickly obtain all the text contained in the picture by selecting the picture, so that the user can select the text to be modified and realize the modification of the text content.

[0152] Exemplarily, the first operation may refer to Figure 2A The user operation shown acts on the picture 1 displayed in the picture browsing area 411.

[0153] S103. The electronic device 100 modifies the first text in the first picture into the second text.

[0154] Exemplarily, the first text may refer to Figure 1C The text shown is "Good morning!", the second text may refer to Figure 1E The text shown is "Goodday!".

[0155] in, Fig. 9 A schematic diagram of the principle of modifying the text content in a picture provided by an embodiment of the present application. Fig. 9 , the electronic device 100 may modify the first text in the first picture into the second text by the following steps:

[0156] Step 1: Identify a first text in a first image, and split the first image into the first text and a first background, wherein the first background does not contain any pixel at a location where the first text is located.

[0157] For example, the first text in the first image can be identified by using a neural network-based connectionist temporal classification (CTC) technology, an optical character recognition (OCR) technology, or an artificial intelligence (AI) technology. The present application embodiment does not limit the technology used to identify the first text.

[0158] The first picture may be split into the first text and the first background according to the contour area of ​​the first text.

[0159] Step 2: Repair the first background to a second background, wherein the position of the first text in the second background includes pixel points determined based on the content in the first image other than the first text.

[0160] Exemplarily, the first background can be restored to the second background through an adversarial neural network model.

[0161] from Fig. 9 It can be seen that the repaired second background is a complete picture. When the modified text is superimposed on the picture, no trace of the text before the modification can be seen.

[0162] Step 3: Overlay the second text on the second background.

[0163] Exemplarily, the electronic device 100 may determine the position of the second text superimposed on the second background according to the position of the first text on the first picture. For example, the starting position of the second text on the second background may be the starting position of the first text on the first picture. For another example, the end position of the second text on the second background may be the end position of the first text on the first picture. For another example, the midpoint position of the second text on the second background may be the midpoint position of the first text on the first picture.

[0164] It can be seen that by superimposing the second text on the second background, the first text on the first image can be replaced by the second text.

[0165] It is understandable that the electronic device 100 may also replace the first text on the first picture with the second text in other ways, and the embodiment of the present application is not limited to this.

[0166] In addition, the font of the second text may be selected in the following situations:

[0167] 1) Use the font of the first text directly

[0168] 2) First determine whether the font of the first text is a font included in the electronic device 100, and then determine whether to use the font for the second text

[0169] If the font of the first text is a font included in the electronic device 100, the font of the first text can be used. If the font of the first text is not a font included in the electronic device 100, a user preferred font can be further searched and used. If there is no user preferred font, a font included in the electronic device 100 that is most similar to the font of the first text can be searched and used.

[0170] For details about the font selection of the second text, please refer to the above Figure 1D The relevant description in will not be repeated here.

[0171] S104. The electronic device 100 sets parameters of the second text according to elements included in the first picture, where the parameters include any one or more of the following: structure, shape, texture and color.

[0172] For different parameters, the electronic device 100 may set the parameters of the second text in the following situations:

[0173] 1) The parameters set include the structure

[0174] Setting the structure of the second text refers to using elements contained in the first picture to replace the words or strokes in the words in the second text, so that the adjusted second text has a more artistic effect.

[0175] in, Fig.10 A schematic diagram of the structure of setting text provided in the embodiment of the present application. Fig.10 , the electronic device 100 may include the following steps to set the structure of the second text:

[0176] Step 1: Get a set of elements from the first image.

[0177] The first picture may be composed of one or more texts, one or more elements and a background. The electronic device 100 may identify all elements included in the first picture by OCR technology and generate an element set. The element set includes one or more elements identified from the first picture.

[0178] For example, see Fig.10 , the element set identified from the image may include element 1-element 4.

[0179] Step 2: Separate the text stroke set from the second text.

[0180] The character stroke set may include all characters or words in the second text and the strokes separated from these characters and words.

[0181] For example, strokes can be segmented from words and characters through an adversarial network model.

[0182] Step 3: Find element-character stroke pairs with high similarity from the element set and the character stroke set.

[0183] Among them, the feature vectors of elements and character strokes can be extracted, and the feature vectors can be used to determine the similarity between elements in the element set and character strokes in the character stroke set, so as to find element-character stroke pairs with high similarity.

[0184] For example, feature vectors of elements and character strokes can be extracted by feature detection (Oriented FAST and Rotated BRIEF, ORB) algorithm, and the similarity between elements and character strokes can be calculated by Hamming distance. In addition, a highly similar element-character stroke pair can refer to a similarity between an element and a character or stroke greater than a threshold value (e.g., 90%).

[0185] Step 4: Replace the character strokes in the second text with the elements in the element-character stroke pair.

[0186] See also Fig.10 If element 1 in the element set and the letter “o” in the character stroke set form an element-character stroke pair, the electronic device 100 can replace the first “o” in “Goodday!” with element 1.

[0187] It is understandable that if the electronic device 100 finds multiple pairs of element-text stroke pairs, the electronic device 100 can replace one or more text or strokes in the second text. Exemplarily, the proportion of the replaced content (including text and strokes) in the second text to the total content of the second text can be less than a third threshold value (e.g., 10%). In this way, it can be avoided that the electronic device 100 replaces too much content in the second text, resulting in the replaced text being too fancy and affecting the visual effect of the text.

[0188] Exemplarily, taking the first element contained in the first picture as an example, the electronic device 100 may replace the first character in the second text with the first element, and the similarity between the first element and the first character is greater than the first threshold, or the electronic device 100 may replace the first stroke in the first character in the second text with the first element, and the similarity between the first element and the first stroke is greater than the second threshold.

[0189] 2) The parameters to be set include shape

[0190] Setting the shape of the second text may refer to adjusting the shape of the second text according to the shape of an element included in the first picture.

[0191] Exemplarily, taking the second element included in the first picture as an example, the electronic device 100 may adjust the layout path of the second text according to the contour curve of the element.

[0192] In some implementations, the second element may refer to an element contained in the first image that is closest to the first text, and the first contour curve is a contour curve of a side of the second element that faces the first text.

[0193] Fig.11 A schematic diagram of the principle of setting the text shape provided in an embodiment of the present application.

[0194] in, Fig.11 for Figure 4A-4B The schematic diagram of the principle of adjusting the shape of the text "Good day!" in picture 2 is shown. Fig.11 It can be seen that the contour curve 1 extracted by the electronic device 100 from the element 2 is an upwardly curved curve. After the shape of the text "Good day!" is adjusted by the contour curve 1, "Good day!" is presented in a layout with high letters in the middle and low letters at both ends.

[0195] 3) The parameters set include texture

[0196] Setting the texture of the second text may refer to adding the texture of the element included in the first picture to the second text.

[0197] Exemplarily, taking the third element included in the first picture as an example, the electronic device 100 may add the texture of the third element to the second text.

[0198] Fig.12 A schematic diagram of the principle of setting text texture provided in an embodiment of the present application.

[0199] in, Fig.12 for Figure 5A-5C The schematic diagram of the principle of adjusting the texture of the text "Goodday!" in Figure 2 is shown. Fig.12 It can be seen that the electronic device 100 extracts the texture from the element 2 and obtains the texture by adding the texture to the text "Goodday!" Figure 5C Text 417C shown.

[0200] In some embodiments, the third element may refer to an element in the first image whose distance from the first text is greater than a fourth threshold. In this way, the electronic device 100 may be prevented from adding a texture close to the text to the text, so that the text cannot be well distinguished from surrounding elements.

[0201] It is understandable that the fourth element may also be the element in the first image that is farthest from the first text, and the embodiment of the present application does not limit this distance.

[0202] 4) The parameters to be set include color

[0203] Setting the color of the second text may refer to setting the color of the second text to the color of an element included in the first picture.

[0204] Exemplarily, taking the fourth element included in the first picture as an example, the electronic device 100 may set the color of the second text to the color of the fourth element.

[0205] Fig.13 A schematic diagram of the principle of setting text color provided in an embodiment of the present application.

[0206] in, Fig.13 for Figure 6A-6C The schematic diagram of the principle of adjusting the color of the text "Goodday!" in Picture 2 is shown. Fig.13 It can be seen that the electronic device 100 can extract multiple different colors from each element in the picture 2, including: color 1-color 4, and then select one of the colors, for example, color 2 acts on the color of the text "Goodday!", so as to obtain Figure 6C Text 417D shown.

[0207] In some embodiments, the fourth element may be the element in the first image that is farthest from the first text. In this way, the second text can be prevented from having the same color as the surrounding content, so that the text cannot be well distinguished from the surrounding content.

[0208] It is understandable that the fourth element may also be an element in the first image whose distance from the first text is greater than a threshold, and the embodiment of the present application does not impose any limitation on this distance.

[0209] In some implementations, if the second text includes multiple elements, different texts may be set to different colors. The electronic device 100 may set the colors of different texts in the second text according to different elements in the first image.

[0210] In addition, the electronic device 100 may set the parameters of the second text in the following two situations:

[0211] 1) After the electronic device 100 modifies the first text in the first picture into the second text, it automatically sets the parameters of the second text

[0212] In this way, when the user modifies the text content in the picture, the electronic device 100 can automatically adjust the style of the text, thereby reducing the user's operations and helping the user to quickly obtain text that fits the style of the picture.

[0213] For example, see Figure 2D , Figure 7 After detecting the user operation on the confirmation icon 415B, the electronic device 100 can simultaneously change the text "Good morning!" in the picture 1 to "Good day!" and set the structure, shape, texture and color of "Good day!", so as to display the following: Figure 7 Picture 3 in the picture browsing area 411 is shown.

[0214] 2) After the electronic device 100 modifies the first text in the first picture into the second text, it further sets the parameters of the second text based on the user operation.

[0215] That is, after the electronic device 100 modifies the first text in the first picture into the second text, the electronic device 100 may further detect a second operation of the user adjusting parameters of the second text, and set the parameters of the second text based on the second operation.

[0216] In this way, the electronic device 100 can provide one or more functions for adjusting text parameters, and when the user has a need to adjust the text parameters, the text parameters can be adjusted to help the user obtain a more personalized text.

[0217] Exemplarily, the user operation may include any one or more of the following: Figure 3A-3B The user operation of setting the text structure shown, Figure 4A The user operation of setting the text shape is shown. Figure 5A-Figure 5B The user actions shown to set the text texture, and Figure 6A-6B User action shown to set text color.

[0218] In some embodiments, in the above two situations, whether the electronic device 100 automatically adjusts the parameters of the text or the electronic device 100 manually adjusts the parameters of the text based on the user's operation, the electronic device 100 can determine the parameters for adjusting the text and the number of adjusted parameters by itself.

[0219] Among them, if the electronic device 100 detects the user's operation of adjusting text, the electronic device 100 can determine the adjustment parameters of the second text by itself after modifying the first text into the second text, or, if the electronic device 100 further detects the adjustment operation of the second text after modifying the first text into the second text based on the user's operation, the electronic device 100 can determine the adjustment parameters of the second text by itself, so as to achieve the effect of the user "one-click adjustment" of the text style, and the user does not need to specify the adjustment parameters, and the electronic device 100 can adjust the text parameters based on certain principles to obtain text that fits the style of the picture.

[0220] In some embodiments, the electronic device 100 may select a parameter from the plurality of parameters of structure, shape, texture, and color according to the priority of the parameter to adjust the second text. Exemplarily, the electronic device 100 sets the parameter of the second text according to the element included in the first picture, which may mean that the electronic device 100 sets the first parameter of the second text according to the element included in the first picture, and the first parameter is a parameter selected from the plurality of parameters of structure, shape, texture, and color according to the priority of the parameters.

[0221] Exemplarily, if the priority is from large to small: structure>texture>color>shape; adjusting the parameters of the second text according to the priority may mean that the electronic device 100 first sets the structure of the second text; if the structure setting of the second text fails, the electronic device 100 sets the texture of the second text; if the texture setting of the second text fails, the electronic device 100 sets the color of the second text; if the color setting of the second text fails, the electronic device 100 sets the shape of the second text.

[0222] Among them, setting failure may mean that the first image does not contain elements that meet the parameter setting conditions of the text. For example, the structure setting failure of the second text may mean that the first image does not contain elements whose similarity with the text or strokes of the second text is greater than a first threshold. For another example, the texture setting failure of the second text may mean that the first image does not include elements with texture. For another example, the color setting failure of the second text may mean that the first image does not include elements.

[0223] It can be understood that the priorities of the above parameters are only illustrative examples. In actual application, the electronic device 100 can also select parameters according to other priorities. Moreover, the parameters selected by the electronic device 100 are not limited to one but can be multiple, and the embodiments of the present application do not limit this.

[0224] Fig.14 A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0225] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.

[0226] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0227] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0228] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0229] In some embodiments, the processor 110 may be used to recognize text in an image and adjust text content, text structure, text shape, text texture, and text color.

[0230] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0231] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0232] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0233] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0234] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0235] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0236] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0237] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0238] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0239] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0240] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0241] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microled, micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0242] In some implementations, the electronic device 100 may display a user interface related to the user adjusting the text in the picture through the display screen 194, such as the above Figure 1A-1E , Figure 2A-2D , Figure 3A-3C , Figure 4A-4B , Figure 5A-5C , Figure 6A-6C , Figure 7 .

[0243] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0244] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0245] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0246] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0247] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0248] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0249] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0250] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0251] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0252] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0253] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0254] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0255] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0256] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0257] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0258] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0259] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0260] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0261] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on 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 the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0262] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0263] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0264] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0265] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0266] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0267] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0268] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0269] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0270] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0271] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass 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 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0272] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0273] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0274] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0275] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0276] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0277] The electronic device may be a portable terminal device equipped with Harmony, iOS, Android, Microsoft or other operating systems, such as a mobile phone, a tablet computer, a wearable device, etc., and may also be a non-portable terminal device such as a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel. The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0278] Fig.15 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0279] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0280] The application layer can include a series of application packages.

[0281] like Fig.15 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0282] The gallery application, also known as the "album", is an application for managing pictures and videos, providing users with functions such as displaying, deleting, sharing, and editing pictures and videos. In addition, in the embodiment of the present application, the gallery application can be used to modify the text content contained in the picture and set the parameters of the text in the picture, including: structure, shape, texture, color, etc.

[0283] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0284] like Fig.15 As shown, the application framework layer may include a text content adjustment module, a text parameter adjustment module, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0285] The text content adjustment module can be used to modify the text content in the picture, for example, modify the first text in the first picture to the second text. Among them, the text content adjustment module can be used to realize the text in the picture, split the picture into text and background image, repair the background image into a complete background image, and superimpose the modified text on the repaired background image.

[0286] The text parameter adjustment module may include: a structure adjustment module, a shape adjustment module, a texture adjustment module, and a color adjustment module. Among them:

[0287] The structure adjustment module can be used to adjust the structure of the text in the image, and use elements in the image to replace the words or strokes in the text.

[0288] The shape adjustment module can be used to adjust the shape of text in the image, and use the shape of the elements in the image to set the shape of the text.

[0289] The texture adjustment module can be used to adjust the texture of the text in the picture, and set the texture of the element in the picture on the text.

[0290] The color adjustment module can be used to adjust the color of text in the image, and adjust the color of the text to the color of the elements in the image.

[0291] It is understandable that the text parameter adjustment module may also include other modules, such as a parameter decision module, which may be used to determine the parameters that need to be adjusted on the text. The present application embodiment does not limit the modules included in the text parameter module.

[0292] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0293] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0294] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0295] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0296] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0297] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0298] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0299] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0300] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0301] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0302] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0303] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0304] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0305] A 2D graphics engine is a drawing engine for 2D drawings.

[0306] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0307] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0308] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.

[0309] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0310] The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory, so that the electronic device executes the method executed by the electronic device 100 in any of the above embodiments.

[0311] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method performed by the electronic device 100 in any of the above embodiments.

[0312] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0313] The chip system may be composed of the chip, or may include the chip and other discrete devices.

[0314] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0315] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0316] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0317] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute a method executed by any one of the electronic devices 100 in any of the above embodiments.

[0318] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes any method executed by the electronic device 100 in any of the above embodiments.

[0319] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (digitalsignal processor, DSP), an application specific integrated circuit (AP 800plication specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0320] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device executes the method in each of the above method embodiments.

[0321] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0322] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.

[0323] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.

[0324] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0325] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for editing a picture, characterized in that: The method comprises: The electronic device displays the first picture; The electronic device detects a first operation of modifying a first text in the first picture; The electronic device modifies the first text in the first picture into a second text; The electronic device sets parameters of the second text according to elements included in the first picture, and the parameters include any one or more of the following: structure, shape, texture and color.

2. The method according to claim 1, characterized in that The first operation is a selection operation acting on the first text; after the electronic device detects the first operation and before modifying the first text in the first picture into a second text, the method further includes: The electronic device displays a first keyboard; The electronic device detects an operation of a user inputting the second text through the first keyboard; or, The first operation is a selection operation acting on the first picture; after the electronic device detects the first operation and before modifying the first text in the first picture to a second text, the method further includes: The electronic device displays one or more texts recognized from the first picture; The electronic device detects a selection operation on the first text among the one or more texts; The electronic device displays a first keyboard; The electronic device detects an operation of a user inputting the second text through the first keyboard.

3. The method according to claim 1 or 2, characterized in that: The electronic device modifies the first text in the first picture into the second text, specifically including: The electronic device recognizes the first text in the first picture, and splits the first picture into the first text and a first background, wherein the position of the first text in the first background does not contain any pixel points; The electronic device restores the first background to a second background, wherein the position of the first text in the second background includes pixel points determined according to content other than the first text in the first picture; The electronic device overlays the second text on the second background.

4. The method according to any one of claims 1 to 3, characterized in that: The parameter includes a structure, and the first picture includes a first element; The electronic device sets the parameters of the second text according to the elements included in the first picture, specifically including: The electronic device replaces the first character in the second text with the first element, and the similarity between the first element and the first character is greater than a first threshold; or, The electronic device replaces a first stroke in a first character in the second text with the first element, and a similarity between the first element and the first stroke is greater than a second threshold.

5. The method according to claim 4, characterized in that The proportion of the replaced content in the second text to the total content of the second text is less than a third threshold.

6. The method according to any one of claims 1 to 5, characterized in that: The parameters include a shape, and the first picture includes a second element; The electronic device sets the parameters of the second text according to the elements included in the first picture, specifically including: The electronic device adjusts the shape of the second text according to the shape of the second element.

7. The method according to claim 6, characterized in that The electronic device adjusting the shape of the second text according to the shape of the second element specifically includes: The electronic device adjusts the layout path of the second text according to the first contour curve of the second element.

8. The method according to claim 7, characterized in that The second element is an element contained in the first image and closest to the first text, and the first contour curve is a contour curve of a side of the second element facing the first text.

9. The method according to any one of claims 1 to 8, characterized in that: The parameter includes a texture, and the first picture includes a third element; The electronic device sets the parameters of the second text according to the elements included in the first picture, specifically including: The electronic device adds the first texture of the third element to the second text.

10. The method according to claim 9, characterized in that The third element is an element in the first picture whose distance from the first text is greater than a fourth threshold.

11. The method according to any one of claims 1 to 10, characterized in that: The parameters include color, and the first picture includes a fourth element; The electronic device sets the parameters of the second text according to the elements included in the first picture, specifically including: The electronic device sets the color of the second text to the color of the fourth element.

12. The method according to claim 11, characterized in that The fourth element is the element in the first picture that is farthest from the first text.

13. The method according to any one of claims 1 to 12, characterized in that: The electronic device sets the parameters of the second text according to the elements included in the first picture, specifically including: The electronic device sets a first parameter of the second text according to the elements included in the first picture, where the first parameter is a parameter selected according to the priority of structure, shape, texture, and color.

14. The method according to claim 13, characterized in that In order of priority from large to small: structure > texture > color > shape; The electronic device setting the first parameter of the second text specifically includes: The electronic device first sets the structure of the first text; If the structure setting of the second text fails, the electronic device sets the texture of the second text; If the texture setting of the second text fails, the electronic device sets the color of the second text; If the color setting of the second text fails, the electronic device sets the shape of the second text.

15. The method according to any one of claims 1 to 14, characterized in that: Before the electronic device sets the parameters of the second text according to the elements included in the first picture, the method further includes: The electronic device detects a second operation of setting a parameter of the second text.

16. The method according to any one of claims 1 to 15, characterized in that: If the font of the first text is a font included in the electronic device, the font of the second text is the font of the first text; If the font of the first text is not a font contained in the electronic device, the font of the second text is any one of the following fonts: a preset first font, a font selected by the user, a font most frequently used by the user, or a font contained in the electronic device that is most similar to the font of the first text.

17. The method according to any one of claims 1 to 16, characterized in that: The electronic device displays the first picture, specifically including: The electronic device displays the first picture through a gallery application.

18. An electronic device, characterized in that: The electronic device comprises a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the method as claimed in any one of claims 1 to 17.

19. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 17.