Ink stroke generation method, readable storage medium, electronic device, and program product

By generating ink diffusion effects by detecting the acceleration data of electronic devices, the problem of ink spreading in painting applications that cannot simulate the effect of a real brush is solved, thus improving the user experience.

WO2026091647A1PCT designated stage Publication Date: 2026-05-07HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-06-30
Publication Date
2026-05-07

AI Technical Summary

Technical Problem

Painting apps cannot simulate the ink bleeding, diffusion, and flow effects of a real pen on paper, resulting in a poor user experience.

Method used

By detecting the acceleration data of electronic devices, a second ink mark is generated and displayed that spreads in a specific direction. The diffusion parameters are adjusted using gravitational acceleration and motion acceleration to simulate the drawing effect of a real pen.

Benefits of technology

It improves the user's drawing experience, making the ink marks drawn on electronic devices closer to the effect of a real pen on paper, enhancing the user's immersion and interactivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025105984_07052026_PF_FP_ABST
    Figure CN2025105984_07052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of terminals, and discloses an ink stroke generation method, a readable storage medium, an electronic device, and a program product. In the method, upon detecting that a user has drawn an ink stroke (or is drawing an ink stroke), on the basis of acceleration data of an electronic device, the electronic device may generate a diffused ink stroke corresponding to the ink stroke. That is to say, for the same ink stroke drawn by the user, when the acceleration data of the electronic device is different, the diffused ink stroke generated by the electronic device is different. In this way, the user can adjust the acceleration data of the electronic device by adjusting the acceleration data of the electronic device, adjusting an included angle between the electronic device and a horizontal plane (equivalent to adjusting the component of the gravitational acceleration acting on the electronic device in a plane where a display screen of the electronic device is located), controlling the electronic device to move after drawing an ink stroke, and the like, so that the electronic device can generate different diffused ink strokes, which is beneficial to improving the drawing experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Ink generation methods, readable storage media, electronic devices and application products

[0001] This application claims priority to Chinese Patent Application No. 202411519584.3, filed on October 28, 2024, entitled "Ink Generation Method, Readable Storage Medium, Electronic Device and Program Product", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to an ink generation method, a readable storage medium, an electronic device, and a program product. Background Technology

[0003] With the development of touch technology, more and more drawing applications (hereinafter referred to as drawing applications) can generate ink marks along the trajectory drawn by the user on the touch screen of the electronic device using their finger, stylus, etc., thereby enabling the user to draw on the electronic device.

[0004] Painting apps typically offer a variety of brushes for users to create ink marks with different patterns, each brush corresponding to a preset brush pattern. When a painting app detects a user drawing a path with a particular brush, it can generate and display the ink mark along that path based on the corresponding brush pattern. However, painting apps usually generate ink marks by repeatedly overlaying static brush patterns along the user's path, failing to capture the effect of ink spreading, diffusing, and flowing on real paper when the user paints with a real pen (such as a watercolor brush or calligraphy brush), resulting in a poor user experience. Summary of the Invention

[0005] In view of this, this application provides an ink generation method, a readable storage medium, an electronic device, and a program product, which are beneficial to improving the user's painting experience.

[0006] In a first aspect, an ink-stain generation method is provided, applied to an electronic device, the method comprising: detecting an operation by a user to draw a first ink stain on a first interface; generating and displaying a second ink stain that spreads along at least one direction based on acceleration data of the electronic device, wherein the acceleration data includes at least one of the following acceleration data: motion acceleration of the electronic device, gravitational acceleration experienced by the electronic device.

[0007] Based on the above method, an electronic device can diffuse a first ink mark to obtain a second ink mark based on one or more of the device's motion acceleration and gravitational acceleration. In other words, the electronic device will produce different second ink marks depending on the gravitational acceleration and / or motion acceleration it experiences. Thus, users can adjust the acceleration data of the electronic device by adjusting its orientation (e.g., the angle with the horizontal plane or the direction of gravity) and / or its motion state, thereby enabling the electronic device to generate the diffused ink mark (second ink mark) expected by the user, which improves the user experience.

[0008] Optionally, the electronic device can display multiple frames of intermediate ink marks where the first ink mark gradually diffuses into the second ink mark.

[0009] Optionally, in the portion of the second ink mark that diffuses relative to the first ink mark, the color of the pixel becomes lighter as the distance between the pixel and the first ink mark in the diffusion direction increases.

[0010] In one possible implementation of the first aspect described above, the diffusion parameter of the first ink mark increases or decreases with the increase of the first component of the gravitational acceleration on the plane where the display screen of the electronic device is located, or increases or decreases with the increase of the second component of the motion acceleration on the plane where the display screen is located, wherein the diffusion parameter includes at least one of the following parameters: diffusion speed, diffusion duration, diffusion distance, and color decay rate during diffusion.

[0011] In this implementation, at least one diffusion parameter of the first ink spread can be positively or negatively correlated with a first component (e.g., the gravitational acceleration component hereinafter) and / or a second component (e.g., the motion acceleration component hereinafter). Based on this, the user can change the magnitude of the first and / or second components by adjusting the attitude or motion state of the electronic device, thereby enabling the electronic device to generate a second ink spread based on the magnitude of the first and / or second components.

[0012] In one possible implementation of the first aspect above, generating and displaying a second ink stain that spreads along at least one direction based on acceleration data from an electronic device includes: acquiring a first component; generating and displaying a second ink stain that spreads along at least one direction based on the first component, wherein the at least one direction includes the first direction in which the first component is located.

[0013] In this implementation, the electronic device can obtain the first component based on the spiritual energy collected by accelerometers, accelerometers, gyroscopes, etc. Furthermore, the main direction of the first ink spread can be the first direction.

[0014] In one possible implementation of the first aspect described above, the degree of diffusion of the first ink mark along the first direction is greater than the degree of diffusion along the other directions among the at least one of the aforementioned directions.

[0015] In one possible implementation of the first aspect above, the diffusion degree of the first ink stain along the first direction is greater than the diffusion degree along other directions among the at least one of the above directions, including: the diffusion distance of the first ink stain along the first direction is greater than the diffusion distance along the other directions, and / or the diffusion duration of the first ink stain along the first direction is greater than the diffusion duration along the other directions, and / or the diffusion speed of the first ink stain along the first direction is greater than the diffusion speed along the other directions, and / or the color decay rate during the diffusion of the first ink stain along the first direction is less than the color decay rate during diffusion along the other directions.

[0016] In one possible implementation of the first aspect, at least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction increases with the increase of the first component, or the decay rate of the color during the diffusion of the first ink stain along the first direction decreases with the increase of the first component.

[0017] In one possible implementation of the first aspect described above, generating and displaying a second ink mark that diffuses along at least one direction based on a first component includes: obtaining a paper texture resistance coefficient of the canvas on which the first ink mark is drawn, and adjusting the paper texture resistance coefficient based on the first component, wherein the adjusted paper texture resistance coefficient decreases as the first component increases, the paper texture resistance coefficient is used to indicate the degree of obstruction of color by pixels in the canvas, and the degree of obstruction of color by pixels increases as the corresponding paper texture resistance coefficient increases; and generating and displaying a second ink mark that diffuses along at least one direction based on the adjusted paper texture resistance coefficient.

[0018] In this implementation, the electronic device can adjust the paper texture obstruction coefficient of each pixel in the canvas based on the first component, and diffuse the first ink mark through the adjusted paper texture obstruction coefficient.

[0019] In one possible implementation of the first aspect described above, generating and displaying a second ink mark spreading in at least one direction based on the acceleration data of the electronic device includes: generating and displaying a second ink mark spreading in at least one direction based on gravitational acceleration when at least one of the following conditions is met: the movement speed of the electronic device is less than a first speed threshold, the movement acceleration is less than a first acceleration threshold, the electronic device is stationary, the component of gravitational acceleration in the plane where the electronic device's display screen is located is greater than a second acceleration threshold, and a user instruction to spread the first ink mark by gravitational acceleration is detected; and / or, generating and displaying a second ink mark spreading in at least one direction based on movement acceleration when at least one of the following conditions is met: the movement speed of the electronic device is greater than a second speed threshold, the movement acceleration is greater than a third acceleration threshold, the component of gravitational acceleration in the plane where the electronic device's display screen is located is less than a fourth acceleration threshold, and a user instruction to spread the first ink mark by movement acceleration is detected.

[0020] In this implementation, the electronic device can use different acceleration data to spread the first ink mark under different conditions. This avoids the generation of ink marks that do not meet the user's expectations due to changes in the motion state of the electronic device caused by user error or changes in the angle between the screen plane and the horizontal plane.

[0021] In one possible implementation of the first aspect above, generating and displaying the second ink mark spreading in at least one direction based on the acceleration data of the electronic device includes: generating and displaying the second ink mark spreading in at least one direction based on gravitational acceleration in response to a first angle and / or a first angle greater than a first angle and / or a change in the first angle between the plane where the display screen of the electronic device is located and the horizontal plane; or generating and displaying the second ink mark spreading in at least one direction based on motion acceleration in response to a change in the motion state of the electronic device.

[0022] In this implementation, the electronic device can generate different second ink marks based on its own state (the angle between the plane where the display screen is located and the horizontal plane, the motion state (e.g., stationary or moving, motion speed, motion acceleration) and different acceleration data.

[0023] In one possible implementation of the first aspect above, when the first included angle is a first value, the diffusion speed of the first ink mark is a first diffusion speed, the diffusion duration of the first ink mark is a first duration, the diffusion distance of the first ink mark is a first distance, and the decay speed of the color of the first ink mark is a first decay speed; when the first included angle is a second value, the diffusion speed of the first ink mark is a second diffusion speed, the diffusion duration of the first ink mark is a second duration, the diffusion distance of the first ink mark is a second distance, and the decay speed of the color of the first ink mark is a second decay speed, wherein the second value is greater than the first value; wherein the first diffusion speed is less than the second diffusion speed, and / or the first duration is less than the second duration, and / or the first distance is less than the second distance, and / or the first decay speed is greater than the second decay speed.

[0024] In this implementation, the larger the value of the first angle, the greater the diffusion speed, the greater the diffusion distance, the longer the diffusion time, and the smaller the color decay rate of the first ink mark.

[0025] In one possible implementation of the first aspect above, generating and displaying a second ink mark that spreads along at least one direction based on the acceleration data of the electronic device includes: detecting a user's movement operation on the electronic device after drawing the first ink mark; generating and displaying a second ink mark that spreads along at least one direction based on the motion acceleration corresponding to the movement operation, wherein the at least one direction includes a second direction, which is the direction of the second component, or the direction opposite to the direction of the second component, or the direction of the movement operation, or the direction opposite to the direction of the movement operation.

[0026] With this implementation, after the user draws the first ink mark, they can move the electronic device (e.g., shake it). The electronic device can then generate a second ink mark in response to the acceleration (equivalent to motion acceleration) caused by the user's movement.

[0027] Optionally, in this implementation, the main direction of the first ink spread can be the second direction.

[0028] In one possible implementation of the first aspect described above, the degree of diffusion of the first ink mark along the second direction is greater than the degree of diffusion along the other directions in at least one of the aforementioned directions.

[0029] In one possible implementation of the first aspect above, the diffusion degree of the first ink stain along the second direction is greater than the diffusion degree along the other directions among the at least one of the above directions, including: the diffusion distance of the first ink stain along the second direction is greater than the diffusion distance along the other directions, and / or the diffusion duration of the first ink stain along the second direction is greater than the diffusion duration along the other directions, and / or the diffusion speed of the first ink stain along the second direction is greater than the diffusion speed along the other directions, and / or the color decay rate during the diffusion of the first ink stain along the second direction is less than the color decay rate during diffusion along the other directions.

[0030] In one possible implementation of the first aspect above, at least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the second direction increases with the increase of the second component, or the decay rate of the color during the diffusion of the first ink stain along the second direction decreases with the increase of the second component.

[0031] In one possible implementation of the first aspect described above, generating and displaying a second ink mark that diffuses in at least one direction based on the motion acceleration corresponding to the movement operation includes: obtaining the paper texture resistance coefficient of the canvas on which the first ink mark is drawn, and adjusting the paper texture resistance coefficient based on a second component, wherein the adjusted paper texture resistance coefficient decreases as the second component increases, the paper texture resistance coefficient is used to indicate the degree of obstruction of color by pixels in the canvas, and the degree of obstruction of color by pixels increases as the corresponding paper texture resistance coefficient increases; and generating and displaying a second ink mark that diffuses in at least one direction based on the adjusted paper texture resistance coefficient.

[0032] In this implementation, the electronic device can adjust the paper texture obstruction coefficient of each pixel in the canvas based on the second component, and diffuse the first ink mark through the adjusted paper texture obstruction coefficient.

[0033] In one possible implementation of the first aspect above, generating and displaying a second ink mark that spreads along at least one direction based on the acceleration data of the electronic device includes: determining a second angle between the plane where the display screen of the electronic device is located and the horizontal plane, or a third angle between the plane where the display screen is located and the direction of the gravitational acceleration, based on the gravitational acceleration; generating and displaying a second ink mark that spreads along at least one direction based on the second angle or the third angle, wherein at least one direction includes a first direction, which is the direction in which the first component of the gravitational acceleration is located in the electronic device.

[0034] In one possible implementation of the first aspect above, at least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction decreases as the second included angle increases, or at least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction increases as the third included angle increases, or the color decay rate during the diffusion of the first ink stain along the first direction increases as the second included angle increases, or the color decay rate during the diffusion of the first ink stain along the first direction decreases as the third included angle increases.

[0035] In one possible implementation of the first aspect described above, generating and displaying a second ink mark that diffuses along at least one direction based on a second or third included angle includes: obtaining a paper texture obstruction coefficient of the canvas on which the first ink mark is drawn, and adjusting the paper texture obstruction coefficient based on the second or third included angle, wherein the adjusted paper texture obstruction coefficient decreases as the second included angle increases or increases as the third included angle increases, the paper texture obstruction coefficient being used to indicate the degree of obstruction of color by pixels in the canvas, and the degree of obstruction of color by pixels increases as the corresponding paper texture obstruction coefficient increases; and generating and displaying a second ink mark that diffuses along at least one direction based on the adjusted paper texture obstruction coefficient.

[0036] In one possible implementation of the first aspect above, generating and displaying a second ink mark that spreads along at least one direction based on a second included angle or a third included angle includes: generating and displaying a second ink mark that spreads along at least one direction based on a second included angle or a third included angle when at least one of the following conditions is met: the movement speed of the electronic device is less than a first speed threshold, the movement acceleration of the electronic device is less than a first acceleration threshold, or the electronic device is stationary.

[0037] In one possible implementation of the first aspect described above, the at least one direction includes a third direction, which is the direction of the acceleration resulting from the synthesis of the first and second components.

[0038] In this implementation, the electronic device can generate the second ink mark based on gravitational acceleration and motion acceleration, and the main diffusion direction of the first ink mark can be the direction of the acceleration synthesized from the first and second components.

[0039] In a second aspect, an electronic device is provided, comprising: a memory for storing one or more programs; and a processor for executing the one or more programs to cause the electronic device to implement the ink generation method provided in the first aspect and any possible implementation of the first aspect.

[0040] Thirdly, a readable storage medium is provided, which includes one or more programs that, when executed on an electronic device, cause the electronic device to implement the first aspect and any possible implementation of the ink generation method provided by the first aspect.

[0041] Fourthly, a program product is provided that, when run on an electronic device, enables the electronic device to implement the first aspect and any possible implementation of any ink generation method provided in the first aspect.

[0042] It should be understood that the beneficial effects of the second to fourth aspects mentioned above can be referred to the beneficial effects described in the first aspect, and will not be repeated here. Attached Figure Description

[0043] Figure 1 illustrates a schematic diagram of an ink generation process according to some embodiments of this application.

[0044] Figure 2 shows a schematic diagram of the interface of a drawing application for an electronic device according to some embodiments of this application.

[0045] Figure 3A shows a comparative schematic diagram of a diffused ink mark according to some embodiments of this application.

[0046] Figure 3B illustrates a schematic diagram of a diffused ink mark according to some embodiments of this application.

[0047] Figure 3C illustrates a schematic diagram of an intermediate ink mark according to some embodiments of this application.

[0048] Figure 4 shows a comparative schematic diagram of another diffused ink mark according to some embodiments of this application.

[0049] Figure 5A illustrates a schematic diagram of ink diffusion when the direction of movement of an electronic device is not within the plane of the display screen of the electronic device, according to some embodiments of this application.

[0050] Figure 5B, according to some embodiments of this application, shows a schematic diagram of ink spreading in the opposite direction along the direction of the motion acceleration component of an electronic device.

[0051] Figure 5C, according to some embodiments of this application, shows a schematic diagram of ink spreading when the direction of movement of an electronic device is within the plane of the display screen of the electronic device.

[0052] Figure 6 illustrates a flowchart of an ink generation method according to some embodiments of this application.

[0053] Figure 7A illustrates a schematic diagram of generating and displaying a second ink mark that diffuses in at least one direction based on a pixel-based paper texture obstruction coefficient, according to some embodiments of this application.

[0054] Figure 7B illustrates a schematic diagram based on ink diffusion between pixels according to some embodiments of this application.

[0055] Figure 7C illustrates another schematic diagram based on ink diffusion between pixels, according to some embodiments of this application.

[0056] Figure 8 illustrates a schematic diagram of a software architecture according to some embodiments of this application.

[0057] Figure 9 illustrates a process of implementing the aforementioned ink mark generation method in a painting application, according to some embodiments of this application.

[0058] Figure 10 shows a schematic diagram of an electronic device displaying an acceleration selection control according to some embodiments of this application.

[0059] Figure 11 shows a schematic diagram of the structure of an electronic device according to some embodiments of this application. Detailed Implementation

[0060] The illustrative embodiments of this application include, but are not limited to, ink generation methods, readable storage media, electronic devices, and program products.

[0061] As mentioned earlier, drawing applications typically generate ink marks by repeatedly overlaying static brush patterns (also known as brush images, brush stamps, etc.) along the user's drawing path. This fails to reflect the ink's diffusion, spread, and flow on real paper when the user draws with a real pen (such as a watercolor pen, brush, etc.), resulting in a poor user experience.

[0062] For example, Figure 1 illustrates a schematic diagram of an ink generation process according to some embodiments of this application.

[0063] As shown in Figure 1, after the electronic device detects that the user is drawing ink along trajectory L1 using brush F1 (the brush pattern of brush F1 is circular), it can repeatedly superimpose the brush pattern of brush F1 along trajectory L1 to generate and display ink stain IK1. As shown in Figure 1, ink stain IK1 is obtained by repeatedly superimposing the brush pattern (circular) of brush F1 along trajectory L1, which is rather stiff and differs significantly from ink stains drawn by the user on real paper.

[0064] To enable users to simulate the effects of realistic brush painting when drawing ink on the screen of an electronic device, the embodiments provided in this application allow for the configuration of a flowing brush (also known as a fluid brush or other names) function in the drawing application of the electronic device. A flowing brush refers to a brush whose ink, after being repeatedly superimposed along the user's drawing path, diffuses in at least one direction over time according to fixed diffusion parameters. Examples include flat diffusion brushes, gradient color-laying brushes, and dot-color blending brushes. Fixed diffusion parameter ink refers to a diffusion pattern where, given a fixed paper texture (the texture of the canvas used to draw the ink) type (e.g., no paper texture, gold thread, silver thread, Xuan paper, rock painting, rough-textured watercolor, fine-textured watercolor, oil painting, etc.) and brush parameters (e.g., water volume, ink volume, transparency, size, etc.), the diffusion parameters (e.g., diffusion speed, diffusion distance, diffusion duration, and the color change pattern of the ink during diffusion (e.g., the color decay pattern)) are fixed values. After repeatedly superimposing the brush pattern of the user-selected flowing brush along the trajectory drawn by the user to obtain ink marks, this part of the electronic device can generate diffuse ink marks that diffuse in at least one direction based on fixed diffusion parameters.

[0065] In some embodiments, ink diffusion refers to the attenuation process in which ink gradually spreads and increases outward from the edge of the ink stain, and the color in the diffused ink stain gradually becomes lighter along the diffusion direction, such as a process of gradually increasing brightness or lightness. In some embodiments, in the diffused ink stain obtained by diffusing an original ink stain, the color depth of the pixels relative to the diffused portion of the original ink stain decreases as the distance between the pixels and the original ink stain in the diffusion direction increases.

[0066] It should be noted that the fixed diffusion parameters of the same brush can be different or the same on different paper textures.

[0067] It should be noted that when using the same brush to paint on canvases with different paper textures, the corresponding brush pattern can be the same or different.

[0068] It should be noted that the ink strokes repeatedly superimposed by a brush along the user-drawn path can spread in one or more directions, and the corresponding fixed diffusion parameters for different directions can be the same or different.

[0069] It should be noted that different paper textures correspond to different real papers.

[0070] For example, Figure 2 shows a schematic diagram of the interface of a drawing application for an electronic device according to some embodiments of this application.

[0071] As shown in Figure 2, the interface of the painting application includes a brush control 11, a brush library control 12 (visible after detecting the user's selection of the brush control 11), a size control 13, a transparency control 14, a water volume control 15, an ink volume control 16, a paper texture control 17 (visible after the user selects a paper texture), and a color control 18 (used to configure the brush color). The electronic device can adjust the size of the brush pattern (equivalent to adjusting the size of the generated ink) based on the user's operation on the size control 13, adjust the transparency of the ink (the higher the transparency, the darker the ink color) based on the user's operation on the transparency control 14, adjust the water volume of the brush based on the user's operation on the water volume control 15 (the higher the water volume, the greater the ink diffusion), adjust the ink volume of the brush based on the user's operation on the ink volume control 16 (wherein, the higher the ink volume, the darker the ink color), and configure the paper texture of the image based on the user's operation on the paper texture control 17.

[0072] Referring again to Figure 2, when the electronic device detects that the user is drawing ink mark IK2 along trajectory L2 on a textureless canvas using a flat diffusion brush, it can sequentially generate and display diffused ink marks IK21, IK22, ..., IK2, which diffuse from the ink mark IK2 in all directions (for example, the diffusion direction at each position along the edge of the ink mark IK2 can be along the normal direction of the edge of the ink mark IK2 towards the outside of the ink mark IK2) based on the fixed diffusion parameters corresponding to the flat diffusion brush and the textureless canvas. n-1 And diffused ink IK2 n Among them, diffuse ink stains IK21 to IK2 are... n The ink marks at different times during the diffusion process of ink mark IK2.

[0073] Contrast diffusion ink IK2 n As seen with ink stain IK2, the diffusion ink stain IK2 n The portion of ink IK2 that has diffused relative to the area where ink IK2 has diffused (e.g., the diffused ink IK2 in Figure 2) n The greater the distance between each pixel outside the white dashed area and the edge of the ink blot IK2, the greater the brightness (or luminance) of the color (visually, the ink color becomes lighter and lighter with increasing distance until it is completely invisible). In this way, the effect of ink gradually spreading on real paper over time can be simulated.

[0074] In the above-described ink generation method, the ink spreads according to fixed diffusion parameters. This means that even if the motion state of the electronic device (e.g., acceleration) or the angle between the device and the horizontal plane differs, the diffusion parameters used to spread the same ink are fixed, resulting in identical diffused ink. However, when drawing on real paper, the ink diffusion effect is not constant and is also affected by external forces acting on the ink (e.g., gravity), paper movement, and other factors.

[0075] Therefore, in order to better simulate the diffusion effect of ink on real paper and improve the user experience, this application provides an ink mark generation method. In this method, based on the aforementioned flowing brush, the diffusion parameters used by the electronic device to generate the diffused ink mark are also related to the acceleration data of the electronic device (such as the gravitational acceleration experienced by the electronic device, the acceleration of the electronic device's motion (hereinafter referred to as motion acceleration), etc.). After detecting that the user has drawn an ink mark (or during the process of drawing an ink mark), the electronic device can generate the corresponding diffused ink mark based on the acceleration data of the electronic device. In this way, the user can adjust the diffusion parameters corresponding to the brush by adjusting the acceleration data of the electronic device (such as adjusting the angle between the electronic device and the horizontal plane (equivalent to adjusting the component of the gravitational acceleration experienced by the electronic device in the plane where the electronic device's display screen is located), the motion acceleration of the electronic device, etc.), thereby adjusting the diffused ink mark generated by the electronic device, which is beneficial to improving the user's drawing experience.

[0076] For example, when a user is drawing using a drawing application, after creating an ink mark, they can adjust the angle between the electronic device and the horizontal plane to adjust the magnitude and direction of the component of gravitational acceleration acting on the screen (hereinafter referred to as the gravitational acceleration component). Upon detecting this adjustment, the electronic device can generate a diffused ink mark by using diffusion parameters that match the direction and magnitude of the gravitational acceleration component.

[0077] For example, when a user is drawing ink, the electronic device can generate diffused ink by using diffusion parameters that match the direction and magnitude of the gravitational acceleration component, based on the magnitude of the gravitational acceleration component.

[0078] For example, the motion acceleration of an electronic device can be adjusted by moving the device (e.g., shaking it). After detecting the user's movement of the electronic device, the device can obtain the magnitude and direction of the motion acceleration and then use diffusion parameters that match the direction (hereinafter referred to as the motion acceleration component direction) and magnitude of the component of the motion acceleration on the plane of the electronic device's display screen to generate a diffused ink mark.

[0079] Specifically:

[0080] When an electronic device detects a user drawing a first ink mark in the interface of a drawing application, it can generate and display a second ink mark that diffuses along at least one direction based on the acceleration data of the electronic device. At least one diffusion parameter (e.g., diffusion speed, diffusion distance, diffusion duration, color decay pattern during diffusion (e.g., change in brightness or luminance)) in at least a portion of these at least one directions is associated with the acceleration data.

[0081] In some embodiments, the diffusion speed can be the number of pixels that the first ink blot diffuses per unit time (or the product of the number of pixels and the pixel size), the diffusion distance can be the total number of pixels that the first ink blot diffuses (or the product of the number of pixels and the pixel size), the diffusion duration refers to the time from the start of diffusion to the completion of diffusion of the first ink blot, and the color decay law during the diffusion process can be the color decay rate (e.g., the rate of increase of brightness and luminance).

[0082] In some embodiments, the brush used by the user to draw the first ink mark can be any brush, such as a flat diffusion brush, a gradient color-laying brush, a dotting and blurring brush, a water-dissolving brush, a wet texture brush, a dotting brush, a non-uniform flow brush, a water-spreading brush, a wet splatter brush, etc., without limitation.

[0083] In some embodiments, the ink generation method provided in this application can also be implemented independently of the aforementioned flowing brush. For example, in a painting application on an electronic device, other brushes (such as gravity brushes) independent of the flowing brush can be configured. After detecting a user's operation of drawing a first ink mark based on the gravity brush, the electronic device can directly generate and display a second ink mark obtained by diffusing the first ink mark based on the magnitude and direction of the electronic device's acceleration data, without relying on the ink diffusion method in the aforementioned flowing brush. The following describes different scenarios:

[0084] Scenario 1: An electronic device generates and displays a second ink stain that spreads along at least one direction based on the first ink stain's diffusion.

[0085] In some embodiments, the aforementioned at least some directions of the diffusion of the first ink blot may include the direction of the gravitational acceleration component. The diffusion speed of the first ink blot along the gravitational acceleration component direction may be greater than the diffusion speed in other directions, and / or the diffusion distance of the first ink blot along the gravitational acceleration component direction may be greater than the diffusion distance in other directions, and / or the diffusion duration of the first ink blot along the gravitational acceleration component direction may be greater than the diffusion duration in other directions, and / or the rate of color decay (e.g., the rate of increase in brightness or luminance) of the first ink blot during diffusion along the gravitational acceleration component direction may be less than the rate of color decay in other directions.

[0086] In some embodiments, at least one of the diffusion speed, diffusion distance, diffusion duration, and color decay rate with diffusion distance of the first ink mark along the direction of the gravitational acceleration component can be positively correlated (or negatively correlated) with the magnitude of the gravitational acceleration component.

[0087] For example, the diffusion speed, diffusion distance, and diffusion time of the first ink mark along the direction of the gravitational acceleration component can increase with the increase of the gravitational acceleration component and decrease with the decrease of the gravitational acceleration component; the decay rate of the color during the diffusion of the first ink mark along the direction of the gravitational acceleration component can decrease with the increase of the gravitational acceleration component and increase with the decrease of the gravitational acceleration component.

[0088] For example, the diffusion speed, diffusion distance, and diffusion time of the first ink mark along the direction of the gravitational acceleration component can decrease as the gravitational acceleration component increases and increase as the gravitational acceleration component decreases; the decay rate of the color during the diffusion of the first ink mark along the direction of the gravitational acceleration component can increase as the gravitational acceleration component increases and decrease as the gravitational acceleration component decreases.

[0089] For example, the diffusion speed, diffusion distance, diffusion time, and color decay rate of the first ink mark along the direction of the gravitational acceleration component can increase with the increase of the gravitational acceleration component or decrease with the decrease of the gravitational acceleration component.

[0090] In some embodiments, the distance the first ink smear spreads along the direction of the gravitational acceleration component can be greater than the distance spread along other directions, and the spreading distance can increase with the increase of the gravitational acceleration component. For example, FIG3A shows a comparative schematic diagram of diffused ink smears obtained with different gravitational acceleration components according to some embodiments of this application.

[0091] As shown in Figure 3A, the plane in which the display screen of the electronic device is located is the XY plane (the X direction is the length direction of the display screen, the Y direction is the width direction of the display screen, and the X direction is perpendicular to the Y direction). The angle between the direction of the gravitational acceleration G of the electronic device and the XY plane is α (equivalent to the angle between the XY plane and the horizontal plane being 90°-α). The component of the gravitational acceleration G in the XY plane is G', and the magnitude of G' is the product of the magnitude of G and the cosine of α (equivalent to the larger α is, the smaller G' is).

[0092] Referring again to Figure 3A, in the diffused ink smudges generated solely based on fixed diffusion parameters, even if the orientation (e.g., angle with the horizontal plane) and motion (e.g., speed or acceleration) of the electronic device differ, the diffused ink smudges generated based on the same ink smudge are identical. However, in the second ink smudge generated by diffusing the first ink smudge based on the gravitational acceleration experienced by the electronic device, the diffusion distance along the G' direction is greater than the diffusion distance in other directions (visually, the diffusion direction of the second ink smudge relative to the first ink smudge is mainly towards the G' direction).

[0093] Furthermore, in some embodiments, the size of G' is greater when α is 20° than when α is 50°, so that the diffusion distance d1 of the first ink stain spreading along the G' direction when α is 20° is greater than the diffusion distance d2 of the first ink stain spreading along the G' direction when α is 50°.

[0094] In some embodiments, the main diffusion direction of the diffused ink generated by the electronic device may differ depending on the direction of the gravitational acceleration component. For example, FIG3B illustrates a schematic diagram of diffused ink generated by the electronic device when the direction of the gravitational acceleration component differs from that in FIG3A, according to some embodiments of this application.

[0095] Referring to Figure 3B, when the user draws the same first ink mark as in Figure 3A, the component of the gravitational acceleration G in the XY plane is G″, and the direction of G″ is different from that of G', the diffusion distance of the second ink mark generated by the electronic device in the G″ direction is greater than the diffusion distance in other directions (visually, the diffusion direction of the second ink mark relative to the first ink mark is mainly towards the G″ direction).

[0096] It should be noted that the electronic device can generate multiple frames of intermediate ink marks during the process of the first ink mark spreading in at least one direction to form the second ink mark. The electronic device can render and display these multiple frames of intermediate ink marks to display an animation of the first ink mark spreading in at least one direction to form the second ink mark. In some embodiments, the electronic device can display the first ink mark, multiple intermediate ink marks, and the second ink mark frame by frame. During the display of the first ink mark, multiple intermediate ink marks, and the second ink mark, the number of pixels occupied by the ink mark increases over time, and the color of each pixel can gradually deepen over time, visually presenting the effect of ink spreading on real paper.

[0097] For example, taking the situation shown in Figure 3B as an example, referring to Figure 3C, during the process of the first ink spot spreading along the G″ direction to obtain the second ink spot, the electronic device can sequentially render and display the intermediate ink spot IM1, intermediate ink spot IM2, ..., intermediate ink spot IM n-1 In-middle Ink IM n In other words, in the interface displayed by the electronic device, the ink smudges in n consecutive frames are respectively the middle ink smudge IM1, the middle ink smudge IM2, ..., the middle ink smudge IM... n-1 In-middle Ink IM n .

[0098] In some embodiments, the diffusion parameters in each of the at least one direction of the first ink diffusion can be the same or different. Furthermore, at least one of the diffusion parameters in each direction is associated with a component of gravitational acceleration (or the angle between the plane of the electronic device display and the horizontal plane, or the angle between the plane of the electronic device display and the direction of gravitational acceleration). For example, at least one of the diffusion speed, diffusion distance, diffusion duration, and color decay rate can be positively (or negatively) correlated with the magnitude of the component of gravitational acceleration (or the angle between the plane of the electronic device display and the horizontal plane, or the angle between the plane of the electronic device display and the direction of gravitational acceleration).

[0099] For example, in some embodiments, the diffusion parameters used by the electronic device to diffuse the first ink mark may be independent of the direction of the gravitational acceleration component and related to the magnitude of the gravitational acceleration component. In this case, the diffusion distance of the electronic device to diffuse the first ink mark may increase with the increase of the magnitude of the gravitational acceleration component. Exemplarily, FIG4 shows a comparative schematic diagram of another type of diffused ink mark according to some embodiments of this application.

[0100] As shown in Figure 4, the plane on which the display screen of the electronic device is located is the XY plane. The angle between the direction of the gravitational acceleration G of the electronic device and the XY plane is α (equivalent to the angle between the XY plane and the horizontal plane being 90°-α). The component of the gravitational acceleration G in the XY plane is G', and G' is the product of the cosine of G and α (equivalent to the larger α is, the smaller G' is).

[0101] Referring again to Figure 4, the diffusion distance of the second ink blot along the Y direction is the same as the diffusion distance in the opposite direction of the Y direction, and this diffusion distance can decrease as α increases. For example, when α is 50° (the angle between the XY plane and the horizontal plane is 40°), the size of G' is smaller than when α is 15° (the angle between the XY plane and the horizontal plane is 75°), and when α is 50°, the diffusion distance d3 of the first ink blot is smaller than the diffusion distance d4 of the first ink blot when α is 15°.

[0102] In this way, users can adjust the angle between the electronic device and the horizontal plane (equivalent to adjusting the direction and magnitude of the gravitational acceleration component) to make the electronic device generate diffusion ink marks with different diffusion effects, which helps to improve the user experience.

[0103] Scenario 2: An electronic device generates and displays a second ink stain that spreads along at least one direction based on motion acceleration.

[0104] In some embodiments, the aforementioned at least some directions of the diffusion of the first ink blot may include the direction of the motion acceleration component (or the opposite direction of the motion acceleration component, or the direction of the motion velocity, or the opposite direction of the motion velocity). The diffusion speed of the first ink blot along the motion acceleration component direction may be greater than the diffusion speed in other directions, and / or the diffusion distance of the first ink blot along the motion acceleration component direction may be greater than the diffusion distance in other directions, and / or the diffusion duration of the first ink blot along the motion acceleration component direction may be greater than the diffusion duration in other directions, and / or the rate of color decay (e.g., the rate of increase in brightness or luminance) of the first ink blot during diffusion along the motion acceleration component direction may be less than the rate of color brightness decay in other directions.

[0105] In some embodiments, at least one of the diffusion speed, diffusion distance, diffusion duration, and color decay speed of the first ink mark along the direction of the motion acceleration component can be positively correlated (or negatively correlated) with the magnitude of the motion acceleration component.

[0106] For example, the diffusion speed, diffusion distance, and diffusion time of the first ink mark along the direction of the motion acceleration component can increase with the increase of the motion acceleration component and decrease with the decrease of the motion acceleration component; the decay rate of the color during the diffusion process of the first ink mark along the direction of the motion acceleration component can decrease with the increase of the motion acceleration component and increase with the decrease of the motion acceleration component.

[0107] For example, the diffusion speed, diffusion distance, and diffusion time of the first ink mark along the direction of the motion acceleration component can decrease as the motion acceleration component increases and increase as the motion acceleration component decreases; the decay rate of color during the diffusion process of the first ink mark along the direction of the motion acceleration component can increase as the motion acceleration component increases and decrease as the motion acceleration component decreases.

[0108] For example, the diffusion speed, diffusion distance, diffusion time, and color decay rate of the first ink mark along the direction of the motion acceleration component can increase with the increase of the motion acceleration component and decrease with the decrease of the motion acceleration component.

[0109] It should be noted that the law of diffusion parameters changing with the motion acceleration component when the first ink spot diffuses along the direction of the motion acceleration component also applies to the case where the first ink spot diffuses in the opposite direction of the motion acceleration component, and is not limited here.

[0110] In some embodiments, the primary diffusion direction of the first ink mark spread by the electronic device can be the direction of the motion acceleration component. For example, FIG5A illustrates a schematic diagram of ink mark diffusion when the motion direction of the electronic device is not within the plane of the display screen, according to some embodiments of this application.

[0111] As shown in Figure 5A, after the user draws the first ink mark, they can control the electronic device to move along the F direction. The direction of the acceleration *a* is along the F direction, and the component of the acceleration *a* in the plane (XY plane) where the electronic device's display screen is located is *a'*. After detecting the movement, the electronic device can diffuse the first ink mark to obtain a second ink mark based on the direction (and / or magnitude) of the acceleration component *a'*. (Visually, the main diffusion direction of the second ink mark relative to the first ink mark is towards *a'*.) For example, the diffusion speed of pixels in the first ink mark towards *a'* can be greater than the diffusion speed of pixels in other directions (e.g., pixels in the opposite direction of *a'*), and the diffusion distance of pixels in the first ink mark towards *a'* can be greater than the diffusion distance of pixels in other directions (e.g., the diffusion distance of pixels in the opposite direction of *a'*), thus obtaining the second ink mark shown in Figure 5A. Visually, the main diffusion direction of the second ink mark relative to the first ink mark is towards *a'*.

[0112] In some embodiments, the primary diffusion direction of the first ink mark diffused by the electronic device can be the opposite direction of the motion acceleration component. For example, FIG5B, according to some embodiments of this application, shows a schematic diagram of an electronic device diffuses ink in the opposite direction of the motion acceleration component.

[0113] As shown in Figure 5B, after drawing the first ink mark, the user can control the electronic device to move along the F direction. The direction of the motion acceleration *a* is along the F direction, and the component of the motion acceleration *a* in the plane (XY plane) where the electronic device's display screen is located is *a'*, and the opposite direction of *a'* is *a″*. After detecting the movement of the electronic device, it can diffuse the first ink mark to obtain a second ink mark based on the direction (and / or magnitude) of the motion acceleration component *a'*, with *a″* as the main diffusion direction. For example, the diffusion speed of pixels in the first ink mark towards *a″* can be greater than the diffusion speed of pixels in other directions (e.g., pixels in the opposite direction of *a″*), and the diffusion distance of pixels in the first ink mark towards *a″* can be greater than the diffusion distance of pixels in other directions (e.g., the diffusion distance of pixels in the opposite direction of *a″*) diffused in the opposite direction of *a″*, thus obtaining the second ink mark shown in Figure 5B. Visually, the main diffusion direction of the second ink mark relative to the first ink mark is towards *a″*.

[0114] Due to inertia, when ink drips onto paper and the paper is moved, the ink will move or diffuse in the opposite direction to the direction of paper movement. Therefore, electronic devices can more realistically reflect the diffusion of ink by using the opposite direction of the acceleration component of motion as the primary diffusion direction.

[0115] In some embodiments, the direction of motion (or direction of acceleration) of the user-controlled electronic device can be within the plane of the electronic device's display. In this case, the acceleration component is equivalent to the acceleration itself (equivalent to the electronic device spreading the first ink mark in the direction of acceleration or the opposite direction of acceleration). Exemplarily, FIG5C shows a schematic diagram of ink mark spreading when the direction of motion of the electronic device is within the plane of the electronic device's display, according to some embodiments of this application.

[0116] As shown in Figure 5C, after drawing the first ink mark, the user can control the electronic device to move along the Y direction. The direction of the motion acceleration b is along the Y direction, and the component of motion acceleration b on the plane of the electronic device's display screen (XY plane) is motion acceleration b itself. After detecting the movement of the electronic device, it can diffuse the first ink mark to obtain a second ink mark based on the direction (and / or magnitude) of the motion acceleration b. For example, the diffusion speed of pixels in the direction of motion acceleration b can be greater than the diffusion speed of pixels in other directions (e.g., pixels in the opposite direction of motion acceleration b), and the diffusion distance of pixels in the direction of motion acceleration b can be greater than the diffusion distance of pixels in other directions (e.g., pixels in the opposite direction of motion acceleration b), thus obtaining the second ink mark shown in Figure 5C. Visually, the main diffusion direction of the second ink mark relative to the first ink mark is the direction of motion acceleration b.

[0117] In some embodiments, the diffusion parameters for each of the at least one direction of the first ink diffusion can be the same or different. At least one of the diffusion parameters is related to the motion acceleration of the electronic device. For example, at least one of the diffusion speed, diffusion distance, diffusion duration, and color decay rate can be positively (or negatively) correlated with the magnitude of the motion acceleration component.

[0118] In this way, after drawing the first ink mark, the user can adjust the motion acceleration of the electronic device to generate ink marks with different diffusion effects, which helps to improve the user experience.

[0119] Scenario 3: An electronic device generates and displays a second ink mark that spreads along at least one direction based on motion acceleration and gravitational acceleration.

[0120] In some embodiments, the aforementioned at least part of the direction of diffusion of the first ink blot may include the direction of the composite acceleration resulting from the combination of the motion acceleration component and the gravitational acceleration component (hereinafter referred to as the composite acceleration direction, which is equivalent to the direction of the component of the overall acceleration of the electronic device on the plane where the electronic device display screen is located). The diffusion speed of the first ink blot in the composite acceleration direction may be greater than the diffusion speed in other directions, and / or the diffusion distance of the first ink blot along the composite acceleration direction may be greater than the diffusion distance in other directions, and / or the diffusion duration of the first ink blot along the composite acceleration direction may be greater than the diffusion duration in other directions, and / or the color decay rate of the first ink blot during diffusion along the composite acceleration direction may be less than the color decay rate in other directions.

[0121] In some embodiments, at least one of the diffusion speed, diffusion distance, diffusion duration, and color decay speed of the first ink mark along the synthesis direction may be positively (or negatively) correlated with the magnitude of the gravitational acceleration component (or the angle between the plane where the electronic device display is located and the horizontal plane, or the angle between the plane where the electronic device display is located and the direction of gravitational acceleration), or the magnitude of the motion acceleration component, or the magnitude of the composite acceleration.

[0122] In this way, users can adjust the angle between the electronic device and the horizontal plane (equivalent to adjusting the direction and magnitude of the gravitational acceleration component) and / or adjust the motion acceleration of the electronic device to make the electronic device generate diffusion ink marks with different diffusion effects, which helps to improve the user experience.

[0123] The technical solutions of this application will now be introduced in conjunction with the aforementioned scenarios one through three.

[0124] For example, Figure 6 illustrates a flowchart of an ink generation method according to some embodiments of this application. The method is executed by an electronic device, such as a drawing application. As shown in Figure 6, the method includes:

[0125] S601: The user's operation of drawing the first ink mark was detected.

[0126] For example, when an electronic device detects that a user is drawing a first ink mark in the interface of a drawing application, it can trigger the method provided in the embodiments of this application.

[0127] For example, the user's operation of drawing the first ink mark can be an operation where the user selects a flowing brush (such as the aforementioned flat diffusion brush, gradient fill brush, dotted blending brush, water dissolving brush, wet texture brush, dotted brush, non-uniform flowing brush, water color scattering brush, wet splatter brush, etc.) and then slides it on the canvas using a stylus, finger (or other object that can be detected by the touch screen of an electronic device).

[0128] In some embodiments, brushes in painting applications whose diffusion parameters vary with acceleration data can also be configured independently of flow brushes, for example, configured as gravity brushes.

[0129] In some embodiments, after detecting the user's operation of drawing a first ink mark, the electronic device can repeatedly overlay the brush pattern of the brush selected by the user along the trajectory drawn by the user to generate and display the first ink mark.

[0130] S602: Based on acceleration data from an electronic device, generate and display a second ink stain that spreads in at least one direction from the first ink stain.

[0131] After detecting the user's action of drawing the first ink mark, the electronic device can acquire the acceleration data of the electronic device (such as the gravitational acceleration and / or the motion acceleration of the electronic device), and generate and display a second ink mark that gradually spreads outward from the first ink mark in at least one direction over time based on the acquired acceleration data.

[0132] In some embodiments, during the process of the first ink mark generated by the electronic device spreading into a second ink mark in at least one direction, multiple frames of images can be generated and displayed, in which the first ink mark can be represented as a second ink mark that gradually spreads over time.

[0133] In some embodiments, at least a partial diffusion parameter of the first ink spread along at least a portion of at least one of the at least one directions is associated with acceleration data. For example, the at least partial diffusion parameter may increase or decrease as the magnitude of the acceleration data increases.

[0134] In some embodiments, the electronic device may generate and display a second ink stain that spreads in at least one direction based on gravitational acceleration. The method by which the electronic device generates and displays a second ink stain that spreads in at least one direction based on gravitational acceleration can be referred to the aforementioned Scenario 1 and the embodiments of Figures 3A, 3B, and 4, and will not be elaborated upon here.

[0135] In some embodiments, when the electronic device's movement speed is less than a preset speed (or its acceleration is less than a preset acceleration, or the electronic device is stationary), the electronic device can generate and display a second ink mark that spreads in at least one direction based on the gravitational acceleration of the electronic device. This avoids the first ink mark spreading along the direction of acceleration due to accidental movement of the electronic device by the user.

[0136] In some embodiments, the electronic device may, upon detecting an operation by a user to adjust the angle between the plane of the electronic device’s display screen and the horizontal plane, acquire gravitational acceleration (or a component of gravitational acceleration), and generate and display a second ink mark that spreads in at least one direction based on the gravitational acceleration.

[0137] In some embodiments, the electronic device may generate and display a second ink mark that spreads in at least one direction based on gravitational acceleration, in response to an angle between the plane of the electronic device’s display screen and the horizontal plane (equivalent to the electronic device being tilted), and / or the angle being greater than a preset angle threshold.

[0138] In some embodiments, the electronic device may generate and display a second ink mark that spreads in at least one direction based on the gravitational acceleration of the electronic device, provided that the angle between the plane of the electronic device’s display screen and the horizontal plane is greater than a first angle, or the angle between the gravitational acceleration of the electronic device and the plane of the electronic device’s display screen is less than a second angle, or the magnitude of the gravitational acceleration component is greater than a preset acceleration magnitude.

[0139] In some embodiments, after detecting that a user has drawn a first ink mark, the electronic device can generate and display a second ink mark that spreads in at least one direction based on gravitational acceleration, provided that the user has adjusted the angle between the electronic device and the horizontal direction.

[0140] In some embodiments, after detecting that a user has drawn a first ink mark, the electronic device may generate and display a second ink mark that diffuses in at least one direction based on gravitational acceleration if the user adjusts the angle between the electronic device and the horizontal direction within a preset time period; if the user does not adjust the angle between the electronic device and the horizontal direction within the preset time period, the second ink mark that diffuses in at least one direction based on preset diffusion parameters (or a diffused ink mark without generating the first ink mark) may be generated and displayed.

[0141] In some embodiments, the electronic device may generate and display a second ink spot that spreads in at least one direction based on motion acceleration. The manner in which the electronic device generates and displays the second ink spot that spreads in at least one direction based on motion acceleration can be referred to in the aforementioned Scenario 2 and the embodiments of Figures 5A to 5C, and will not be repeated here.

[0142] In some embodiments, after the first ink mark is drawn, if the electronic device detects that its movement speed is greater than a preset speed, or its movement acceleration (or a component of movement acceleration) is greater than a preset movement acceleration, it can generate and display a second ink mark that spreads in at least one direction based on the movement acceleration of the electronic device. Based on this method, the electronic device only generates and displays the second ink mark that spreads in at least one direction based on the movement acceleration of the first ink mark when the speed or acceleration of the electronic device is relatively high. This avoids the first ink mark spreading along the direction of movement acceleration due to accidental movement of the electronic device by the user.

[0143] In some embodiments, the electronic device may, upon detecting a user's operation of moving the electronic device, acquire motion acceleration (or motion acceleration components) and generate and display a second ink mark that spreads in at least one direction based on the motion acceleration.

[0144] In some embodiments, the electronic device may, in response to a change in the motion speed or motion acceleration of the electronic device (equivalent to detecting an operation by the user to adjust the motion state of the electronic device), generate and display a second ink mark that spreads in at least one direction based on the motion acceleration.

[0145] In some embodiments, the electronic device can obtain a composite acceleration of the electronic device based on motion acceleration and gravitational acceleration (or directly measure the composite acceleration), and generate and display a second ink stain that spreads in at least one direction from the first ink stain based on the composite acceleration. For details, please refer to the content of Scenario 3 above, which will not be repeated here.

[0146] In some embodiments, after detecting that a user has drawn a first ink mark, the electronic device may generate and display a second ink mark that spreads in at least one direction based on the motion acceleration of the electronic device, provided that the user has moved the electronic device.

[0147] In some embodiments, after detecting that a user has drawn a first ink mark, the electronic device may generate and display a second ink mark that spreads in at least one direction based on the motion acceleration of the electronic device if the user's operation of moving the electronic device is detected within a preset time period; if the user's operation of moving the electronic device is not detected within the preset time period, the second ink mark that spreads in at least one direction based on preset diffusion parameters (or a diffused ink mark that does not generate the first ink mark) may be generated and displayed.

[0148] The following describes the specific method by which an electronic device generates a second ink mark that spreads in at least one direction based on acceleration data, from the first ink mark.

[0149] To facilitate understanding, we will first introduce a scheme for generating diffused ink marks by electronic devices without considering the acceleration data of the electronic devices.

[0150] In some embodiments, the electronic device can generate and display a second ink mark that diffuses in at least one direction from the first ink mark based on the paper resistance coefficient of each pixel in the canvas used to draw the first ink mark. The paper resistance coefficient of a pixel indicates the degree to which that pixel obstructs the color diffusion to that pixel; a higher paper resistance coefficient indicates a greater degree of obstruction and color attenuation when the ink mark diffuses to that pixel. For example, in the hue (H)-saturation (S)-lightness (L) color model (HSL), a higher paper resistance coefficient of a pixel results in a greater increase in lightness when the ink mark diffuses to that pixel. Similarly, in the hue-saturation-brightness (HSV or HSB) color model, a higher paper resistance coefficient of a pixel results in a greater increase in lightness when the ink mark diffuses to that pixel. For example, in a color model that uses ink volume for color mixing, higher ink volume corresponds to lower brightness, a higher paper texture coefficient for a pixel, and a greater attenuation of ink volume when ink spreads to that pixel. Specifically, higher brightness makes the color closer to white and lighter; higher brightness also makes the color closer to white.

[0151] In some embodiments, given a fixed initial value for the ink color (e.g., initial brightness, initial luminance, initial ink volume), the greater the paper texture resistance coefficient of the pixels through which the diffusion passes, the fewer pixels the color passes through to reach the threshold where it no longer diffuses (e.g., brightness or luminance increases to its maximum value, ink volume decreases to its minimum value) (the shorter the diffusion distance). Furthermore, given a fixed initial value for the ink color and a fixed time to diffuse one pixel, the greater the paper texture resistance coefficient of the pixels through which the diffusion passes, the shorter the diffusion time.

[0152] It should be noted that for different canvases configured in painting applications (such as the aforementioned gold-threaded silk, silver-threaded silk, Xuan paper, mineral pigments, rough-textured watercolor, fine-textured watercolor, and oil painting), the distribution of the paper texture resistance coefficient of each pixel in the canvas can be different to simulate the diffusion effect of ink on different types of paper. The paper texture resistance coefficient of canvases with different paper textures can be obtained through experiments, theoretical calculations, random generation, etc. For ease of description, the paper texture resistance coefficient of each pixel in canvases with different paper texture types obtained through experiments, theoretical calculations, random generation, etc., will be referred to as the initial paper texture resistance coefficient.

[0153] Below, we will introduce a diffusion model scheme based on the initial paper texture resistance coefficient, using different color models as examples.

[0154] We will begin by introducing the HSL color model as an example.

[0155] Based on the HSL color model, during the diffusion of the first ink blot in a certain direction, when pixel PA (with hue, saturation, and brightness of pixel PA as H0, S0, and L0 respectively, denoted as [H0, S0, L0]) diffuses towards pixel PB, the color parameters of pixel PB can be expressed as [H0, S0, L0 + DL], where DL is a parameter that increases with the increase of the initial paper texture resistance coefficient of pixel PB. Specifically, L0 + DL is greater than or equal to the upper limit value of brightness L. max In this case, the diffusion of pixel PA ends, and the color parameters of pixel PB can be represented as [H0, S0, L]. max ].

[0156] The following section describes how ink spreads in the HSL color model, specifically using the initial texture resistance coefficient. For example, Figure 7A, according to some embodiments of this application, illustrates a schematic diagram of generating and displaying a second ink spread in at least one direction based on the initial texture resistance coefficient of each pixel in the canvas.

[0157] As shown in Figure 7A, the M region of the canvas includes 6 pixels of the first ink blot (pixels P1 to P6 in row 0 of Figure 7A), and the initial paper texture obstruction coefficients of the 9 rows of pixels below these 6 pixels are as follows:

[0158] Row 1, Column 1 to Column 6: 0.5, 0.7, 0.6, 0.3, 0.6, 0.8;

[0159] Row 2, Columns 1 to 6: 0.8, 0.7, 0.3, 0.8, 0.5, 0.7;

[0160] Row 3, Columns 1 through 6: 0.6, 0.5, 0.7, 0.7, 0.5, 0.6;

[0161] Row 4, Columns 1 through 6: 0.5, 0.3, 0.5, 0.6, 0.6, 0.5;

[0162] Row 5, Columns 1 to 6: 0.3, 0.8, 0.8, 0.7, 0.7, 0.5;

[0163] Row 6, Columns 1 to 6: 0.5, 0.7, 0.6, 0.3, 0.6, 0.8;

[0164] Row 7, Columns 1 through 6: 0.8, 0.7, 0.3, 0.8, 0.5, 0.7;

[0165] Row 8, Columns 1 through 6: 0.6, 0.5, 0.7, 0.7, 0.5, 0.6;

[0166] Row 9, Columns 1 through 6: 0.5, 0.3, 0.5, 0.6, 0.6, 0.5.

[0167] With a color bit depth of 8 bits, the brightness value ranges from 0 to 255 (corresponding to 0% to 100%). Referring to Figure 7A, taking the diffusion of pixel P1 (brightness of 0) in the Y direction (i.e., the column direction shown in Figure 7A) as an example, with DL set to "64 × initial paper texture obstruction coefficient":

[0168] The brightness of the pixel in the first row and first column of the second ink mark is 0 + 64 × 0.5 = 32;

[0169] The brightness of the pixel in the second row and first column of the second ink mark is 32 + 64 × 0.8 = 83;

[0170] The brightness of the pixel in the third row and first column of the second ink mark is 83 + 64 × 0.6 = 122;

[0171] The brightness of the pixel in the 4th row and 1st column of the second ink mark is 122 + 64 × 0.5 = 154;

[0172] The brightness of the pixel in the 5th row and 1st column of the second ink mark is 122 + 64 × 0.3 = 173;

[0173] The brightness of the pixel in the 6th row and 1st column of the second ink mark is 173 + 64 × 0.5 = 205;

[0174] The brightness of the pixel in the 7th row and 1st column of the second ink mark is 205 + 64 × 0.8 = 256 (greater than the upper limit of brightness (255)) and the maximum value of the upper limit of brightness (255). Since 205 + 64 × 0.8 = 256 is greater than the upper limit of brightness, the diffusion of pixel P1 is stopped.

[0175] The diffusion process from pixel P2 to pixel P6 can be referred to the above process, and will not be repeated here.

[0176] Based on the above method, during the diffusion process of the first ink blot, the brightness of the pixels it diffuses into gradually increases. The further the pixels in the portion of the second ink blot that have diffused from the first ink blot are in the diffusion direction, the higher the brightness of the pixels and the lighter the color they display. This simulates the effect of ink spreading and blurring on real paper. In some embodiments, the electronic device can display multiple frames of intermediate ink blots transitioning from the first ink blot to the second ink blot. During the display of these multiple frames of intermediate ink blots, the brightness of each pixel gradually decreases from the brightness in the first ink blot to the brightness in the second ink blot. For example, if a pixel has a brightness of bs1 in the first ink blot, a brightness of bs2 in the second ink blot, and N frames from the first ink blot to the second ink blot, then in the N frames of intermediate ink blots, the brightness of this pixel can decrease by (bs2-bs1) / (N-1) per frame. It should be noted that the form in which the brightness of each pixel gradually decreases from the brightness in the first ink blot to the brightness in the second ink blot can also be other forms, which are not limited here.

[0177] It should be noted that the above example of DL being "64 × initial paper texture resistance coefficient" is merely one example. In other embodiments, DL can be calculated using any other method where DL increases with the increase of the initial paper texture resistance coefficient, and this is not limited here.

[0178] The following section introduces the diffusion ink scheme in the HSV color model.

[0179] Taking the HSV color model as an example, during the diffusion of the first ink blot in a certain direction, when pixel PA (hue, saturation, and lightness are H0, S0, and V0 respectively, denoted as [H0, S0, V0]) diffuses towards pixel PB, the color parameters of pixel PB can be expressed as [H0, S0, V0 + DV], where DV is a parameter that increases with the increase of the initial paper texture resistance coefficient of pixel PB. Specifically, when L0 + DV is greater than or equal to the upper limit value of lightness V... max In this case, pixel PA diffusion ends, and the color parameters of pixel PB can be represented as [H0, S0, V]. max ].

[0180] Based on the above method, the brightness of each pixel in the second ink blot can be obtained using the HSV color model. In the portion of the second ink blot that diffuses relative to the first ink blot, the farther the pixels are from the first ink blot in the diffusion direction, the higher the brightness of the pixels and the lighter the color they appear. In this way, the effect of ink spreading and blurring on real paper can be simulated.

[0181] In some embodiments, the electronic device can display a multi-frame intermediate ink swath that gradually transitions from a first ink swath to a second ink swath. During the display of this multi-frame intermediate ink swath, the brightness of each pixel gradually decreases from the brightness in the first ink swath to the brightness in the second ink swath. For example, if a pixel has a brightness of bs3 in the first ink swath, a brightness of bs4 in the second ink swath, and N frames are used to diffuse from the first ink swath to the second ink swath, then in the N intermediate ink swath frames, the brightness of this pixel can decrease by (bs4-bs3) / (N-1) per frame. It should be noted that the form in which the brightness of each pixel gradually decreases from the brightness in the first ink swath to the brightness in the second ink swath can also be other forms, which are not limited here.

[0182] It should be noted that the above method of obtaining the second ink mark by adjusting the brightness of each pixel in the diffusion direction based on the initial paper texture obstruction coefficient is only an example. In other embodiments, the second ink mark that diffuses in at least one direction from the first ink mark can also be generated by adjusting other color parameters of the pixels (such as ink volume, brightness, saturation, and the values ​​of each color channel in the color space (such as the values ​​of the red channel, green channel, and blue channel in the red-green-blue (RGB) color space). This is not limited here.

[0183] The following describes a scheme in a color model that uses ink volume to achieve color mixing. This scheme involves adjusting the ink volume based on the initial paper texture resistance coefficient to change the brightness of the color during the ink diffusion process, thereby generating diffused ink marks.

[0184] In some embodiments, during color processing, electronic devices can also generate diffused ink marks by adjusting other parameters affecting brightness in the color model based on different color models (or color mixing models) during the calculation of color diffusion, using the paper texture barrier coefficient. For example, in some color models, different brightness levels are obtained based on ink volume, etc. For instance, a higher ink volume value corresponds to a lower brightness (or less brightness), resulting in a visually darker color; conversely, a lower ink volume value corresponds to a higher brightness, resulting in a visually lighter color. Therefore, in some embodiments, brightness can be increased (color lighter) by reducing the ink volume of pixels during the diffusion process based on the paper texture barrier coefficient.

[0185] For example, the relationship between ink volume and brightness can be expressed as the following formula (1): BR=g(IN) (1)

[0186] In formula (1), BR represents brightness, IN represents ink volume, and the function g represents the function of BR changing with IN. In some embodiments, the function g can be a function that monotonically decreases within the range of IN, that is, the brightness decreases as the ink volume increases (equivalent to the color becoming darker as the ink volume increases).

[0187] The following section uses the amount of ink in a color as an example to introduce a color model based on the aforementioned amount of ink for color mixing.

[0188] The reflection spectrum RE(IN,λ) of a color P(IN) with ink volume IN to a wavelength λ can be expressed as formula (2):

[0189] In formula (2), K(IN, λ) represents the absorption coefficient of color P(IN) for light with wavelength λ, and S(IN, λ) represents the scattering coefficient of color P(IN) for light with wavelength λ.

[0190] Based on formula (2), with a light source of D65, the tristimulus values ​​of P(IN) based on the observer model of the International Commission on Illumination (CIE) can be expressed as formulas (3) to (5):

[0191] In the above formula, X(IN), Y(IN), and C(IN) represent the stimulation levels of the red primary color, the green primary color, and the blue primary color, respectively. Let D65(λ) represent the spectral power distribution of the D65 light source at wavelength λ. This indicates that the integration is performed within the visible light spectrum.

[0192] Based on the above formulas (3) to (5), the relationship between the pixel value of each color channel of color P(IN) in the RGB color space and the amount of ink IN can be expressed as the following formula (6).

[0193] In formula (6), R(IN), G(IN), and B(IN) represent the pixel values ​​of the red, green, and blue channels of color P(IN) in the RGB color space, respectively; Y D65This represents the luminance value of diffuse reflection under a D65 light source. It should be noted that the values ​​in formula (6) are just examples, and can be adjusted according to different needs in actual calculations, without limitation here.

[0194] Based on formulas (2) to (6) above, electronic devices can obtain the pixel values ​​of each channel in the RGB color space based on the color ink volume IN. Different values ​​of ink volume IN correspond to different values ​​of R(IN), G(IN), and B(IN). The relationship between R(IN), G(IN), B(IN) and brightness can be expressed as the following formula (7): BR=1.5-R(IN)×0.299+G(IN)×0.587+B(IN)×0.114 (7)

[0195] In formula (7), BR represents lightness. It should be noted that the values ​​in formula (8) are just examples. In actual calculations, they can be adjusted according to different needs, and no restrictions are imposed here.

[0196] Based on formulas (2) to (7), it can be seen that different values ​​of the amount of color ink correspond to different pixel values ​​in each channel of the RGB color space, and the corresponding brightness can also be different. Therefore, electronic devices can increase the brightness / brightness of the color by attenuating the amount of color ink based on the initial paper texture resistance coefficient, thereby making the ink appear lighter and lighter as it diffuses.

[0197] In some embodiments, the relationship between brightness and ink amount shown in the aforementioned formula (1) can be obtained by substituting formulas (2) to (6) into formula (7).

[0198] It should be noted that the aforementioned color ink volume IN can be the ink volume configured by the user based on the ink volume control 16, or it can be the weighted sum of the ink volume configured by the user based on the ink volume control 16 and the ink volume of the flowing brush selected by the user.

[0199] Based on the above formulas (2) to (6), after determining the ink amount IN of a pixel, the color of that pixel can be obtained (e.g., the pixel value of each channel in the RGB color space, or the value of the parameter representing color in other color spaces).

[0200] Based on the relationships shown in formula (1) or formulas (2) to (7), electronic devices can adjust the amount of ink in a pixel based on the paper texture resistance coefficient of each pixel during the color diffusion process to achieve the effect of ink diffusion. The larger the paper texture resistance coefficient of a pixel, the greater the attenuation of ink amount when the ink diffuses to that pixel. Several methods for adjusting ink amount based on the paper texture resistance coefficient are introduced below.

[0201] Method 1: When the ink volume of a pixel is IN0 and the initial paper texture obstruction coefficient of the next pixel to which it is to be diffused is BC1, the ink volume IN1 of the next pixel can be expressed as IN1 = IN0 - BC1 × e. Here, e is a positive number, such as a preset value, an empirical value, or an experimental value. In some embodiments, the value of e can be determined based on the range of ink volume values ​​and the range of initial paper texture obstruction coefficient values ​​to ensure that the ink volume IN1 obtained based on the above formula does not exceed the range of ink volume values. Specifically, when the pixel is a pixel within the first ink mark, IN0 can be the ink volume configured by the user based on the ink volume control 16, or the weighted sum of the ink volume configured by the user based on the ink volume control 16 and the ink volume of the flowing brush selected by the user; when the pixel is a pixel diffused to during the diffusion of the first ink mark, IN0 can be calculated based on the ink volume of the previous pixel, the obstruction coefficient of the pixel, and the above formula.

[0202] Method 2: When the ink volume of a pixel is IN0 and the initial paper texture obstruction coefficient is BC2, and the paper texture obstruction coefficient of the next pixel to which the ink is to be diffused is BC1, the ink volume IN1 of the next pixel can also be expressed as IN1 = IN0 - (h1 × BC1 + h2 × BC2) × e. Here, e is a positive number, such as a preset value, an empirical value, or an experimental value; h1 and h2 are coefficients used to weight BC1 and BC2, and can be preset values, empirical values, or experimental values. For example, the sum of h1 and h2 can be 1 (e.g., h1 = h2 = 0.5, h1 = 0.1 and h2 = 0.9, h1 = 0.6 and h2 = 0.4, etc.). In some embodiments, the values ​​of e, h1, and h2 can be determined based on the range of ink volume values ​​and the range of initial paper texture obstruction coefficient values ​​to ensure that the ink volume IN1 obtained based on the above formula does not exceed the range of ink volume values. In the case where the pixel is a pixel in the first ink mark, IN0 can be the ink volume configured by the user based on the ink volume control 16, or the weighted sum of the ink volume configured by the user based on the ink volume control 16 and the ink volume of the flowing brush selected by the user; in the case where the pixel is a pixel diffused to during the diffusion of the first ink mark, IN0 can be calculated based on the ink volume of the previous pixel, the obstruction coefficient of the pixel and the above formula.

[0203] Method 3: In some embodiments, the interaction between the pixel and other surrounding pixels can be considered during the calculation of the ink volume of each pixel, so as to make the ink calculation process more accurate.

[0204] For example, referring to Figure 7B, the pixel to the left of pixel P1 is pixel P2, the pixel to the right of pixel P1 is pixel P3, the pixel above pixel P1 is pixel P4, and the pixel below pixel P1 is pixel P5. The initial paper texture obstruction coefficients of pixels P1 to P5 are BC1 to BC5, and the ink amounts of pixels P1 to P5 are IN1 to IN5, respectively. Then, the ink amount IN1' of pixel P1 after diffusion can be expressed as the following formula (8): IN1'=IN1-D 12 +D 21 -D 13 +D 31 -D 14 +D 41 -D 15 +D 51 (8)

[0205] In formula (8), D 12 D 13 D 14 D 15 D represents the amount of ink diffused from pixel P1 to pixels P2 through P5 respectively. 21 D 31 D 41 D 51 These represent the amount of ink diffused from pixels P2 to P5 to pixel P1. Where D... ij With pixel P i and pixel P j The initial paper texture resistance coefficient is related to, for example, pixel P. i and / or pixel P j The larger the initial paper texture resistance coefficient, the more D ij The larger.

[0206] In some embodiments, D ij It can be represented as (h1×BC) i +h2×BC j )×e×IN i Where e, h1, and h2 can be positive real numbers, and e, h1, and h2 can be preset values, empirical values, or experimental values.

[0207] In some embodiments, when a pixel is a pixel in the first ink mark, the corresponding ink amount can be the ink amount configured by the user based on the ink amount control 16, or the weighted sum of the ink amount configured by the user based on the ink amount control 16 and the ink amount of the flowing brush selected by the user; when a pixel is a pixel diffused to during the diffusion of the first ink mark, the ink amount of that pixel can be calculated based on formula (8).

[0208] The ink volume is calculated based on the above formula (8). The diffusion effect between the pixel and the surrounding pixels can be taken into account, which can make the diffusion effect more accurate.

[0209] It should be noted that the methods for calculating ink volume attenuation shown in Methods 1 to 3 above are just examples. In other embodiments, other methods can also be used to calculate the ink volume error, which is not limited here.

[0210] In the process of generating each frame of ink, the electronic device can calculate the amount of ink in each pixel based on formula (8), and after obtaining the amount of ink in each pixel, convert the amount of ink into the pixel value in the RGB color space based on formulas (2) to (6) to obtain the color of each pixel. Based on the above method of calculating the color of each pixel in each frame of ink, the effect of the first ink stain gradually spreading into the second ink stain can be achieved.

[0211] In some embodiments, the diffusion distance and duration of color diffusion can be configured by setting a lifetime for each pixel containing the ink and a decay value of the lifetime during diffusion in different directions. For example, a pixel lifetime can be used to indicate the duration of color change of a pixel (or the number of frames of color change). For instance, if the lifetime of a pixel corresponds to 10 frames of images, the electronic device can gradually increase the amount of ink in the pixel from the amount of ink in the first ink stain to the amount of ink in the second ink stain in 10 consecutive frames of ink stains, so that the color of the pixel gradually deepens as the 10 frames of ink stains are displayed.

[0212] In some embodiments, for a pixel on the first ink mark, the lifetime T may be related to the amount of ink and / or water selected by the user (and may also be related to the type of brush selected). The greater the amount of water, the stronger the color fluidity, the greater the diffusion distance, the longer the diffusion time, and the longer the lifetime T.

[0213] For example, during diffusion, the lifetime of the pixel diffused to can be determined based on the lifetime of the pixels surrounding that pixel. The lifetimes of the four pixels above, below, to the left, and to the right of a given pixel are T, respectively. N T S T W T E In this case, the lifetime of the pixel can be T. N -dt、T S -dt、T W -dt、T E The maximum value in -dt, or T N -dt、T S The maximum value in -dt, or T E -dt、T WThe maximum value in -dt. Where dt is the decay value of the lifetime during diffusion.

[0214] Below, the lifetime of the pixels to which the ink spreads is defined as T. N -dt、T S -dt、T W -dt、T E Taking the maximum value in -dt as an example, a scheme for generating diffused ink based on formula (8) is introduced. For example, Figure 7C shows a schematic diagram of pixel lifecycle and ink diffusion according to some embodiments of this application.

[0215] Referring to Figure 7C, in the first frame image, the electronic device displays the ink blots (the three pixels in the first ink blot) drawn by the user in the third row and third column, the third row and fourth column, and the fifth row and fourth column, and configures a lifecycle of 8 for the three pixels (indicating that the color of the three pixels changes for 8 frames).

[0216] In the second frame, the three pixels from the first frame diffuse outwards in all directions, with the period of each diffused pixel being T. N -dt、T S -dt、T W -dt、T E The maximum value in -dt. Taking dt=1 as an example, for a pixel diffused from the 3rd row, 3rd column pixel to the 3rd row, 2nd column pixel, T N T S T W T E If the values ​​are 0, 0, 0, and 8 respectively, then the lifetime of the pixel in the 3rd row and 2nd column is the maximum value among 0-1, 0-1, 0-1, and 8-1 (7); for the pixel in the 3rd row and 3rd column and the pixel in the 4th row and 4th column that diffuses to the pixel in the 4th row and 3rd column, T N T S T W T E If the values ​​are 8, 0, 0, and 8 respectively, then the lifetime of the pixel in the 4th row and 3rd column is the maximum value among 8-1, 0-1, 0-1, and 8-1 (7). The calculation method for other pixels is similar and will not be repeated here. Accordingly, the amount of ink in each pixel in the second frame image can be calculated based on formula (8). Visually, the number of pixels with ink marks in the second frame image is increased by 7 pixels with a lifetime of 7 compared to the first frame image, and the color of the pixels with a lifetime of 8 appears darker due to the diffusion effect.

[0217] In the third frame, the seven pixels with a lifetime of 7 from the second frame diffuse outwards to their respective edges, with the period of each diffused pixel being T. N -dt、TS -dt、T W -dt、T E The maximum value in -dt. Taking dt=1 as an example, for a pixel diffused from the pixel in the 3rd row, 2nd column to the pixel in the 3rd row, 1st column, T N T S T W T E If the values ​​are 0, 0, 0, and 7 respectively, then the lifetime of the pixel in the 3rd row and 1st column is the maximum value among 0-1, 0-1, 0-1, and 7-1 (6). The calculation method for other pixels is similar and will not be repeated. Accordingly, the amount of ink in each pixel in the 3rd frame image can be calculated based on formula (8). Visually, the number of pixels with ink marks in the 3rd frame image has increased by 11 pixels with a lifetime of 6 compared to the 2nd frame image, and the colors of the pixels with lifetimes of 8 and 7 are darker due to the diffusion effect.

[0218] Similarly, in frame 4, the number of pixels with ink blots increases by 9 pixels with a lifetime of 5 compared to frame 3, and the colors of pixels with lifetimes of 8, 7, and 6 appear darker due to diffusion. In frame 5, the number of pixels with ink blots increases by 5 pixels with a lifetime of 4 compared to frame 4, and the colors of pixels with lifetimes of 8, 7, 6, and 5 appear darker due to diffusion. In frame 6, the number of pixels with ink blots increases by 1 pixel with a lifetime of 3 compared to frame 5, and the colors of pixels with lifetimes of 8, 7, 6, 5, and 4 appear darker due to diffusion. In frame 7, the number of pixels with ink blots is the same as in frame 6, and the colors of each pixel appear darker due to diffusion. In frame 8, the number of pixels with ink blots is the same as in frame 5, and the colors of each pixel appear darker due to diffusion.

[0219] After displaying the 8th frame image, the colors of pixels with lifetimes of 8, 7, 6, 5, 4, and 3 changed 8, 7, 6, 5, 4, and 3 times respectively. The number of frames in which the color of each pixel changed reached its corresponding lifetime, and the diffusion ended.

[0220] Based on the above method, in the second ink mark obtained by the diffusion of the first ink mark, the farther the pixel is from the first ink mark in the diffusion direction and the smaller the amount of ink in the pixel, the higher the brightness of the corresponding color and the lighter the color presented. In this way, the effect of ink diffusion and smudging on real paper can be simulated.

[0221] It should be noted that the color model described above is merely an example; electronic devices can use other color models to diffuse ink. Since different color models use different parameters to represent color, electronic devices can also adjust other parameters to achieve the effect of color changing from dark to light during ink diffusion, which is not limited here. For example, color parameters between color models can be converted to each other (e.g., brightness, ink volume, and luminance can be converted to pixel values ​​of various color channels in the RGB color space). Electronic devices can convert the aforementioned brightness, luminance, and ink volume to corresponding color parameters in other color models and adjust these corresponding color parameters to achieve the effect of color changing from dark to light during ink diffusion.

[0222] In the above-described scheme that achieves the diffusion of the first ink mark by adjusting the brightness, luminance, and ink volume during the ink diffusion process, the adjustment of brightness, luminance, and ink volume can be based on the initial paper texture resistance coefficient of each pixel in the canvas. Different initial paper texture resistance coefficients result in different diffused ink marks. Therefore, by correlating the acceleration data of the electronic device with the paper texture resistance coefficient, it is possible to generate diffused ink marks based on acceleration data.

[0223] The following describes a scheme for generating diffused ink marks on electronic devices, taking into account the acceleration data of the electronic devices.

[0224] Based on the above method, the electronic device can adjust the initial paper texture resistance coefficient of each pixel in the diffusion direction according to the acceleration data of the electronic device, and diffuse the first ink mark to obtain the second ink mark based on the adjusted paper texture resistance coefficient, thus obtaining a result that more closely resembles drawing on real paper. For ease of description, the paper texture resistance coefficient obtained after adjusting the initial paper texture resistance coefficient based on the acceleration data will be referred to as the first paper texture resistance coefficient.

[0225] For example, an electronic device can scale the paper texture resistance coefficient of the canvas based on the magnitude of the gravitational acceleration component (and / or the motion acceleration component, and / or the angle between the plane where the electronic device's display screen is located and the horizontal plane, or the angle between the plane where the electronic device's display screen is located and the direction of gravitational acceleration) to obtain a first paper texture resistance coefficient, and then spread the first ink mark based on the first paper texture resistance coefficient to obtain a second ink mark, so as to realize the correlation between the second ink mark and the acceleration data.

[0226] For example, during the scaling of the initial paper texture resistance coefficient, the larger the value of the gravitational acceleration component (or motion acceleration component, or the angle between the plane where the electronic device's display screen is located and the horizontal plane) of the electronic device, the smaller the scaled first paper texture resistance coefficient; or the smaller the angle between the plane where the electronic device's display screen is located and the direction of gravitational acceleration, the smaller the scaled first paper texture resistance coefficient. Thus, the larger the value of the gravitational acceleration component (or motion acceleration component, or the angle between the plane where the electronic device's display screen is located and the horizontal plane) (or the smaller the angle between the plane where the electronic device's display screen is located and the direction of gravitational acceleration), the smaller the first paper texture resistance coefficient, the smaller the increase in brightness (or luminance) of the ink spreading to each pixel (or the smaller the decrease in ink volume) (equivalent to a smaller degree of color attenuation), and the more pixels the ink needs to pass through to increase its brightness (or luminance) to the upper limit of brightness (or luminance) (or decrease its ink volume to the lower limit of ink volume) (equivalent to a larger diffusion distance). Furthermore, with the diffusion speed remaining constant, the more pixels the brightness (or luminance) needs to pass through to reach the upper limit of brightness (or luminance) (or the ink volume needs to be reduced to the lower limit of ink volume), the longer the diffusion time will be.

[0227] For example, an electronic device can adjust the paper texture obstruction coefficient of each pixel in the canvas based on the following formula (9): B1=B0×f(A) (9)

[0228] In formula (9), B1 is the first paper texture obstruction coefficient, B0 is the initial paper texture obstruction coefficient; A represents the component of gravitational acceleration, or the component of motion acceleration, or the combined acceleration of the component of gravitational acceleration and the component of motion acceleration, or the angle between the plane where the electronic device display screen is located and the horizontal plane, or the angle between the plane where the electronic device display screen is located and the gravitational acceleration (0° to 90°); f(A) represents a function that decreases as the value of the component of gravitational acceleration (or the component of motion acceleration, or the combined acceleration) (or the angle between the plane where the electronic device display screen is located and the horizontal plane (0° to 90°)) increases, or a function that increases as the angle between the plane where the electronic device display screen is located and the direction of gravitational acceleration increases.

[0229] For example, when A is the angle between the plane of the electronic device's display screen and the direction of gravitational acceleration, f(A) can be a function such as 1-cos(A) or sin(A). As another example, when A is a component of gravitational acceleration (or a component of motion acceleration, or a resultant acceleration), f(A) can be u×A+v (where u is a positive number and v is a real number) or u×A (where u is a positive number).

[0230] In some embodiments, during the process of generating and displaying a second ink stain that spreads from a first ink stain in at least one direction, the electronic device may generate and display a multi-frame animation of the transition from the first ink stain to the second ink stain, so that the user can visually perceive that the first ink stain gradually spreads to form the second ink stain.

[0231] In some embodiments, when the area where the second ink mark is to be displayed has a background or other ink marks already drawn on it, the effect displayed on the interface of the electronic device is the color of the second ink mark mixed with the background or other ink marks. For example, if the background is red and the second ink mark is blue, the area where the second ink mark is located in the interface displayed by the electronic device is actually yellow.

[0232] In some embodiments, the electronic device may not adjust the generation of the second ink mark using the paper texture resistance coefficient, but may instead diffuse the second ink mark based on acceleration data using other methods. This application does not limit the scope of the embodiments. For example, the electronic device may first construct a functional relationship between the diffusion parameters and the acceleration data. After acquiring the acceleration data, the electronic device can directly obtain the diffusion parameters corresponding to the acceleration data based on this functional relationship. As another example, the electronic device may use a pre-trained artificial intelligence model to input the acceleration data and the first ink mark into the artificial intelligence model to obtain the second ink mark (hereinafter, the intermediate ink mark between the first and second ink marks).

[0233] Based on the above method, the electronic device can diffuse a first ink blot to obtain a second ink blot based on the acceleration data of the electronic device. With different acceleration data, the electronic device will produce different second ink blots from the same first ink blot. Thus, users can control the electronic device to generate different second ink blots by adjusting the acceleration data (e.g., adjusting the motion acceleration of the electronic device, the angle between the electronic device and the horizontal plane (equivalent to adjusting the direction and / or magnitude of the gravitational acceleration component)), to more realistically simulate the diffusion effect of ink on real paper, thereby improving the user experience.

[0234] Below, we introduce a software architecture applicable to the ink generation method provided in the embodiments of this application.

[0235] For example, FIG8 illustrates a schematic diagram of a software architecture according to some embodiments of the present application.

[0236] As shown in Figure 8, the software architecture of an electronic device can be a layered architecture, which may include, for example, an application layer, a framework layer, a service layer, and a kernel layer.

[0237] The application layer can include applications in electronic devices, such as drawing applications.

[0238] In some embodiments, the electronic device can generate and display a first ink mark by running a drawing application, and generate and display a second ink mark obtained by the first ink mark along at least one direction based on the acceleration data of the electronic device.

[0239] In some embodiments, the drawing application may include a brush engine. The brush engine can obtain touch information (e.g., touch position, touch pressure, tilt angle of the stylus and the electronic device display) from the input subsystem and obtain the trajectory drawn by the user on the electronic device based on the touch information. Then, the brush engine can call the GPU to render a first ink mark based on parameters such as the brush pattern of the brush selected by the user, through the graphics subsystem, graphics processing unit (GPU) driver, etc. The brush engine can also obtain acceleration data of the electronic device from the accelerometer or gyroscope based on the sensor driver (e.g., the smart hub driver), and obtain ink mark data of a second ink mark (and an intermediate ink mark between the first and second ink marks) based on the first ink mark, the brush selected by the user, and the acceleration data of the electronic device. Then, it calls the GPU to render the images of the second ink mark and the intermediate ink mark through the graphics subsystem, GPU driver, etc., and displays the images of the second ink mark and the intermediate ink mark on the display screen through the display chip driver.

[0240] The framework layer provides application programming interfaces (APIs), programming frameworks, and capability frameworks for the application. The service layer is a collection of operating system capabilities used to provide services to the application through the framework layer.

[0241] In some embodiments, the framework layer and service layer may include subsystems for implementing relevant functions in an electronic device, such as an input subsystem, a graphics subsystem, etc.

[0242] The input subsystem is used to acquire touch information such as the user's touch position and touch pressure on the touch sensor through the touch chip driver, and to acquire touch information such as the pressure sensitivity level (used to indicate the pressure exerted between the stylus and the touch sensor during the user's writing process) and tilt angle (the angle between the stylus axis and the plane where the touch sensor (or display screen) is located) transmitted by the stylus through the star flash driver (or other wireless communication methods). The acquired touch information is then passed to the drawing application (such as the brush engine).

[0243] The graphics subsystem is used to render an image of the ink based on the ink data generated by the brush engine, calling the GPU or / or other graphics processing devices, and then displaying the ink image on the display screen through the display chip driver.

[0244] In other embodiments, the framework layer and service layer may include more or fewer modules, which is not limited here.

[0245] The kernel layer includes the operating system kernel (not shown) and the hardware drivers for electronic devices, such as drivers for touch chips, LEDs, sensors, GPUs, and display chips. Drawing applications or modules in the framework / service layer can use these hardware drivers to call the hardware to implement related functions. For example, a touch chip driver can be used to acquire touch information from the user on the touch sensor; an LED driver is used to communicate with other devices based on the LED; a sensor driver can be used to acquire data collected by the sensor; a GPU driver can be used to call the GPU to implement graphics processing functions; and a display chip driver can be used to drive the display screen to display images.

[0246] In other embodiments, the kernel layer may also include more or fewer modules, which is not limited here.

[0247] In other embodiments, the software architecture of the electronic device may include more or fewer layers, or may employ other architectures, which are not limited herein.

[0248] The technical solution of this application will be introduced below with reference to the software architecture shown in Figure 8.

[0249] For example, Figure 9 illustrates a process diagram of a painting application implementing the aforementioned ink generation method according to some embodiments of this application. The subject executing this method can be an electronic device, such as a painting application in an electronic device. As shown in Figure 9, the process includes:

[0250] S1, User drawing detected.

[0251] When a user draws ink on the touchscreen of an electronic device using a stylus, the stylus can transmit a marking signal to the touchscreen as long as the pen tip touches the touchscreen. The touch chip driver can obtain touch information (such as touch position (indicating the position where the stylus is in contact with the touchscreen) and touch pressure (indicating the pressure applied by the user when drawing)) based on the marking signal and changes in electrical signals (such as changes in capacitance, inductance, voltage, and current) detected by the device's detection circuit on the touchscreen, and then send the touch information to the input subsystem. The stylus can also send the touch information detected by the stylus (such as pressure sensitivity level and tilt angle) to the electronic device via wireless communication methods such as a stylus flash, and the stylus flash driver in the electronic device will then transmit it to the input subsystem. The input subsystem can then pass the touch information to the drawing application.

[0252] After receiving touch information from the input subsystem, the drawing application can detect the user's drawing and trigger the generation of ink marks.

[0253] S2 generates the first ink mark based on the brush pattern.

[0254] When a drawing application (such as a brush engine) detects user drawing (e.g., after receiving touch information), it can perform anomaly detection, filtering, and curve fitting (e.g., spline curve fitting) on ​​the user's touch position based on the touch information to obtain the trajectory drawn by the user. Then, the drawing application can call the GPU through the graphics subsystem, GPU driver, etc., to repeatedly overlay the brush pattern along the trajectory drawn by the user based on the brush parameters selected by the user (e.g., brush pattern, brush color, brush transparency, size, water volume, ink volume, etc.) and render it to obtain the first ink mark.

[0255] S3 displays the first ink mark.

[0256] After the first ink blot is rendered, the painting application can display the first ink blot on the screen.

[0257] In some embodiments, the painting application may also display one or more acceleration selection controls on the screen. These acceleration selection controls provide an entry point for selecting the acceleration data to be used to diffuse the first ink blot. For example, referring to Figure 10, the painting application may display a tilt control U21 (for selecting gravitational acceleration) and a shake control U22 (for selecting motion acceleration).

[0258] It should be noted that S2 and S3 can be executed in parallel.

[0259] S4, detects a change in the angle between the plane where the electronic device's display screen is located and the horizontal plane, or detects that the user is moving the electronic device.

[0260] After displaying the first ink mark, the drawing application can trigger the ink mark generation method provided in this application to diffuse the first ink mark to obtain a second ink mark if it detects a change in the angle between the plane where the electronic device's display screen is located and the horizontal plane, or if the user moves the electronic device.

[0261] In some embodiments, the drawing application may also trigger the diffusion of the first ink mark under other circumstances. For example, when the angle between the plane of the electronic device's display screen and the horizontal plane is greater than a first angle, the drawing application may trigger the diffusion of the first ink mark based on the ink mark generation method provided in the embodiments of this application. It should be noted that S4 is optional, and the drawing application may also execute S5 directly after executing S3, which is not limited here.

[0262] S5, acquire acceleration data.

[0263] When a trigger to spread the first ink mark is detected (e.g., a change in the angle between the plane of the electronic device's display and the horizontal plane is detected, or the user moves the electronic device), the drawing application can obtain acceleration data collected by the electronic device's sensors (e.g., gyroscope, accelerometer, acceleration sensor, etc.) through sensor driving to obtain the electronic device's gravitational acceleration (or gravitational acceleration component), motion acceleration (or motion acceleration component), and composite acceleration.

[0264] For example, a drawing application can detect the direction and magnitude of the gravitational acceleration component when it detects that the user has adjusted the angle between the plane of the electronic device's display and the horizontal plane.

[0265] For example, a drawing application can obtain the direction and magnitude of motion acceleration components when it detects the user's operation of moving electronic devices.

[0266] For example, a drawing application can acquire gravitational acceleration when the user selects gravitational acceleration based on the acceleration selection control; and / or, acquire motion acceleration when the user selects motion acceleration based on the acceleration selection control. For example, in the case shown in Figure 10, the drawing application can acquire gravitational acceleration in response to the user selecting the tilt control U21, or acquire motion acceleration in response to the user selecting the shake control U22, or acquire both gravitational acceleration and motion acceleration in response to the user selecting both the tilt control U21 and the shake control U22.

[0267] S6, Based on acceleration data, generate and display a second ink mark that spreads from the first ink mark in at least one direction.

[0268] After acquiring acceleration data, the drawing application can generate and display a second ink mark that spreads from the first ink mark in at least one direction.

[0269] For example, a painting application can scale the initial paper texture resistance coefficient of each pixel in the image where the first ink blot is drawn based on the magnitude of the gravitational acceleration component to obtain a first paper texture resistance coefficient. The larger the magnitude of the gravitational acceleration component, the smaller the first paper texture resistance coefficient of each pixel, resulting in less color attenuation when the ink spreads to each pixel. Then, the painting application can adjust the brightness, luminance, or ink volume of the ink blot based on the first paper texture resistance coefficient to generate a second ink blot that spreads in at least one direction from the first ink blot. Since the first paper texture resistance coefficient decreases with increasing gravitational acceleration component, the diffusion distance and / or diffusion duration of the second ink blot can increase with increasing gravitational acceleration component magnitude. Based on this, the user can adjust the angle between the plane of the electronic device's display screen and the horizontal plane to adjust the magnitude and direction of the gravitational acceleration component, thereby adjusting the diffusion parameters of the second ink blot generated by the painting application.

[0270] In some embodiments, during the process of adjusting the initial paper texture resistance coefficient of each pixel, the scaling degree (e.g., scaling ratio) can be different for different directions. For example, taking the first ink blot as a dividing line, the magnification factor of the initial paper texture resistance coefficient of each pixel along the direction of gravitational acceleration can be smaller than the magnification factor of the initial paper texture resistance coefficient of each pixel in other directions (the reduction factor of the initial paper texture resistance coefficient of each pixel along the direction of gravitational acceleration can be greater than the reduction factor of the initial paper texture resistance coefficient of each pixel in other directions). Thus, during the diffusion process of the first ink blot, the diffusion distance of the first ink blot along the direction of gravitational acceleration is greater than the diffusion distance in other directions, and / or the color attenuation rate when diffusing along the direction of gravitational acceleration is less than the color attenuation rate in other directions, so visually the first ink blot diffuses along the direction of gravitational acceleration.

[0271] For example, a painting application can scale the initial paper texture resistance coefficient of each pixel in the image where the first ink blot is drawn based on the magnitude of the motion acceleration component. The larger the magnitude of the motion acceleration component, the smaller the scaled first paper texture resistance coefficient of each pixel, resulting in less color attenuation when the ink spreads to each pixel. Then, the painting application can adjust the brightness, lightness, or luminance of the ink blot color based on the first paper texture resistance coefficient to generate a second ink blot that spreads in at least one direction from the first ink blot. Since the first paper texture resistance coefficient decreases as the motion acceleration component increases, the diffusion distance and / or diffusion duration of the second ink blot can increase as the magnitude of the motion acceleration component increases. Based on this, the user can adjust the motion acceleration of the electronic device to adjust the magnitude and direction of the motion acceleration component, thereby adjusting the diffusion parameters of the second ink blot generated by the painting application.

[0272] In some embodiments, during the process of adjusting the initial paper texture resistance coefficient of each pixel, the scaling degree (e.g., scaling ratio) can vary for different directions. For example, using the first ink blot as a dividing line, the magnification factor of the initial paper texture resistance coefficient of each pixel along the direction of motion acceleration component can be smaller than the magnification factor of the initial paper texture resistance coefficient of each pixel in other directions (the reduction factor of the initial paper texture resistance coefficient of each pixel along the direction of motion acceleration component can be greater than the reduction factor of the initial paper texture resistance coefficient of each pixel in other directions). Thus, during the diffusion process of the first ink blot, the diffusion distance of the first ink blot along the direction of motion acceleration is greater than the diffusion distance in other directions, and / or the color attenuation rate when diffusing along the direction of motion acceleration is less than the color attenuation rate in other directions, so visually the first ink blot appears to diffuse along the direction of motion acceleration.

[0273] In some embodiments, the drawing application may generate a second ink blot based on an acceleration selected by the user. For example, in the case shown in Figure 10, the drawing application may generate a second ink blot based on gravitational acceleration in response to the user selecting the tilt control U21, or based on motion acceleration in response to the user selecting the shake control U22, or generate a second ink blot based on both gravitational acceleration and motion acceleration in response to the user selecting both the tilt control U21 and the shake control U22.

[0274] The specific method for generating and displaying a second ink spot that spreads in at least one direction based on acceleration data can be referred to the aforementioned S602, and will not be repeated here.

[0275] Based on the above process, after generating and displaying the first ink mark, the electronic device can generate and display a second ink mark that spreads in at least one direction based on the acceleration data of the electronic device (such as gravitational acceleration, motion acceleration, etc.). Thus, since the second ink mark is generated based on the acceleration data of the electronic device, the user can change the acceleration data of the electronic device by adjusting the angle between the plane of the screen and the horizontal plane, or the motion acceleration of the electronic device, thereby enabling the electronic device to generate different second ink marks and improving the user experience.

[0276] It should be noted that the ink generation method provided in this application embodiment can be applied to any electronic device, including but not limited to electronic drawing boards, electronic blackboards, smart homes, mobile phones, smart TVs, wearable devices, laptops, tablets, industrial control devices, autonomous driving devices (such as vehicle systems), terminal devices in smart grids, terminal devices in transportation safety, terminal devices in smart cities, terminal devices in smart homes (such as whole-house smart hosts), and so on.

[0277] For example, FIG11 shows a schematic diagram of the hardware structure of an electronic device 10 according to an embodiment of the present application. The electronic device 10 can be used to implement the ink generation method provided in the embodiments of the present application.

[0278] As shown in Figure 11, the electronic device 10 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, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a proximity 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.

[0279] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0280] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, GPUs, image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0281] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0282] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the aforementioned memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0283] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 10, and can also be used for data transfer between electronic device 10 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0284] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 10. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0285] The power management module 141 connects 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, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0286] The wireless communication function of electronic device 10 can be implemented through antenna 1, wireless communication module 160, modem processor and baseband processor, etc.

[0287] Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.

[0288] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 10, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and near link (NL). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The aforementioned GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), BeiDou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite-based augmentation systems (SBAS).

[0289] The wireless communication module 160 receives electromagnetic waves via antenna 1, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 1.

[0290] In some embodiments, the wireless communication module 160 can be used to communicate with other devices (such as a stylus) to obtain parameters such as the pressure sensitivity level and tilt angle of the stylus.

[0291] Electronic device 10 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0292] 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), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 10 may include one or N display screens 194, where N is a positive integer greater than 1. In some embodiments, the display screen 194 can be used to display the aforementioned first ink mark and second ink mark.

[0293] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 10 may include one or N cameras 193, where N is a positive integer greater than 1.

[0294] Video codecs are used to compress or decompress digital video. Electronic device 10 may support one or more video codecs. Thus, electronic device 10 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0295] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0296] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as the aforementioned drawing application), etc. The data storage area may store data created during the use of electronic device 10 (such as the aforementioned initial paper texture obstruction coefficient, first paper texture obstruction coefficient, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 10 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.

[0297] Electronic device 10 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, and application processor.

[0298] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0299] Speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 10 can listen to music or make hands-free calls through speaker 170A. Receiver 170B, also known as a "handset," is used to convert audio electrical signals into sound signals. Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0300] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 10 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 10 detects the intensity of the touch operation (as the pressure of the user-drawn trajectory) based on pressure sensor 180A. Electronic device 10 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands.

[0301] In some embodiments, the pressure sensor 180A can be used to detect the touch pressure applied by a user's finger or stylus to the touch sensor 180K.

[0302] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 10. In some embodiments, the angular velocity of the electronic device 10 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B, thereby obtaining the acceleration data of the electronic device 10.

[0303] The accelerometer 180E can detect the magnitude of the acceleration of the electronic device 10 in various directions (generally three axes). When the electronic device 10 is stationary, it can detect the magnitude and direction of gravity.

[0304] In some embodiments, the electronic device 10 may acquire the gravitational acceleration and / or motion acceleration experienced by the electronic device 10 based on the gyroscope sensor 180B and / or the accelerometer sensor 180E.

[0305] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event, allowing the application processor to obtain touch information (e.g., touch location) from the user using a stylus, finger, etc. In some embodiments, touch sensor 180K may also be located on the surface of electronic device 10, in a different position than display screen 194.

[0306] In some embodiments, when a stylus, a user's finger, or the like approaches or touches the touch sensor 180K, the electrical signals (e.g., capacitance, inductance, voltage, current) in the area touched by the stylus or user's finger change. The touch sensor 180K can determine the location touched by the stylus or user's finger based on this change in electrical signal and transmit the location to the processor 110. The processor 110 can obtain the trajectory drawn by the user based on the location touched by the stylus or user's finger and obtain the aforementioned first ink mark by repeatedly superimposing the brush pattern along the trajectory.

[0307] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The electronic device 10 can receive button input and generate key signal inputs related to user settings and function control of the electronic device 10.

[0308] Motor 191 can generate vibration alerts.

[0309] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0310] It should be noted that the structure of the electronic device 10 shown in the foregoing embodiment is only an example. In other embodiments, the electronic device may include more or fewer modules, or some modules may be combined or split, which is not limited here.

[0311] This application also provides a computer program product, which may be a software or program product including instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, the at least one computing device implements the ink generation method provided in this application.

[0312] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any storage medium (e.g., magnetic medium, optical medium, semiconductor medium, etc.) capable of storing and / or retrieving data by a computing device. The computer-readable storage medium includes instructions that direct a computing device to implement the ink generation method provided in this application.

[0313] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.

[0314] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0315] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating ink marks, applied to electronic devices, characterized in that, include: The user's action of drawing the first ink mark on the first interface was detected; A second ink mark is generated and displayed based on the acceleration data of the electronic device, which spreads along at least one direction along the first ink mark, wherein the acceleration data includes at least one of the following: the motion acceleration of the electronic device, and the gravitational acceleration experienced by the electronic device.

2. The method according to claim 1, characterized in that, The diffusion parameter of the first ink mark increases or decreases with the increase of the first component of the gravitational acceleration on the plane where the display screen of the electronic device is located, or increases or decreases with the increase of the second component of the motion acceleration on the plane where the display screen is located, wherein the diffusion parameter includes at least one of the following parameters: diffusion speed, diffusion duration, diffusion distance, and color decay rate during diffusion.

3. The method according to claim 2, characterized in that, The generation and display of a second ink stain that spreads along at least one direction based on the acceleration data of the electronic device includes: Obtain the first component; A second ink mark is generated and displayed based on the first component, which spreads along the first ink mark in at least one direction, wherein the at least one direction includes the first direction in which the first component is located.

4. The method according to claim 3, characterized in that, At least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction increases with the increase of the first component, or the color decay rate of the first ink stain during diffusion along the first direction decreases with the increase of the first component.

5. The method according to claim 4, characterized in that, The second ink mark, generated based on the first component and displayed to spread along at least one direction of the first ink mark, includes: Obtain the paper texture resistance coefficient of the canvas on which the first ink mark is drawn, and adjust the paper texture resistance coefficient based on the first component. The adjusted paper texture resistance coefficient decreases as the first component increases. The paper texture resistance coefficient is used to indicate the degree of obstruction of color by pixels in the canvas. The degree of obstruction of color by pixels increases as the corresponding paper texture resistance coefficient increases. Based on the adjusted paper texture resistance coefficient, a second ink mark is generated and displayed that spreads along at least one direction from the first ink mark.

6. The method according to any one of claims 1 to 5, characterized in that, Generating and displaying a second ink stain that spreads along at least one direction based on the acceleration data of the electronic device includes: A second ink mark is generated and displayed based on the gravitational acceleration if at least one of the following conditions is met: the movement speed of the electronic device is less than a first speed threshold, the movement acceleration is less than a first acceleration threshold, the electronic device is stationary, the component of the gravitational acceleration in the plane of the electronic device's display screen is greater than a second acceleration threshold, and a user instruction to diffuse the first ink mark by gravitational acceleration is detected. And / or, based on the motion acceleration, a second ink stain is generated and displayed to spread the first ink stain along the at least one direction, provided that at least one of the following conditions is met: the motion speed of the electronic device is greater than a second speed threshold, the motion acceleration is greater than a third acceleration threshold, the component of the gravitational acceleration in the plane of the electronic device display screen is less than a fourth acceleration threshold, and a user instruction to spread the first ink stain by motion acceleration is detected.

7. The method according to claim 1, characterized in that, The generation and display of a second ink stain that spreads along at least one direction based on the acceleration data of the electronic device includes: In response to the existence of a first angle between the plane of the display screen of the electronic device and the horizontal plane and / or the first angle being greater than the first angle and / or the first angle changing, a second ink stain is generated and displayed based on the gravitational acceleration, which spreads the first ink stain in at least one direction. Alternatively, in response to a change in the motion state of the electronic device, a second ink stain is generated and displayed based on the motion acceleration, spreading the first ink stain in at least one direction.

8. The method according to claim 7, characterized in that, When the first included angle is a first value, the diffusion speed of the first ink mark is a first diffusion speed, the diffusion duration of the first ink mark is a first duration, the diffusion distance of the first ink mark is a first distance, and the decay speed of the color of the first ink mark is a first decay speed. When the first included angle is the second value, the diffusion speed of the first ink stain is the second diffusion speed, the diffusion duration of the first ink stain is the second duration, the diffusion distance of the first ink stain is the second distance, and the decay speed of the color of the first ink stain is the second decay speed, wherein the second value is greater than the first value; Wherein, the first diffusion rate is less than the second diffusion rate, and / or the first duration is less than the second duration, and / or the first distance is less than the second distance, and / or the first decay rate is greater than the second decay rate.

9. The method according to claim 2, characterized in that, The generation and display of a second ink stain that spreads along at least one direction based on the acceleration data of the electronic device includes: The system detects that the user moved the electronic device after drawing the first ink mark. Based on the motion acceleration corresponding to the movement operation, a second ink stain is generated and displayed that spreads along the first ink stain in at least one direction, wherein the at least one direction includes a second direction, which is the direction of the second component, or the direction opposite to the direction of the second component, or the direction of the movement operation, or the direction opposite to the direction of the movement operation.

10. The method according to claim 9, characterized in that, At least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the second direction increases with the increase of the second component, or the color decay rate during the diffusion of the first ink stain along the second direction decreases with the increase of the second component.

11. The method according to claim 10, characterized in that, The step of generating and displaying a second ink stain that spreads along at least one direction based on the motion acceleration corresponding to the movement operation includes: Obtain the paper texture resistance coefficient of the canvas on which the first ink mark is drawn, and adjust the paper texture resistance coefficient based on the second component. The adjusted paper texture resistance coefficient decreases as the second component increases. The paper texture resistance coefficient is used to indicate the degree of obstruction of color by pixels in the canvas. The degree of obstruction of color by pixels increases as the corresponding paper texture resistance coefficient increases. Based on the adjusted paper texture resistance coefficient, a second ink mark is generated and displayed that spreads along at least one direction from the first ink mark.

12. The method according to claim 1, characterized in that, The generation and display of a second ink stain that spreads along at least one direction based on the acceleration data of the electronic device includes: The second angle between the plane where the display screen of the electronic device is located and the horizontal plane, or the third angle between the plane where the display screen is located and the direction of the gravitational acceleration, is determined based on the gravitational acceleration. Based on the second included angle or the third included angle, a second ink mark is generated and displayed that spreads along the first ink mark in at least one direction, wherein the at least one direction includes a first direction, which is the direction in which the gravitational acceleration is located in the first component of the electronic device.

13. The method according to claim 12, characterized in that, At least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction decreases as the second included angle increases; or at least one of the diffusion distance, diffusion duration, and diffusion speed of the first ink stain spreading along the first direction increases as the third included angle increases; or the color decay rate of the first ink stain spreading along the first direction increases as the second included angle increases; or the color decay rate of the first ink stain spreading along the first direction decreases as the third included angle increases.

14. The method according to claim 3, characterized in that, The at least one direction includes a third direction, which is the direction of the acceleration after the first component and the second component are combined.

15. A readable storage medium, characterized in that, The readable storage medium includes one or more programs that, when executed on an electronic device, cause the electronic device to implement the ink generation method according to any one of claims 1 to 14.

16. An electronic device, characterized in that, include: Memory, used to store one or more programs; A processor for executing the one or more programs to cause the electronic device to implement the ink generation method according to any one of claims 1 to 14.

17. A program product, characterized in that, When the program product is executed on an electronic device, it causes the electronic device to implement the ink generation method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Method and device for generating images in ink and wash painting style

    CN103116898A

  • Method for generating writing brush handwriting

    CN103559732A

  • Stroke selection method and device and intelligent terminal

    CN113296616A

  • Picture style illustration drawing method for ink painting style Chinese painting by using ipad

    CN117078804A

  • Writing brush handwriting real-time simulation method

    CN118114457A