Image editing method and device and electronic equipment
By applying CUVA HDR technology in 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 in the existing technology, meets the user's personalized needs and Improves the diversity and authenticity of brush effects.
Patent Information
- Application Number
- CN202310717824.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2024-12-17
AI Technical Summary
When using the brush function in existing electronic devices, the generated brush effects are relatively single, making it difficult to meet users' personalized needs for diversified brush effects.
Using CUVA HDR technology, the brightness values of pixel points in the brush effect area are determined based on the brush brightness parameters set by the user and the initial brightness value of the HDR image, and the highlighter effect is generated, thereby improving the diversity of the brush effects.
By generating highlighter effects, we can meet users' personalized needs and improve the diversity and authenticity of brush effects.
Smart Images

Figure CN119149150A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic devices, and in particular to an image editing method, device and electronic device. Background Art
[0002] With the development of electronic equipment technology, electronic equipment has increasingly rich image editing functions. Users can edit images through electronic equipment to meet the needs of users in various application scenarios.
[0003] For example, a user can use a brush function in an 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.
[0004] 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. Summary of the invention
[0005] The embodiments of the present application provide an image editing method, device and electronic device. The method enables the electronic device to determine the brightness value of the pixel point in the brush effect area generated by the HDR image based on the China Ultra High-Definition Video Industry Alliance (CUVA) high dynamic range imaging (HDR) technology according to the 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 the brush effect and meeting the personalized needs of the user.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] 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. Among them, 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. Next, the electronic device can determine a target area, that is, a brush area, in the first image according to 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 according to the first brightness parameter and the second brightness parameter, that is, generate a brush effect that can present a fluorescent pen effect.
[0008] In the method, the electronic device can optimize the brightness value of the pixel points in the target area generated in the first image according to the first brightness parameter and the second brightness parameter based on the CUVA HDR technology, and determine the brightness value of the pixel points in the target area. 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 effect and meeting the personalized needs of users.
[0009] In combination with the first aspect, in an optional implementation, the electronic device determines the target area in the first image according to the trajectory information and the first line width parameter, specifically including: the electronic device determines the target area according to the trajectory information and the second line width parameter. Among them, 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 according to 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 according to 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, it is convenient for the electronic device to 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.
[0010] 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. Then the target area includes: a first target sub-area, which is obtained by mapping the first layer according to the second line width parameter and the 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 according to the first brightness parameter and the second brightness parameter.
[0011] In combination with the first aspect, in an optional implementation, 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. In this implementation, the electronic device can determine the first sub-region in the first layer according to the first line width parameter and the trajectory information, and the electronic device can determine the brightness value of the pixel point in the first sub-region according to the first brightness parameter. In this way, the electronic device can further optimize the brightness value of the pixel point in the first target sub-region to improve the authenticity of the highlighter effect.
[0012] 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 according to 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 according to 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 in combination with 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.
[0013] In combination with the first aspect, in an optional implementation, the electronic device determines the brightness value of the 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 regions, including: first, the electronic device determines the 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. Then, the electronic device determines the blur radius corresponding to each second sub-region according to the first brightness difference value corresponding to each second sub-region, and the blur radius is negatively correlated with the first brightness difference value. Finally, the electronic device determines the brightness value of the pixel point in each second sub-region according to the blur radius corresponding to each second sub-region. In this implementation, the electronic device can determine the blur radius corresponding to each second sub-region in combination with the characteristics of the first brightness difference value of the pixel point in each second sub-region. Further, the electronic device can determine the brightness value of the pixel point in each second sub-region according to the blur radius, so that the authenticity of the generated fluorescent brush effect can be further improved.
[0014] In combination with the first aspect, in an optional implementation, the brush parameters further include: a first color parameter. The method further includes: the electronic device determining the color value of the pixel in the target area according to the first color parameter. In this way, the electronic device can also determine the color value of the pixel in the target area according to the first color parameter to further improve the authenticity of the fluorescent pen effect.
[0015] 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 also 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.
[0016] In conjunction with the first aspect, in an optional implementation, the electronic device determines the color value of the pixel in the second target sub-region according to the first color parameter, including: the electronic device adds the second color parameter corresponding to the pixel in the second target sub-region to the first color parameter 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.
[0017] 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-region according to the first color parameter, including: first, the electronic device extracts the third sub-region in the second target sub-region, and the third sub-region is used to display the first content. Wherein, 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-region; finally, the electronic device adds the second color parameter corresponding to the pixel in the fourth sub-region 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 area outside the third sub-region in the second target sub-region. In this way, the brush effect generated by the electronic device can better highlight the original display content (i.e., the above-mentioned first content) in the first image, so as to further improve the authenticity of the highlighter effect and meet the personalized needs of users.
[0018] In combination with the first aspect, in an optional implementation, the method further includes: first, the electronic device determines a target pixel point in the target area according to a random algorithm; then, the electronic device sets the brightness value of the target pixel point to a third brightness parameter, 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 fluorescent pen effect with a sequin effect in the first image, which can further increase the diversity of the brush effect and improve the user experience.
[0019] 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 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 the user based on a first image, and 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 according to 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 according to the first brightness parameter and the second brightness parameter.
[0020] The image editing device can optimize the brightness value of the pixel points in the target area generated in the first image according to the first brightness parameter and the second brightness parameter based on the CUVA HDR technology, and determine the brightness value of the pixel points in the target area. 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 effect and meeting the personalized needs of users.
[0021] According to a third aspect, an electronic device is provided, comprising: 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 comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method according to the first aspect and any one of the optional methods thereof.
[0022] According to 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 according to the first aspect and any optional method thereof.
[0023] According to a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer executes the method according to the first aspect and any optional method thereof.
[0024] 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 in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An application scenario diagram of a brush effect generation method provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0028] Figure 4 A flowchart of an image editing method provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of a display interface of an electronic device provided in an embodiment of the present application;
[0030] Figure 6 A schematic diagram of an electronic device generating a first image provided by an embodiment of the present application;
[0031] Figure 7 A schematic diagram of initiating a first operation provided in an embodiment of the present application;
[0032] Figure 8 A schematic diagram of a target area determined by an electronic device provided in an embodiment of the present application;
[0033] Fig. 9A schematic diagram of an electronic device editing an image provided by an embodiment of the present application;
[0034] Fig.10 A schematic diagram of a second target sub-area determined by an electronic device provided in an embodiment of the present application;
[0035] Fig.11 A schematic diagram of the structure of an image editing device provided in an embodiment of the present application;
[0036] Fig.12 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] 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, which 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. And, 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 items 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, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "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 solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0038] With the development of electronic equipment technology, electronic equipment has increasingly rich image editing functions. Users can edit images through electronic equipment to meet the needs of users in various application scenarios.
[0039] For example, a user can use the brush function in the image editing function on an electronic device to annotate, draw, doodle, and edit an image (such as a photo, screenshot, etc.) to highlight the key content in the image. For another example, a user can use the brush function on an electronic device to sign an image (such as a document image, etc.) to implement electronic signature on the electronic device.
[0040] 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.
[0041] 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 in which electronic devices perform annotation, drawing and other editing of 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 CUVA HDR technology, according to 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, 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 brush effects and meeting the personalized needs of users.
[0042] For example, the electronic devices in the embodiments of the present application may include but are not limited to smart phones, 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, etc. Alternatively, the electronic devices may also be electronic devices of other types or structures, which are not limited in the present application.
[0043] 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 image 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 the mobile phone, to use the "brush" function provided in the target application. Figure 1This is an application scenario diagram of a brush effect generation method provided in an embodiment of the present application, such as Figure 1 As shown, by controlling the "brush" to slide in the application interface, a corresponding brush track can be generated to complete functions such as marking and drawing. Among them, the "brush" logo in the figure is only exemplary, and the pen touch point can also be marked with a "dot" or other logo, or not displayed.
[0044] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0045] Please refer to Figure 2 , 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.
[0046] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, etc.
[0047] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0048] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0049] 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.
[0050] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0051] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.
[0052] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0053] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0054] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.
[0055] 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.
[0056] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0057] 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0058] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0059] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0060] The touch sensor 180B is also called a "touch panel". The touch sensor 180B can be arranged on the display screen 194, and the touch sensor 180B and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180B is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180B can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0061] In an embodiment of the present application, when the electronic device 100 is the electronic device in the aforementioned embodiment, the processor 110 may receive brush parameters determined by the user through the display screen 194, for example, including a first brightness parameter and a first line width parameter. The processor 110 may detect a first operation of the user based on the first image through the pressure sensor 180A or the touch sensor 180B to determine the trajectory information. Furthermore, the processor 110 may determine the target area in the first image based on the trajectory information and the first line width parameter. Finally, the processor 110 may 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.
[0062] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0063] Figure 3 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0064] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0065] The application layer can include a series of application packages.
[0066] like Figure 3 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0067] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0068] like Figure 3 As shown, the application framework layer may include a brush module, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0069] 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, so as to achieve the fluorescent pen effect.
[0070] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0071] 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.
[0072] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0073] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0074] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0075] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0076] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0077] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0078] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0079] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0080] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0081] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0082] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0083] A 2D graphics engine is a drawing engine for 2D drawings.
[0084] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0085] The following is an explanation of the image editing method provided by the embodiment of the present application. Figure 2 The components shown and Figure 3 The application framework layer is shown. Figure 4 A flowchart of an image editing method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the method may include the following steps S101-S104:
[0086] S101. The electronic device receives brush parameters determined by a user.
[0087] In the embodiment of the present application, the brush parameter is a parameter related to the brush effect generated by the electronic device and determined by the user, so as to be used by the electronic device to generate the corresponding brush effect according to the brush parameter. Specifically, the brush parameter may include: a first brightness parameter and a first line width parameter. Among them, 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.
[0088] In one implementation, when a user edits an image through an application program with an image editing function in an electronic device (hereinafter referred to as a first application), the electronic device may display a setting control for brush parameters in a display interface of the first application, so that the user can input brush parameters through the setting control for brush parameters, thereby allowing the electronic device to receive the brush parameters determined by the user. Figure 5 A schematic diagram of a display interface of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown in (a), the electronic device displays a first brightness parameter setting control (e.g., "brightness" control 5011) and a first line width parameter setting control (e.g., "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 names of the controls are not limited in this embodiment of the application.
[0089] Take the example of an electronic device receiving a first brightness parameter determined by a user. Figure 5 As shown in (b), after the user clicks the "brightness" control 5011, the electronic device can display a brightness value input box 50111. Further, the user can input a determined first brightness parameter through the brightness value input box 50111 to send the first brightness parameter to the electronic device, so that the electronic device can receive the first brightness parameter.
[0090] In another example, Figure 5 As shown in (c), after the user clicks the "brightness" control 5011, the electronic device can display a scale bar 50112 with a brightness value and a slider 50113. Further, the user can 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, so as to send the first brightness parameter to the electronic device, so that the electronic device can receive the first brightness parameter.
[0091] In one implementation, after the user inputs the determined first brightness parameter through the brightness value input box, the electronic device can display the display interface of the first application at the brightness value of the first brightness parameter. Alternatively, when the user slides the slider 50113, the electronic device displays the display interface of the first application at the brightness value corresponding to the position of the slider 50113 at the scale bar 50112. In this way, the user can intuitively understand the effect corresponding to the display of the first brightness parameter by the electronic device, thereby improving the user's experience.
[0092] S102: The electronic device detects a first operation of a user based on a first image, and determines trajectory information.
[0093] 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 a pixel in the first image. In an embodiment of the present application, the first image is an HDR format image (hereinafter referred to as HDR image), and the first image can be generated by an electronic device based on the original image based on CUVA HDR technology.
[0094] In one example, Figure 6 A schematic diagram of an electronic device generating a first image provided by an embodiment of the present application, such as Figure 6 As shown in (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 suffix of .dng, the electronic device can generate a gain table map (GainTableMap), which can be composed of a 32-bit two-dimensional table (table), and the initial brightness (i.e., the second brightness parameter) and other information of the pixel points in the original image can be stored through the GainTableMap, so as to be combined with the original ProRAW image to obtain an HDR image, i.e., the first image.
[0095] In another example, Figure 6 As shown in (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 the initial brightness of the pixels in the original image (i.e., the second brightness parameter) and other information can be stored, so as to be combined with the original HEIF image to obtain an HDR image, i.e., the first image.
[0096] In another example, Figure 6As shown in (c), 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. The HDRGainMap can be used to store information such as the original brightness (i.e., the second brightness parameter) of the pixels in the original image. 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.
[0097] In an embodiment of the present application, the electronic device may display a first image in a display interface of a first application through a display screen, 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. Further, the electronic device may determine trajectory information based on a trajectory formed by the first operation on the display screen, and the trajectory information is used to characterize the trajectory of the first operation.
[0098] In one implementation, the track information may be coordinate matrix information, that is, including coordinate values of track points formed by the first operation in the display screen, so that the electronic device can accurately determine the position of generating the brush effect in the first image through the track information.
[0099] In some embodiments, the first operation may be an operation initiated by a user to the electronic device through an interaction unit of the electronic device, such as a display screen (specifically, a touch display screen). Figure 7 A schematic diagram of initiating a first operation provided in an embodiment of the present application. In one implementation, Figure 7 As shown in (a), the user can slide the finger on the display screen of the electronic device to initiate the first operation. When the user slides the finger on the display screen, it triggers the change of 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 capacitance change information 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 Figure 7 Trajectory 701 in.
[0100] In other embodiments, Figure 7As shown in (b), the user may also perform sliding 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 the inductive pen on the display screen, the electronic device may sense the electric 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 the capacitive pen on the display screen, 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, which is used to characterize the trajectory of the first operation, such as Figure 7 Trajectory 702 in.
[0101] S103: The electronic device determines a target area in the first image according to the trajectory information and the first line width parameter.
[0102] In an embodiment of the present application, the electronic device can determine the area for generating a brush effect, that is, the brush area, which can also be called the target area, in the first image based on the trajectory information and the first line width parameter.
[0103] Exemplarily, the electronic device may, in the first image, take the trajectory determined by the above trajectory information as the center and extend the trajectory by half of the first line width parameter to both sides, thereby obtaining the target area.
[0104] In some embodiments, the target area can also be determined by the electronic device in the first image according to the trajectory information and the second line width parameter. The second line width parameter is associated with the first line width parameter. The second line width parameter is greater than the first line width parameter, that is, the target area is greater than the area determined by the electronic device according to the trajectory information and the first line width parameter.
[0105] In some embodiments, the second line width parameter can be determined by the electronic device according to the first line width parameter and the first coefficient. For example, the first coefficient can be one-half, that is, the second line width parameter can be one-half of the first line width parameter. For another example, the first coefficient can also be one-fifth, that is, the second line width parameter can also be one-fifth of the first line width parameter. Specifically, the specific value of the first coefficient can be determined according to the demand for brush effects in actual applications, and this application does not make specific limitations on this.
[0106] In other embodiments, the second line width parameter may 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 may 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 may 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 may be determined based on the requirements for the brush effect in actual applications, and this application does not specifically limit this.
[0107] Figure 8 is a schematic diagram of a target area provided in an embodiment of the present application, such as Figure 8 As shown, the target area 801 is determined by the electronic device according to a trajectory 8011 represented by the trajectory information and a length 8014 corresponding to the second line width parameter.
[0108] The target area 801 may include not only the track 8011 obtained according to the user's track information but also the area determined by the first line width parameter 8015 (i.e. Figure 8 The middle area 8012), and also includes the extended part area (i.e. Figure 8 In this way, the electronic device processes the parameters such as the brightness value of the pixels in the target area to achieve the highlighter effect and improve the authenticity of the highlighter effect.
[0109] 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.
[0110] In the embodiment of the present application, the electronic device can determine the brightness value of the pixel 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 pixel 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.
[0111] 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.
[0112] Fig. 9 A schematic diagram of an electronic device editing an image provided in an embodiment of the present application is shown in FIG. Fig. 9As shown, when the original image of the first image 901 is a JPEG image, the first image 901 may include HDRGainMap, that is, the first layer 902, and the information of the first layer 902 includes the second brightness parameter. Then the above-mentioned target area may include: a first target sub-area 9021, and the first target sub-area 9021 is obtained by mapping the electronic device in the first layer according to the second line width parameter and the track information.
[0113] For example, Fig. 9 As shown, 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., proportionally reducing the trajectory information by one-quarter) to determine the first target sub-area.
[0114] Further, in some embodiments, the first target sub-area 9021 includes a first sub-area 90211, and the first sub-area 90211 is determined by the electronic device in the first layer according to the first line width parameter and the trajectory information.
[0115] 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:
[0116] S1041. The electronic device sets the brightness value of each pixel in the first sub-region to a 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.
[0117] 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.
[0118] Further, such as Fig. 9 As shown, the electronic device can determine the trajectory 90212 of the first operation according to the trajectory information, and then divide the first target sub-region 9021 into a plurality of second sub-regions 90214 by a first preset length 90213 along the direction of the trajectory 90212 of the first operation. In this way, the electronic device can optimize the brightness value of the pixel point in each second sub-region in combination with the brightness characteristics of each second sub-region.
[0119] In one implementation, the first preset length may be associated with the first line width parameter, that is, the first preset length may be determined based on the first line width parameter and the second coefficient. For example, the second coefficient may be 5, that is, the first preset length may be 5 times the first line width parameter. For another example, the second coefficient may also be 10, that is, the first preset length may also 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 make any specific limitation on this.
[0120] In another implementation, the first preset length may also be a preset fixed value. For example, the first preset length may be preset to 1 mm. For another example, the first preset length may also be preset to 3 mm. Specifically, the preset value of the first preset length may be determined according to the requirements for the brush effect in actual applications, and this application does not specifically limit this.
[0121] 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.
[0122] 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.
[0123] In some embodiments, the electronic device may determine the blur radius according to the brightness difference value of the second sub-region (such as the first brightness difference value described below). Further, the electronic device optimizes the brightness value of the pixel points in the second sub-region through a blur algorithm based on the blur radius to determine the brightness value of the pixel points in each second sub-region. Specifically, it may include:
[0124] First, the electronic device determines a first brightness difference value corresponding to each second sub-region according to the second brightness parameter corresponding to each second sub-region and the first brightness parameter.
[0125] In one implementation, Fig. 9 As shown, the electronic device can 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.
[0126] In another implementation, the electronic device may further select multiple sampling pixel points in the second sub-region, and use the average brightness difference value of the multiple sampling pixel points as the first brightness difference value corresponding to the second sub-region. Fig. 9As shown, the electronic device can select sampling pixel point 9021B, sampling pixel point 9021C, sampling pixel point 9021D, sampling pixel point 9021E and sampling pixel point 9021F in the second sub-region. The electronic device determines the brightness difference value of each sampling pixel point according to the second brightness parameter and the first brightness parameter corresponding to the above five sampling pixel points. Then, the electronic device determines the average brightness difference value of the five sampling pixel points according to the brightness difference values of the five sampling pixel points. Finally, the electronic device uses the average brightness difference value as the first brightness difference value corresponding to the second sub-region.
[0127] 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.
[0128] Furthermore, the electronic device may optimize the brightness value of the pixel in each second sub-region according to the first brightness difference value corresponding to each second sub-region. Specifically, the electronic device may determine the blur radius corresponding to the second sub-region according to the first brightness difference value corresponding to the second sub-region, and the blur radius is used to characterize the blur degree when blurring the brightness value of the pixel in the second sub-region. Exemplarily, the larger the blur radius, the higher the blur degree. The smaller the blur radius, the lower the blur degree.
[0129] The blur radius is negatively correlated with the first brightness difference, that is, the larger the first brightness difference, the smaller the blur radius, and the smaller the first brightness difference, the larger the blur radius. In this way, the electronic device can determine the brightness value of the pixel points in the second sub-area based on the brightness characteristics of the pixel points in the second sub-area (that is, the first brightness difference), so that the brush effect is closer to the real fluorescent brush effect.
[0130] 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.
[0131] Specifically, the electronic device can determine the brightness value of the pixel in the second sub-area according to the blur radius through the first algorithm. The first algorithm has the function of determining the brightness value of the pixel in the second sub-area according to the blur radius corresponding to the second sub-area, combined with the second brightness parameter and the first brightness parameter corresponding to the second sub-area. Exemplarily, the first algorithm can be a fitting algorithm such as a Gaussian algorithm and a bilateral filter. In this way, the electronic device determines the brightness value of the pixel in each second sub-area through the first algorithm, which can further improve the authenticity of the generated fluorescent brush effect.
[0132] It can be seen that by adopting the technical solution provided by the above embodiment, the electronic device can optimize the brightness value of the pixel points in the target area generated in the first image according to the first brightness parameter and the second brightness parameter, and determine the brightness value of the pixel points in the target area. 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 effect and meeting the personalized needs of users.
[0133] 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.
[0134] Specifically, the brush parameters may further include: a first color parameter, wherein the first color parameter is used to characterize the color of the brush line determined by the user, and the first color parameter may be, for example, a red green blue (RGB) color parameter.
[0135] 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.
[0136] For example, see above Figure 5 ,like Figure 5 As shown in (a), the electronic device also 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 can display multiple color options, each color corresponding to a color parameter. Further, the user can select a certain color option to send the color parameter (i.e., the first color parameter) corresponding to the color option to the electronic device, so that the electronic device can receive the first color parameter.
[0137] 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 according to the first color parameter.
[0138] In some embodiments, the original image of the first image is continued to be the above-mentioned JPEG image as an example to illustrate a specific implementation method for an electronic device to determine the color value of a pixel point in a target area.
[0139] Specifically, Fig. 9 As shown, when the original image of the first image is a JPEG image, the first image may also include an SDR image, namely, a second layer 903, and the information of the second layer includes second color parameters, which are used to represent the initial color of the pixel points in the first image.
[0140] Further, such as Fig. 9 As shown, 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.
[0141] The method for the electronic device to determine the color value of the pixel point in the target area according to the first color parameter includes: the electronic device determines the color value of the pixel point in the second target sub-area according to the first color parameter. That is, the electronic device can set the color value of the pixel point in the second target sub-area according to 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.
[0142] 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. That is, the initial color value corresponding to each pixel in the second target sub-region and the color value determined by the user are added 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.
[0143] 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 effects, sequin brush effects, etc.
[0144] In one implementation, continue to refer to the above Figure 5 ,like Figure 5 As shown in (a), the electronic device also displays a personalized effect setting control (e.g., "effect" control 5014) in the display interface 501 of the first application. After the user clicks the "effect" control 5014, the electronic device can display personalized effect options, and the personalized effect options can include, for example, a "highlight" effect option that can achieve a highlighting effect on the content, a "sequin" effect option that can achieve a sequin brush effect, etc. Further, the user can select a determined personalized effect option to enable the electronic device to add a corresponding personalized effect to the brush effect.
[0145] In some embodiments, taking the electronic device realizing the effect of highlighting content as an example, the image editing method provided by the embodiment of the present application further includes:
[0146] First, the electronic device may extract an area in the second target sub-area for displaying the first content, that is, the third sub-area, wherein the first content may be text content, picture content, and the like.
[0147] Taking the first content as text content as an example, the third sub-region is the region in the second target sub-region where the text content is displayed. Fig.10 A schematic diagram of a second target sub-area determined by an electronic device according to an embodiment of the present application is shown in FIG. Fig.10 As shown, in the second target sub-area 1001, the electronic device can extract the third sub-area 1002, that is, the area displaying the first content (that is, text content).
[0148] 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.
[0149] Furthermore, the electronic device may include an area (eg, Fig.10 As shown, the color value corresponding to the pixel in area 1003 (hereinafter referred to as the fourth sub-area) is set to the first color parameter determined by the user. Alternatively, the electronic device can also set the color value corresponding to the pixel 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, so as to further improve the authenticity of the highlighter effect and meet the personalized needs of the user.
[0150] In some embodiments, taking the electronic device realizing the brush sequin effect as an example, the image editing method provided by the embodiment of the present application further includes:
[0151] First, the electronic device can determine the target pixel point in the target area of the first image by using the second algorithm. The second algorithm can be a randomized algorithm (Randomized Algorithms), and the second algorithm has the function of randomly determining the target pixel point in the target area of the first image, and the target pixel point is the pixel point set to display the sequin effect.
[0152] Exemplarily, the electronic device may divide the target area into a grid diagram with a second preset length through a second algorithm, and randomly select pixel points corresponding to the target number of vertex positions in the vertices of the grid diagram as target pixel points.
[0153] Then, the electronic device may set the brightness value of the target pixel point to a third brightness parameter. In one implementation, the third brightness parameter may be preset, for example, may be set to a maximum value of the brightness value. In another implementation, the third brightness parameter may 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 the brush effect and improve the user experience.
[0154] 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.
[0155] The embodiment of the present application can group the functional modules of the electronic device 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 integrated module 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. There may be other grouping methods in actual implementation.
[0156] 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, and the image editing device may be used to execute the functions of the electronic device involved in the above-mentioned embodiments.
[0157] As a feasible method, Fig.11 As shown, the image editing device 200 may include: a receiving module 201 and a processing module 202 .
[0158] The receiving module 201 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 202 is used to detect a first operation of the user based on the first image, and 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 202 is also used to determine the target area in the first image according to the trajectory information and the first line width parameter. The processing module 202 is also used to determine the brightness value of the pixel points in the target area according to the first brightness parameter and the second brightness parameter.
[0159] The embodiment of the present application also 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, and the computer program code 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 method embodiment. Of course, the electronic device includes but is not limited to the above display screen, the memory, and one or more processors.
[0160] The present application also provides a chip system, which can be applied to the electronic device in the above embodiment. Fig.12 As shown, the chip system includes at least one processor 301 and at least one interface circuit 302. The processor 301 may be a processor in the above-mentioned electronic device. The processor 301 and the interface circuit 302 may be interconnected via a line. The processor 301 may receive and execute computer instructions from the memory of the above-mentioned electronic device via the interface circuit 302. When the computer instructions are executed by the processor 301, the electronic device may execute the various steps executed by the electronic device in the above-mentioned embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0161] An embodiment of the present application also provides a computer-readable storage medium for storing computer instructions executed by the above electronic device.
[0162] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above electronic device.
[0163] 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.
[0164] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0165] The units described as separate components may or may not be physically separated, 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 different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0167] 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0168] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope 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 track 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 first line width parameter and the track information on the second layer; 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.
