Image editing method and apparatus, and electronic device

By applying CUVA HDR technology on electronic devices, highlighter effects are generated based on the brush brightness parameters set by the user and the initial brightness value of the HDR image, which solves the problem of single brush effects, meets the user's personalized needs and improves the brush effects diversity and authenticity.

WO2024255266A1PCT designated stage expired Publication Date: 2024-12-19HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/074800
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-16
Filing Date
2024-01-30
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

When users use the brush function of electronic devices, the brush generated is too single and it is difficult to meet personalized needs.

Method used

Using CUVA HDR technology, based on the brush brightness parameters set by the user and the initial brightness value of the HDR image, the brightness value of the pixel points in the brush effect area is determined, highlighter effects are generated, and the diversity of the brush effects is improved.

Benefits of technology

By generating highlighter effects, we can meet users' personalized needs and improve the diversity and authenticity of brush effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024074800_19122024_PF_FP_ABST
    Figure CN2024074800_19122024_PF_FP_ABST
Patent Text Reader

Abstract

An image editing method and apparatus, and an electronic device. The method comprises: receiving paint brush parameters determined by a user, wherein the paint brush parameters comprise: a first brightness parameter and a first line width parameter; detecting a first operation, which is based on a first image, of the user, and determining trajectory information, wherein the trajectory information is used for representing the trajectory of the first operation, the first image is a high-dynamic-range (HDR) image, image information of the first image comprises a second brightness parameter, and the second brightness parameter is used for representing the initial brightness of pixel points in the first image; determining a target area in the first image on the basis of the trajectory information and the first line width parameter among the paint brush parameters; and determining a brightness value of the pixel points in the target area on the basis of the first brightness parameter and the second brightness parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Image editing method, device and electronic equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 16, 2023, with application number 202310717824.X and application name “A method, device and electronic device for image editing”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic devices, and in particular to an image editing method, device, and electronic device. Background Art

[0003] With the development of electronic device technology, electronic devices have increasingly rich image editing functions. Users can edit images through electronic devices to meet their needs in various application scenarios.

[0004] For example, a user can use the brush function in the image editing function on an electronic device to annotate, draw, doodle, sign, and perform other operations on an image (such as a photo, screenshot, etc.) to achieve personalized editing of the image.

[0005] However, when using the brush function, users can usually only adjust the brush color, brush thickness and brush stroke shape, which results in the brush effect generated on the image being too simple and difficult to meet the user's personalized needs for diversified brush effects.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide an image editing method, apparatus, and electronic device. The method enables the electronic device to determine the brightness values ​​of pixels in a brush effect area generated by an HDR image based on the China Ultra High-Definition Video Industry Alliance (CUVA) high dynamic range (HDR) technology according to a brush brightness parameter set by the user and the initial brightness value of the HDR image, so that the brush effect generated by the electronic device in the HDR image can present a fluorescent pen effect, thereby improving the diversity of brush effects and meeting the personalized needs of users.

[0008] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0009] In a first aspect, an image editing method is provided. Specifically, the method includes: first, an electronic device receives a brush parameter determined by a user, and the brush parameter includes: a first brightness parameter and a first line width parameter. Then, the electronic device detects a first operation of the user based on the first image and determines trajectory information. The trajectory information is used to characterize the trajectory of the first operation. The first image is a high dynamic range imaging HDR image, and the image information of the first image includes a second brightness parameter, which is used to characterize the initial brightness of the pixel points in the first image. Next, the electronic device can determine the target area, that is, the brush area, in the first image based on the trajectory information and the first line width parameter in the brush parameter. Finally, the electronic device can determine the brightness value of the pixel points in the above-mentioned target area based on the first brightness parameter and the second brightness parameter, that is, generate a brush effect that can present a fluorescent pen effect.

[0010] In this method, the electronic device can optimize the brightness values ​​of pixels in a target area generated in the first image based on the first brightness parameter and the second brightness parameter based on CUVA HDR technology, thereby determining the brightness values ​​of the pixels in the target area. This enables the brush effect generated by the electronic device in the first image to present a highlighter effect, thereby increasing the diversity of brush effects and meeting the personalized needs of users.

[0011] In combination with the first aspect, in an optional implementation, the electronic device determines the target area in the first image based on the trajectory information and the first line width parameter, specifically including: the electronic device determines the target area based on the trajectory information and the second line width parameter. The second line width parameter is greater than the first line width parameter, and the second line width parameter is associated with the first line width parameter. For example, the second line width parameter can be determined by the electronic device based on the first line width parameter and the first coefficient. For another example, the second line width parameter can also be determined by the electronic device based on the first line width parameter and the first preset value. In this implementation, the target area determined by the electronic device is an area expanded based on the trajectory information and the first line width parameter. In this way, the electronic device can process parameters such as the brightness value of the pixel points in the target area to achieve a highlighter effect and improve the authenticity of the highlighter effect.

[0012] In combination with the first aspect, in an optional implementation, the first image includes: a first layer, which may be, for example, an HDR gain map (HDRGainMap). The information of the first layer includes: a second brightness parameter. The target area includes: a first target sub-area, which is obtained by mapping the first layer based on the second line width parameter and trajectory information. In this implementation, the electronic device can determine the first target sub-area in the first layer of the first image. In this way, the electronic device can determine the brightness value of the pixel point in the target area based on the first brightness parameter and the second brightness parameter.

[0013] In conjunction with the first aspect, in one optional implementation, the first target sub-region includes a first sub-region, and the first sub-region is determined in the first layer based on the first line width parameter and trajectory information. In this implementation, the electronic device can determine the first sub-region in the first layer based on the first line width parameter and trajectory information, and can determine the brightness values ​​of the pixels in the first sub-region based on the first brightness parameter. This allows the electronic device to further optimize the brightness values ​​of the pixels in the first target sub-region to enhance the authenticity of the highlighter effect.

[0014] In combination with the first aspect, in an optional implementation, the electronic device determines the brightness value of the pixel point in the target area based on the first brightness parameter and the second brightness parameter, including: first, the electronic device sets the brightness value of each pixel point in the first sub-area to the first brightness parameter. Then, the electronic device divides the first target sub-area into multiple second sub-areas along the trajectory direction of the first operation with a first preset length. Finally, the electronic device determines the brightness value of the pixel point in each second sub-area based on the second brightness parameter and the first brightness parameter corresponding to each second sub-area in the multiple second sub-areas. In this implementation, the electronic device can optimize the brightness value of the pixel point in each second sub-area based on the initial brightness of the pixel point in each second sub-area and the first brightness parameter determined by the user. In this way, the display effect of each second sub-area can be made closer to the highlighter effect, so as to further improve the authenticity of the highlighter effect generated by the electronic device.

[0015] In conjunction with the first aspect, in an optional implementation, the electronic device determines the brightness value of a pixel in each second subregion based on the second brightness parameter and the first brightness parameter corresponding to each second subregion in a plurality of second regions, including: first, the electronic device determines the first brightness difference value corresponding to each second subregion based on the second brightness parameter and the first brightness parameter corresponding to each second subregion. Then, the electronic device determines the blur radius corresponding to each second subregion based on the first brightness difference value corresponding to each second subregion, where the blur radius is negatively correlated with the first brightness difference value. Finally, the electronic device determines the brightness value of the pixel in each second subregion based on the blur radius corresponding to each second subregion. In this implementation, the electronic device can determine the blur radius corresponding to each second subregion based on the characteristics of the first brightness difference value of the pixel in each second subregion. Furthermore, the electronic device can determine the brightness value of the pixel in each second subregion based on the blur radius, thereby further improving the authenticity of the generated fluorescent brush effect.

[0016] In conjunction with the first aspect, in one optional implementation, the brush parameters further include a first color parameter. The method further includes the electronic device determining the color values ​​of pixels in the target area based on the first color parameter. In this way, the electronic device can further determine the color values ​​of pixels in the target area based on the first color parameter, thereby further enhancing the authenticity of the highlighter effect.

[0017] In combination with the first aspect, in an optional implementation, the first image further includes: a second layer, which may be, for example, a standard dynamic range (SDR) image. The information of the second layer includes: a second color parameter, which is used to characterize the initial color of the pixel in the first image. The target area may further include: a second target sub-area, which is obtained by the electronic device mapping the second layer according to the first line width parameter and the trajectory information. The electronic device determines the color value of the pixel in the target area according to the first color parameter, specifically including: the electronic device determines the color value of the pixel in the second target sub-area according to the first color parameter. In this implementation, the electronic device can determine the second target sub-area in the second layer of the first image. In this way, the electronic device can determine the color value of the pixel in the target area according to the first color parameter and the second color parameter.

[0018] In conjunction with the first aspect, in one optional implementation, the electronic device determines the color value of a pixel in the second target subregion based on the first color parameter, including: the electronic device adds the second color parameter corresponding to the pixel in the second target subregion to the first color parameter to obtain the color value of the pixel in the second target subregion. In this way, the electronic device can quickly determine the color of the brush effect.

[0019] In combination with the first aspect, in an optional implementation, the electronic device determines the color value of the pixel in the second target sub-area based on the first color parameter, including: first, the electronic device extracts the third sub-area in the second target sub-area, and the third sub-area is used to display the first content. In an optional implementation, the first content is text content. Then, the electronic device retains the second color parameter corresponding to the pixel in the third sub-area; finally, the electronic device adds the second color parameter corresponding to the pixel in the fourth sub-area to the first color parameter to obtain the color value of the pixel in the fourth sub-area, and the fourth sub-area is the area outside the third sub-area in the second target sub-area. In this way, the brush effect generated by the electronic device can better highlight the original display content in the first image (i.e., the above-mentioned first content), so as to further improve the authenticity of the highlighter effect and meet the personalized needs of users.

[0020] In conjunction with the first aspect, in an optional implementation, the method further includes: first, the electronic device determines a target pixel in the target area according to a random algorithm; then, the electronic device sets the brightness value of the target pixel to a third brightness parameter, where the third brightness parameter is greater than the first brightness parameter and greater than the second brightness parameter. In this way, the electronic device can generate a sequin-like highlighter effect in the first image, further increasing the diversity of brush effects and improving the user experience.

[0021] In a second aspect, an image editing device is provided. Specifically, the image editing device includes: a receiving module and a processing module. The receiving module is used to receive brush parameters determined by the user, and the brush parameters include: a first brightness parameter and a first line width parameter. The processing module is used to detect a first operation of the user based on a first image, determine trajectory information, and the trajectory information is used to characterize the trajectory of the first operation. The first image is a high dynamic range imaging (HDR) image, and the image information of the first image includes a second brightness parameter, and the second brightness parameter is used to characterize the initial brightness of the pixel points in the first image. The processing module is also used to determine the target area in the first image based on the trajectory information and the first line width parameter. The processing module is also used to determine the brightness value of the pixel points in the target area based on the first brightness parameter and the second brightness parameter.

[0022] Based on CUVA HDR technology, the image editing device can optimize the brightness values ​​of pixels in a target area generated in a first image according to a first brightness parameter and a second brightness parameter, thereby determining the brightness values ​​of the pixels in the target area. This enables the brush effect generated by the electronic device in the first image to present a fluorescent pen effect, thereby increasing the diversity of brush effects and meeting the personalized needs of users.

[0023] In a third aspect, an electronic device is provided, comprising: a memory, one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in the first aspect above and any one of its optional methods.

[0024] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method as described in the first aspect and any one of its optional methods.

[0025] In a fifth aspect, a computer program product is provided, which, when executed on a computer, enables the computer to execute the method according to the first aspect and any one of its optional methods.

[0026] It can be understood that the beneficial effects that can be achieved by the electronic device of the third aspect, the computer-readable storage medium of the fourth aspect, and the computer program product of the fifth aspect can be referred to the beneficial effects of the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG1 is an application scenario diagram of a brush effect generation method provided by an embodiment of the present application;

[0028] FIG2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0029] FIG3 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;

[0030] FIG4 is a flow chart of an image editing method provided in an embodiment of the present application;

[0031] FIG5 is a schematic diagram of a display interface of an electronic device provided in an embodiment of the present application;

[0032] FIG6 is a schematic diagram of an electronic device generating a first image according to an embodiment of the present application;

[0033] FIG7 is a schematic diagram of initiating a first operation according to an embodiment of the present application;

[0034] FIG8 is a schematic diagram of a target area determined by an electronic device according to an embodiment of the present application;

[0035] FIG9 is a schematic diagram of an electronic device editing an image according to an embodiment of the present application;

[0036] FIG10 is a schematic diagram of a second target sub-area determined by an electronic device according to an embodiment of the present application;

[0037] FIG11 is a schematic structural diagram of an image editing device provided in an embodiment of the present application;

[0038] FIG12 is a schematic diagram showing the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.

[0040] With the development of electronic device technology, electronic devices have increasingly rich image editing functions. Users can edit images through electronic devices to meet their needs in various application scenarios.

[0041] For example, users can use the brush function in the image editing function on electronic devices to annotate, draw, doodle, and other edits on images (such as photos and screenshots) to highlight key content in the image. For another example, users can use the brush function on electronic devices to sign images (such as document images) to implement electronic signatures on electronic devices.

[0042] However, when using the brush function, users can usually only adjust the brush color, brush thickness and brush stroke shape, which results in a relatively simple brush effect generated on the image and is difficult to meet the user's personalized needs for diversified brush effects.

[0043] In order to solve the problem that the brush effect generated by an electronic device is single when using the brush function to edit an image. The embodiment of the present application provides an image editing method, which can be applied to application scenarios where electronic devices perform annotation, drawing and other editing on images based on the brush function. Specifically, the method enables the electronic device to determine the brightness value of the pixel points in the brush effect area generated in the first image based on the brush brightness parameters set by the user, the initial brightness value of the HDR image to be edited (hereinafter referred to as the first image) and the user's operation trajectory based on CUVA HDR technology, so that the brush effect generated by the electronic device in the first image can present a fluorescent pen effect, thereby improving the diversity of the brush effects and meeting the personalized needs of users.

[0044] For example, the electronic devices in the embodiments of the present application may include, but are not limited to, smartphones, netbooks, tablet computers, smart watches, smart bracelets, phone watches, smart cameras, PDAs, personal computers (PCs), personal digital assistants (PDAs), portable multimedia players (PMPs), augmented reality (AR) / virtual reality (VR) devices, televisions, projection devices, or somatosensory game consoles in human-computer interaction scenarios. Alternatively, the electronic devices may be other types or structures, which are not limited in the present application.

[0045] Among them, the electronic device in the embodiment of the present application can support CUVA HDR technology, that is, the electronic device can generate images in HDR format. A target application (Application, APP) for realizing the picture editing function is running in the electronic device, and the user can use the human-computer interaction unit of the electronic device, such as the display screen (or touch screen) of a mobile phone, to use the "brush" function provided in the target application. Figure 1 is an application scenario diagram of a brush effect generation method provided in an embodiment of the present application. As shown in Figure 1, by controlling the "brush" to slide in the application interface, a corresponding brush trajectory can be generated, thereby completing functions such as annotation and drawing. Among them, the "brush" logo in the figure is only exemplary, and the pen touch point can also be identified by an identifier such as a "dot", or it may not be displayed.

[0046] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0047] Please refer to Figure 2, which is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. The methods in the following embodiments can be implemented in a mobile phone having the above hardware structure.

[0048] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, and the like.

[0049] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

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

[0051] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0052] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0053] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0054] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0055] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0056] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

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

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

[0059] Display screen 194 is used to display images, videos, and the like. 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 MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0060] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0061] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0062] Touch sensor 180B, also known as a "touch panel," can be disposed on display screen 194. The touch sensor 180B and display screen 194 form a touch screen, also known as a "touch screen." Touch sensor 180B is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 194. In other embodiments, touch sensor 180B can also be disposed on the surface of electronic device 100, at a location different from that of display screen 194.

[0063] In an embodiment of the present application, when the electronic device 100 is the electronic device in the aforementioned embodiment, the processor 110 can receive the brush parameters determined by the user through the display screen 194, such as a first brightness parameter and a first line width parameter. The processor 110 can detect the user's first operation based on the first image through the pressure sensor 180A or the touch sensor 180B to determine the trajectory information. Furthermore, the processor 110 can determine the target area in the first image based on the trajectory information and the first line width parameter. Finally, the processor 110 can determine the brightness value of the pixel point in the target area based on the first brightness parameter and the second brightness parameter. In this way, the brush effect generated by the electronic device can achieve a fluorescent pen effect and improve the diversity of the brush effect.

[0064] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0065] FIG3 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0066] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

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

[0068] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

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

[0070] As shown in FIG3 , the application framework layer may include a brush module, a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0071] The brush module is used to determine the brightness value of the pixel points in the brush effect area according to the initial brightness value of the image and the brightness parameter determined by the user to achieve a fluorescent pen effect.

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

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

[0074] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

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

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

[0077] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0078] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

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

[0080] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

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

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

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

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

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

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

[0087] The following describes an image editing method provided by an embodiment of the present application. The electronic device described below may specifically refer to the components shown in FIG. 2 and the application framework layer shown in FIG. 3 . FIG. 4 is a flow chart of an image editing method provided by an embodiment of the present application. As shown in FIG. 4 , the method may include the following steps S101-S104:

[0088] S101: The electronic device receives brush parameters determined by a user.

[0089] In the embodiments of the present application, brush parameters are user-determined parameters related to the electronic device generating a brush effect, and are used by the electronic device to generate the corresponding brush effect based on the brush parameters. Specifically, the brush parameters may include: a first brightness parameter and a first line width parameter. The first brightness parameter is the brightness value of the brush line determined by the user, and the first line width parameter is the width value of the brush line determined by the user, that is, the thickness of the brush line.

[0090] In one implementation, when a user edits an image through an application with an image editing function in an electronic device (hereinafter referred to as the first application), the electronic device can display a setting control for brush parameters in the display interface of the first application, so that the user can input the brush parameters through the setting control for brush parameters, so that the electronic device receives the brush parameters determined by the user. For example, Figure 5 is a schematic diagram of an electronic device display interface provided by an embodiment of the present application. As shown in Figure 5 (a), the electronic device displays a first brightness parameter setting control (such as a "brightness" control 5011) and a first line width parameter setting control (such as a "thickness" control 5012) in the display interface 501 of the first application. Among them, the "brightness" control and the "thickness" control are exemplary names, and are also replaced with names with the same or similar functions. The embodiment of the present application does not limit the names of the controls,

[0091] Taking the example of an electronic device receiving a first brightness parameter determined by a user, in one example, as shown in FIG5(b), after the user clicks the "Brightness" control 5011, the electronic device may display a brightness value input box 50111. Furthermore, the user may enter the determined first brightness parameter through the brightness value input box 50111 to transmit the first brightness parameter to the electronic device, thereby enabling the electronic device to receive the first brightness parameter.

[0092] In another example, as shown in FIG5(c), after the user clicks the "Brightness" control 5011, the electronic device may display a scale bar 50112 with a brightness value and a slider 50113. Furthermore, the user may slide the slider 50113 so that the brightness value corresponding to the position of the slider 50113 at the scale bar 50112 is a determined first brightness parameter, thereby sending the first brightness parameter to the electronic device, so that the electronic device can receive the first brightness parameter.

[0093] In one implementation, after a user inputs a determined first brightness parameter through the brightness value input box, the electronic device may display the display interface of the first application at the brightness value of the first brightness parameter. Alternatively, as the user slides slider 50113, the electronic device displays the display interface of the first application at the brightness value corresponding to the position of slider 50113 at scale bar 50112. This allows the user to intuitively understand the effect of the electronic device displaying the first brightness parameter, thereby improving the user experience.

[0094] S102: The electronic device detects a first operation of the user based on the first image and determines trajectory information.

[0095] The image information of the first image includes a second brightness parameter, which is used to characterize the initial brightness of pixels in the first image. In an embodiment of the present application, the first image is an HDR format image (hereinafter referred to as an HDR image), which can be generated by an electronic device based on the original image using CUVA HDR technology.

[0096] In one example, FIG6 is a schematic diagram of an electronic device generating a first image provided by an embodiment of the present application. As shown in FIG6(a), when the original image is an unprocessed raw data format (RAW Image Format) image, such as a ProRAW image, i.e., an original image with a file extension of .dng, the electronic device can generate a gain table map (GainTableMap), which can be composed of a 32-bit two-dimensional table. The GainTableMap can store information such as the initial brightness (i.e., the second brightness parameter) of pixels in the original image, thereby combining it with the original ProRAW image to obtain an HDR image, i.e., the first image.

[0097] In another example, as shown in FIG6(b), when the original image is a high efficiency image file format (HEIF) image, that is, an original image with a file suffix of .heic, the electronic device can generate a gain map (GainMap) with the same width and height as the original image, through which information such as the initial brightness (i.e., the second brightness parameter) of the pixels in the original image can be stored, thereby combining it with the original HEIF image to obtain an HDR image, i.e., the first image.

[0098] In another example, as shown in (c) in FIG6 , when the original image is a Joint Photographic Experts Group (JPEG) image, that is, an original image with a file extension of .jpg. The electronic device can generate an HDR gain map (HDRGainMap) and an SDR image based on the original image. The height and width of the HDRGainMap can be the same as the height and width of the original image, respectively. In some implementations, in order to save storage resources of the electronic device, the height and width of the HDRGainMap can also be half of the height and width of the original image, respectively. Information such as the original brightness (i.e., the second brightness parameter) of the pixels in the original image can be stored through the HDRGainMap. The image information of the SDR image includes the original color of the pixels in the original image. In this way, the electronic device combines the HDRGainMap with the SDR image to obtain an HDR image, i.e., the first image.

[0099] In an embodiment of the present application, the electronic device may display a first image on a display screen of a first application, so that a user can initiate a first operation based on the first image. The first operation may be a sliding operation, a clicking operation, etc. Furthermore, the electronic device may determine trajectory information based on a trajectory formed on the display screen by the first operation, and the trajectory information is used to represent the trajectory of the first operation.

[0100] In one implementation, the trajectory information may be coordinate matrix information, i.e., including coordinate values ​​of the trajectory points formed by the first operation on the display screen, so that the electronic device can accurately determine the location of generating the brush effect in the first image through the trajectory information.

[0101] In some embodiments, the above-mentioned first operation can be an operation initiated by a user to the electronic device through an interactive unit of the electronic device, such as a display screen (specifically, a touch display screen). Figure 7 is a schematic diagram of initiating the first operation provided in an embodiment of the present application. In one implementation, as shown in (a) in Figure 7, the user can perform operations such as sliding operations on the display screen of the electronic device with a finger to initiate the first operation. When the user slides his finger on the display screen, it triggers a change in the capacitance of the display screen. The electronic device can determine the position of the user's finger on the display screen by detecting the information of the capacitance change of the display screen, thereby obtaining the trajectory information corresponding to the first operation, which is used to characterize the trajectory of the first operation, such as trajectory 701 in Figure 7.

[0102] In other embodiments, as shown in (b) of FIG7 , the user may also perform sliding operations or other operations on the display screen of the electronic device through an interactive unit such as a stylus to initiate the first operation. Exemplarily, the stylus may include: an inductive pen and a capacitive pen. When the user slides on the display screen with the inductive pen, the electronic device may sense the electrical energy from the inductance meter through the electromagnetic induction plate integrated in the display screen, determine the position of the inductive pen in the display screen, and thereby obtain trajectory information corresponding to the first operation. When the user slides on the display screen with the capacitive pen, it will cause a change in the capacitance value at the contact position between the capacitive pen and the display screen. The electronic device may determine the position of the capacitive pen in the display screen based on the detected capacitance value, and obtain trajectory information corresponding to the first operation, for use in characterizing the trajectory of the first operation, such as trajectory 702 in FIG7 .

[0103] S103: The electronic device determines a target area in the first image according to the trajectory information and the first line width parameter.

[0104] In an embodiment of the present application, the electronic device can determine the area for generating a brush effect in the first image based on the trajectory information and the first line width parameter, that is, the brush area, which can also be called the target area.

[0105] Illustratively, the electronic device may take the trajectory determined by the trajectory information as the center and extend half of the first line width parameter to both sides in the first image, thereby obtaining the target area.

[0106] In some embodiments, the target area can also be determined by the electronic device in the first image based on the trajectory information and a second line width parameter. The second line width parameter is associated with the first line width parameter. If the second line width parameter is greater than the first line width parameter, the target area is larger than the area determined by the electronic device based on the trajectory information and the first line width parameter.

[0107] In some embodiments, the second line width parameter can be determined by the electronic device based on the first line width parameter and the first coefficient. For example, the first coefficient can be half, that is, the second line width parameter can be half of the first line width parameter. For another example, the first coefficient can also be fifth, that is, the second line width parameter can also be fifth of the first line width parameter. Specifically, the specific value of the first coefficient can be determined based on the requirements for the brush effect in actual application, and this application does not impose any specific restrictions on this.

[0108] In other embodiments, the second line width parameter can also be determined by the electronic device based on the first line width parameter and a preset fixed value (hereinafter referred to as the first preset value). For example, the first preset value can be preset to 0.5 millimeters (mm), and the second line width parameter is the sum of the first line width parameter and 0.5 mm. For another example, the first preset value can also be preset to 1 mm, and the second line width parameter is the sum of the first line width parameter and 1 mm. Specifically, the first preset value can be determined based on the requirements for the brush effect in actual applications, and this application does not make any specific limitations on this.

[0109] FIG8 is a schematic diagram of a target area provided in an embodiment of the present application. As shown in FIG8 , a target area 801 is determined by the electronic device based on a trajectory 8011 represented by trajectory information and a length 8014 corresponding to a second line width parameter.

[0110] The target area 801 includes not only the area determined by the trajectory 8011 obtained based on the user's trajectory information and the first line width parameter 8015 (i.e., area 8012 in FIG8 ), but also includes an extended area (i.e., area 8013 in FIG8 ). This allows the electronic device to process parameters such as the brightness value of the pixels in the target area to achieve a highlighter effect and improve the authenticity of the highlighter effect.

[0111] S104: The electronic device determines the brightness value of the pixel in the target area according to the first brightness parameter and the second brightness parameter.

[0112] In the embodiment of the present application, the electronic device can determine the brightness value of the pixels in the target area by combining the brush brightness determined by the user (i.e., the first brightness parameter) and the initial brightness of the pixels in the first image (i.e., the second brightness parameter). In this way, the electronic device can generate a brush effect with brightness (such as a highlighter effect) in the first image, and improve the authenticity of the brush effect generated by the electronic device.

[0113] The specific implementation method of S104 is exemplarily described below by taking the original image of the first image as the above-mentioned JPEG image as an example.

[0114] FIG9 is a schematic diagram of an electronic device editing an image provided in an embodiment of the present application. As shown in FIG9 , when the original image of first image 901 is a JPEG image, first image 901 may include an HDRGainMap, namely, a first layer 902, wherein information of first layer 902 includes a second brightness parameter. The target area may include a first target sub-area 9021, which is mapped by the electronic device in the first layer based on the second line width parameter and trajectory information.

[0115] Exemplarily, as shown in FIG9 , when the height and width of the first layer are respectively half of the height and width of the original image, the electronic device can use one-quarter of the second line width parameter as the line width on the first layer and one-quarter of the trajectory information (i.e., the trajectory information is proportionally reduced by one-quarter) to determine the first target sub-area.

[0116] Furthermore, in some embodiments, the first target sub-area 9021 includes a first sub-area 90211 , which is determined by the electronic device in the first layer according to the first line width parameter and the trajectory information.

[0117] Then, in the above S104, the electronic device determines the brightness value of the pixel point in the target area according to the first brightness parameter and the second brightness parameter, which may specifically include S1041-S1043:

[0118] S1041. The electronic device sets the brightness value of each pixel in the first sub-region to the first brightness parameter, that is, the electronic device fills the first sub-region according to the first brightness parameter determined by the user, so that the display brightness of the first sub-region is the brightness corresponding to the first brightness parameter.

[0119] S1042: The electronic device divides the first target sub-region into a plurality of second sub-regions along a trajectory direction of the first operation with a first preset length.

[0120] Furthermore, as shown in FIG9 , the electronic device can determine a trajectory 90212 of the first operation based on the trajectory information, and then divide the first target sub-region 9021 into a plurality of second sub-regions 90214 at a first preset length 90213 along the trajectory 90212 of the first operation. In this way, the electronic device can optimize the brightness value of the pixel points in each second sub-region based on the brightness characteristics of each second sub-region.

[0121] In one implementation, the first preset length may be associated with a first line width parameter, i.e., the first preset length may be determined based on the first line width parameter and a second coefficient. For example, the second coefficient may be 5, i.e., the first preset length may be 5 times the first line width parameter. For another example, the second coefficient may be 10, i.e., the first preset length may be 10 times the first line width parameter. Specifically, the specific value of the second coefficient may be determined based on the requirements for the brush effect in actual applications, and this application does not impose any specific restrictions on this.

[0122] In another implementation, the first preset length can also be a preset fixed value. For example, the first preset length can be preset to 1 mm. For another example, the first preset length can be preset to 3 mm. Specifically, the value of the first preset length can be determined based on the requirements for the brush effect in actual applications, and this application does not impose any specific limitations on this.

[0123] S1043: The electronic device determines a brightness value of a pixel point in each second sub-region according to the second brightness parameter and the first brightness parameter corresponding to each second sub-region in the plurality of second sub-regions.

[0124] In this way, the electronic device can optimize the brightness value of the pixel points in each second sub-area by combining the initial brightness of the pixel points in each second sub-area and the first brightness parameter determined by the user, so that the display effect of each second sub-area is closer to the highlighter effect, thereby further improving the authenticity of the highlighter effect generated by the electronic device.

[0125] In some embodiments, the electronic device may determine a blur radius based on the brightness difference value of the second sub-region (such as the first brightness difference value described below). Further, the electronic device may optimize the brightness values ​​of the pixels in the second sub-region using a blur algorithm based on the blur radius to determine the brightness value of each pixel in the second sub-region. Specifically, this may include:

[0126] First, the electronic device determines a first brightness difference corresponding to each second sub-region according to the second brightness parameter and the first brightness parameter corresponding to each second sub-region.

[0127] In one implementation, as shown in FIG9 , the electronic device may use the brightness difference between the second brightness parameter corresponding to the central pixel point 9021A of the second sub-region and the first brightness parameter as the first brightness difference corresponding to the second sub-region.

[0128] In another implementation, the electronic device may further select multiple sampling pixels in the second sub-region and use the average brightness difference of the multiple sampling pixels as the first brightness difference corresponding to the second sub-region. As shown in FIG9 , the electronic device may select sampling pixel 9021B, sampling pixel 9021C, sampling pixel 9021D, sampling pixel 9021E, and sampling pixel 9021F in the second sub-region. The electronic device determines the brightness difference of each sampling pixel based on the second brightness parameter and the first brightness parameter corresponding to the five sampling pixels. Then, the electronic device determines the average brightness difference of the five sampling pixels based on the brightness differences of the five sampling pixels. Finally, the electronic device uses this average brightness difference as the first brightness difference corresponding to the second sub-region.

[0129] Second, the electronic device determines a blur radius corresponding to each second sub-region according to the first brightness difference value corresponding to each second sub-region.

[0130] Furthermore, the electronic device may optimize the brightness value of the pixel points in each second sub-region based on the first brightness difference value corresponding to each second sub-region. Specifically, the electronic device may determine a blur radius corresponding to the second sub-region based on the first brightness difference value corresponding to the second sub-region. The blur radius is used to represent the degree of blurring when blurring the brightness value of the pixel points in the second sub-region. For example, a larger blur radius indicates a higher degree of blurring. A smaller blur radius indicates a lower degree of blurring.

[0131] The blur radius is negatively correlated with the first brightness difference value. That is, the larger the first brightness difference value, the smaller the blur radius, and the smaller the first brightness difference value, the larger the blur radius. In this way, the electronic device can determine the brightness value of the pixels in the second sub-area based on the brightness characteristics of the pixels in the second sub-area (i.e., the first brightness difference value), making the brush effect more similar to a realistic fluorescent brush effect.

[0132] Third, the electronic device determines the brightness value of the pixel in each second sub-region according to the blur radius corresponding to each second sub-region.

[0133] Specifically, the electronic device can determine the brightness value of the pixel points in the second sub-region based on the blur radius using a first algorithm. The first algorithm has the function of determining the brightness value of the pixel points in the second sub-region based on the blur radius corresponding to the second sub-region, combined with the second brightness parameter and the first brightness parameter corresponding to the second sub-region. Exemplarily, the first algorithm can be a fitting algorithm such as a Gaussian algorithm or bilateral filtering. In this way, by determining the brightness value of the pixel points in each second sub-region using the first algorithm, the electronic device can further improve the authenticity of the generated fluorescent brush effect.

[0134] As can be seen, using the technical solutions provided in the above embodiments, the electronic device can optimize the brightness values ​​of the pixels in the target area generated in the first image based on the first brightness parameter and the second brightness parameter, thereby determining the brightness values ​​of the pixels in the target area. This enables the brush effect generated by the electronic device in the first image to present a highlighter effect, thereby increasing the diversity of brush effects and meeting the personalized needs of users.

[0135] In some embodiments, the electronic device of the image editing method provided by the embodiments of the present application can also set the color of the brush effect generated in the first image.

[0136] Specifically, the brush parameters may further include a first color parameter, wherein the first color parameter is used to represent the color of the brush line determined by the user, and the first color parameter may be, for example, a red, green, and blue (RGB) color parameter.

[0137] In one implementation, the electronic device may display a color parameter setting control in the display interface of the first application, so that the user can input the first color parameter through the color parameter setting control, thereby allowing the electronic device to receive the first color parameter determined by the user.

[0138] For example, referring to FIG. 5 , as shown in FIG. 5 (a), the electronic device further displays a first color parameter setting control (e.g., a “color” control 5013) in the display interface 501 of the first application. After the user clicks the “color” control 5013, the electronic device may display multiple color options, each corresponding to a color parameter. Furthermore, the user may select a specific color option to send the color parameter corresponding to the color option (i.e., the first color parameter) to the electronic device, thereby enabling the electronic device to receive the first color parameter.

[0139] The image editing method provided in the embodiment of the present application further includes: the electronic device determines the color value (or can be called color value) of the pixel point in the target area based on the first color parameter.

[0140] In some embodiments, continuing to take the original image of the first image as the above-mentioned JPEG image as an example, a specific implementation method for an electronic device to determine the color value of a pixel point in a target area is exemplified.

[0141] Specifically, as shown in Figure 9, when the original image of the first image is a JPEG image, the first image can also include an SDR image, that is, a second layer 903, and the information of the second layer includes a second color parameter, which is used to represent the initial color of the pixel point in the first image.

[0142] Furthermore, as shown in FIG9 , the target area may further include: a second target sub-area 9031 , which is mapped on the second layer 903 by the electronic device according to the first line width parameter and the trajectory information to determine the trajectory 90212 of the first operation.

[0143] The method for determining the color values ​​of pixels in a target area based on a first color parameter by an electronic device includes: determining the color values ​​of pixels in a second target sub-area based on the first color parameter. Specifically, the electronic device may set the color values ​​of pixels in the second target sub-area based on the first color parameter determined by the user, so that the brush effect generated by the electronic device in the first image can present the color determined by the user.

[0144] In some embodiments, the electronic device may add the second color parameter corresponding to the second target sub-region to the first color parameter to obtain the color value of the pixel in the second target sub-region. Specifically, the initial color value corresponding to each pixel in the second target sub-region is added to the color value determined by the user to obtain the color value of the pixel in the second target sub-region. In this way, the electronic device can quickly determine the color of the brush effect.

[0145] In some embodiments, the electronic device of the image editing method provided in the embodiments of the present application can also add personalized effects to the brush effect generated in the first image, such as: highlighting content effect, sequin brush effect, etc.

[0146] In one implementation, referring to FIG. 5 , as shown in FIG. 5 (a), the electronic device further displays a personalized effect setting control (e.g., an "Effect" control 5014) in the display interface 501 of the first application. After the user clicks on the "Effect" control 5014, the electronic device may display personalized effect options. The personalized effect options may include, for example, a "Highlight" effect option that can highlight content, a "Sequin" effect option that can achieve a sequin brush effect, and the like. Furthermore, the user may select a specific personalized effect option to cause the electronic device to add a corresponding personalized effect to the brush effect.

[0147] In some embodiments, taking the electronic device achieving the effect of highlighting content as an example, the image editing method provided by the embodiment of the present application further includes:

[0148] First, the electronic device may extract an area within the second target sub-area for displaying the first content, ie, the third sub-area, wherein the first content may be text content, image content, or the like.

[0149] Taking the first content as text content as an example, the third sub-region is the area within the second target sub-region where the text content is displayed. For example, FIG10 is a schematic diagram of a second target sub-region determined by an electronic device according to an embodiment of the present application. As shown in FIG10 , within the second target sub-region 1001, the electronic device can extract a third sub-region 1002, i.e., an area where the first content (i.e., text content) is displayed.

[0150] Then, the electronic device may retain the initial color corresponding to each pixel in the second target sub-region, that is, the second color parameter corresponding to each pixel.

[0151] Furthermore, the electronic device can set the color values ​​corresponding to the pixels in the area other than the third sub-area within the second target sub-area (as shown in FIG. 10 , i.e., area 1003, hereinafter referred to as the fourth sub-area) to the first color parameter determined by the user. Alternatively, the electronic device can also set the color values ​​corresponding to the pixels in the fourth sub-area to the sum of the second color parameter and the first color parameter. In this way, the brush effect generated by the electronic device can better highlight the original display content (such as the above-mentioned text content) in the first image, thereby further improving the authenticity of the highlighter effect and meeting the personalized needs of the user.

[0152] In some embodiments, taking the example of an electronic device achieving a brush sequin effect, the image editing method provided by the embodiment of the present application further includes:

[0153] First, the electronic device may determine target pixels in the target area of ​​the first image using a second algorithm. The second algorithm may be a randomized algorithm that has the function of randomly determining target pixels in the target area of ​​the first image, where the target pixels are pixels set to display the sequin effect.

[0154] Exemplarily, the electronic device may divide the target area into a grid diagram with a second preset length through the second algorithm, and randomly select pixel points corresponding to a target number of vertex positions in the vertices of the grid diagram as target pixel points.

[0155] The electronic device can then set the brightness value of the target pixel to a third brightness parameter. In one implementation, the third brightness parameter can be preset, for example, it can be set to the maximum brightness value. In another implementation, the third brightness parameter can also be determined based on the first brightness parameter and the second brightness parameter, that is, the third brightness parameter is greater than the first brightness parameter and greater than the second brightness parameter. The larger the third brightness parameter, the more obvious the sequin effect in the brush effect generated by the electronic device. In this way, the electronic device can generate a fluorescent pen effect with a sequin effect in the first image, which can further increase the diversity of brush effects and improve the user experience.

[0156] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0157] In the embodiment of the present application, the functional modules of the electronic device can be grouped according to the above method example. For example, each functional module can be grouped according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the grouping of modules in the embodiment of the present application is schematic and is only a logical functional grouping. In actual implementation, there may be other grouping methods.

[0158] An embodiment of the present application also provides an image editing device, which may be the above-mentioned electronic device, or a chip in the electronic device, or a system on chip. The image editing device may be used to perform the functions of the electronic device involved in the above-mentioned embodiment.

[0159] As an implementation method, as shown in FIG11 , the image editing device 200 may include: a receiving module 201 and a processing module 202 .

[0160] Receiving module 201 is configured to receive brush parameters determined by a user, the brush parameters including a first brightness parameter and a first line width parameter. Processing module 202 is configured to detect a first operation performed by the user based on a first image and determine trajectory information, the trajectory information being used to characterize the trajectory of the first operation. The first image is a high dynamic range (HDR) image, and the image information of the first image includes a second brightness parameter, which is used to characterize the initial brightness of pixels in the first image. Processing module 202 is further configured to determine a target area in the first image based on the trajectory information and the first line width parameter. Processing module 202 is further configured to determine the brightness values ​​of pixels in the target area based on the first brightness parameter and the second brightness parameter.

[0161] An embodiment of the present application further provides an electronic device, which may include: a display screen, a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above-mentioned method embodiment. Of course, the electronic device includes but is not limited to the above-mentioned display screen, the memory, and the one or more processors.

[0162] The embodiment of the present application also provides a chip system, which can be applied to the electronic devices in the aforementioned embodiments. As shown in Figure 12, the chip system includes at least one processor 301 and at least one interface circuit 302. The processor 301 can be the processor in the above-mentioned electronic device. The processor 301 and the interface circuit 302 can be interconnected through a line. The processor 301 can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit 302. When the computer instructions are executed by the processor 301, the electronic device can execute the various steps performed by the electronic device in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.

[0163] An embodiment of the present application also provides a computer-readable storage medium for storing computer instructions executed by the above-mentioned electronic device.

[0164] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above electronic device.

[0165] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0166] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0167] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0168] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0169] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0170] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. An image editing method, characterized in that: The method comprises: receiving brush parameters determined by a user, the brush parameters comprising: a first brightness parameter and a first line width parameter; detecting a first operation of a user based on a first image, and determining trajectory information, where the trajectory information is used to characterize a trajectory of the first operation, where the first image is a high dynamic range imaging (HDR) image, and where the image information of the first image includes a second brightness parameter, where the second brightness parameter is used to characterize an initial brightness of a pixel point in the first image; Determine a target area in the first image according to the trajectory information and a first line width parameter in the brush parameters; Determine the brightness value of the pixel in the target area according to the first brightness parameter and the second brightness parameter.

2. The method according to claim 1, characterized in that The determining a target area in the first image according to the trajectory information and the first line width parameter includes: The target area is determined according to the trajectory information and a second line width parameter; wherein the second line width parameter is greater than the first line width parameter, and the second line width parameter is associated with the first line width parameter.

3. The method according to claim 1 or 2, characterized in that: The first image includes: a first layer, and the information of the first layer includes: the second brightness parameter; The target area includes: a first target sub-area; The first target sub-region is obtained by mapping on the first layer according to the second line width parameter and the track information.

4. The method according to claim 3, characterized in that The first target sub-region includes a first sub-region, and the first sub-region is determined in the first layer according to the first line width parameter and the trajectory information.

5. The method according to claim 4, characterized in that The determining the brightness value of the pixel point in the target area according to the first brightness parameter and the second brightness parameter includes: Setting the brightness value of each pixel in the first sub-area to the first brightness parameter; Dividing the first target sub-area into a plurality of second sub-areas along a trajectory direction of the first operation by a first preset length; The brightness value of the pixel point in each second sub-region is determined according to the second brightness parameter and the first brightness parameter corresponding to each second sub-region in the plurality of second sub-regions.

6. The method according to claim 5, characterized in that The determining, according to the second brightness parameter and the first brightness parameter corresponding to each second sub-region in the plurality of second regions, a brightness value of a pixel point in each second sub-region comprises: Determine a first brightness difference value corresponding to each second sub-region according to the second brightness parameter and the first brightness parameter corresponding to each second sub-region; Determine, according to the first brightness difference value corresponding to each second sub-region, a blur radius corresponding to each second sub-region, wherein the blur radius is negatively correlated with the first brightness difference value; The brightness value of the pixel point in each second sub-area is determined according to the blur radius corresponding to each second sub-area.

7. The method according to any one of claims 1 to 6, characterized in that: The brush parameters also include: a first color parameter; The method further comprises: The color value of the pixel in the target area is determined according to the first color parameter.

8. The method according to claim 7, characterized in that The first image further includes: a second layer, and information of the second layer includes: a second color parameter, and the second color parameter is used to represent the initial color of the pixel point in the first image; The target area further includes: a second target sub-area, the second target sub-area being obtained by mapping the second layer according to the first line width parameter and the track information; Determining the color value of the pixel in the target area according to the first color parameter includes: Determine the color value of the pixel in the second target sub-region according to the first color parameter.

9. The method according to claim 8, characterized in that The determining, according to the first color parameter, the color value of the pixel in the second target sub-area includes: The second color parameter corresponding to the pixel point in the second target sub-region is added to the first color parameter to obtain the color value of the pixel point in the second target sub-region.

10. The method according to claim 8, characterized in that The determining, according to the first color parameter, the color value of the pixel in the second target sub-area includes: extracting a third sub-region in the second target sub-region, where the third sub-region is used to display the first content; retaining the second color parameter corresponding to the pixel point in the third sub-area; The second color parameter corresponding to the pixel in the fourth sub-region is added to the first color parameter to obtain the color value of the pixel in the fourth sub-region, and the fourth sub-region is the region outside the third sub-region in the second target sub-region.

11. The method according to claim 10, characterized in that The first content is text content.

12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: Determine a target pixel point in the target area according to a random algorithm; The brightness value of the target pixel is set to a third brightness parameter, where the third brightness parameter is greater than the first brightness parameter and greater than the second brightness parameter.

13. An image editing device, characterized in that: include: Receiving module and processing module; The receiving module is used to receive brush parameters determined by a user, and the brush parameters include: a first brightness parameter and a first line width parameter; The processing module is used to detect a first operation of a user based on a first image, and determine trajectory information, where the trajectory information is used to characterize a trajectory of the first operation, the first image is a high dynamic range imaging (HDR) image, and the image information of the first image includes a second brightness parameter, where the second brightness parameter is used to characterize an initial brightness of a pixel in the first image; The processing module is further used to determine a target area in the first image according to the trajectory information and the first line width parameter; The processing module is further used to determine the brightness value of the pixel point in the target area according to the first brightness parameter and the second brightness parameter.

14. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for editing screen capture

    CN103164123A

  • Display device and color setting method

    CN113485614A

  • Terminal device and method for creating / displaying HDR image

    CN116095503A