Image processing method and device, electronic equipment and storage medium

By compressing, blurring, and blending images, combined with color filtering, retro-style images are generated, solving the problem of tedious manual parameter adjustments for users and improving generation efficiency and display effects.

CN121937280APending Publication Date: 2026-04-28XIAOHONGSHU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAOHONGSHU TECH CO LTD
Filing Date
2024-10-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the process of users manually adjusting parameters to obtain retro-style images is cumbersome, resulting in poor retro-style image quality.

Method used

By acquiring and compressing the image to be processed, compressed images of different resolutions are obtained. These images are then blurred and blended. Finally, color filtering and image quality adjustments are made to generate the target image, achieving a retro style and glow effect.

Benefits of technology

It eliminates the need for users to manually adjust parameters, improving the efficiency of generating retro images and enhancing the image display effect by achieving a retro style at both the tone and pixel levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937280A_ABST
    Figure CN121937280A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device, electronic equipment and a storage medium, relates to the technical field of image processing, and can improve an image retro effect and generation efficiency. The method comprises the steps that a to-be-processed image is acquired and compressed, at least two compressed images are obtained, and the resolution ratios of the compressed images are different; and performing image fuzzy processing on each compressed image to obtain a fuzzy compressed image corresponding to each compressed image. And performing mixing based on the plurality of fuzzy compression images to obtain a target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the widespread use of the internet, when people share pictures or videos on social media platforms, their demands for the display of image content in the pictures or videos are becoming increasingly personalized. Sometimes, in order to meet people's needs, the image content is controlled to present certain special effects, such as a retro effect.

[0003] However, currently, to obtain images with a retro effect, users need to adjust the image parameters themselves, making the process rather cumbersome. Summary of the Invention

[0004] This application provides an image processing method, apparatus, electronic device, and storage medium that enhances the retro effect of images through image mixing and filter processing.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] In a first aspect, this application provides an image processing method, which includes: acquiring an image to be processed and compressing it to obtain at least two compressed images, each compressed image having a different resolution; performing image blurring processing on each compressed image to obtain a blurred compressed image corresponding to each compressed image; and blending multiple blurred compressed images to obtain a target image.

[0007] One possible implementation involves blending multiple blurred and compressed images to obtain a target image, including: blending the multiple blurred and compressed images to obtain a blurred and blended image; extracting the color value of the first color channel of each pixel in the blurred and blended image to obtain a first color parameter; performing a color filtering operation on the image to be processed, and superimposing the color-filtered image to be processed based on the first color parameter to obtain the target image.

[0008] In one possible implementation, the target image is obtained by superimposing the filtered image based on the first color parameter, including: superimposing the filtered image based on the first color parameter to obtain a first color-corrected image; and adjusting the image quality and / or color parameters based on the first color-corrected image to obtain the target image.

[0009] One possible implementation method for image quality adjustment includes at least one of the following: downsampling, image blurring, and adding noise.

[0010] In one possible implementation, color parameter adjustment includes at least one of the following: adjusting saturation, adjusting color difference offset, and increasing brightness.

[0011] In one possible implementation, the image to be processed includes a target object region. A target image is obtained by blending multiple blurred and compressed images, including: blending the multiple blurred and compressed images to obtain a blurred and mixed image; performing image blurring processing on the blurred and mixed image to obtain a first blurred image and a second blurred image; the first blurred image and the second blurred image have different degrees of blurring and / or different blurred regions; blending the first blurred image and the second blurred image to obtain the target image, wherein the blurring degree of the target object region in the target image is less than the blurring degree of the non-target object regions.

[0012] In one possible implementation, blending a first blurred image with a second blurred image to obtain a target image includes: acquiring a blending intensity; blending the first blurred image with the second blurred image based on the blending intensity to obtain the target image; different blending intensities correspond to different adjustments of the opacity and / or blending ratio of the images involved in the blending.

[0013] In one possible implementation, the image to be processed is compressed to obtain at least two compressed images, including: color-correcting the image to be processed based on pixel value mapping to obtain a second color-corrected image; and then downsampling the second color-corrected image multiple times to obtain multiple compressed images.

[0014] In one possible implementation, color correction is applied to the image to be processed based on pixel value mapping to obtain a second color-corrected image. This includes: filling a first region of the image to be processed with a preset color and setting a second region of the image to be processed to black, wherein the brightness of the first region is greater than or equal to a preset brightness threshold, and the brightness of the second region is less than a preset brightness threshold. Color correction is applied to the image to be processed based on pixel value mapping to obtain the second color-corrected image.

[0015] Secondly, this application provides an image processing apparatus, comprising: an acquisition module for acquiring an image to be processed and performing compression processing to obtain at least two compressed images, each compressed image having a different resolution; a processing module for performing image blurring processing on each compressed image to obtain a blurred compressed image corresponding to each compressed image; and a processing module for mixing multiple blurred compressed images to obtain a target image.

[0016] Thirdly, this application provides an electronic device, including: a memory and a processor; the memory and the processor are coupled; the memory is used to store instructions executable by the processor; the processor executes the instructions and performs the method as described in the first aspect above.

[0017] Fourthly, this application provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect above.

[0018] Fifthly, this application provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the method described in the first aspect above.

[0019] Based on the above technical solution, multiple compressed images with different resolutions corresponding to the image to be processed are obtained. This reduces the amount of image data and improves the efficiency of subsequent image processing. Then, each compressed image can be blurred to obtain a blurred compressed image for each image. Finally, multiple blurred compressed images can be blended to obtain the target image. This eliminates the need for manual parameter adjustment by the user, improving the efficiency of retro image generation. Furthermore, the above solution not only gives the target image a retro style in terms of tone but also at the pixel level. Moreover, by blending blurred images at different resolutions, a glow effect is created in the blended image, improving the display effect of the retro image. Attached Figure Description

[0020] Figure 1 A schematic flowchart of an image processing method provided in an embodiment of this application;

[0021] Figure 2 A schematic flowchart illustrating another image processing method provided in an embodiment of this application;

[0022] Figure 3 A schematic flowchart illustrating another image processing method provided in an embodiment of this application;

[0023] Figure 4 A schematic flowchart illustrating another image processing method provided in an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of an example image to be processed provided in an embodiment of this application;

[0025] Figure 6 This is a schematic diagram illustrating an example of a color-mixed image provided in an embodiment of this application.

[0026] Figure 7 This is a schematic diagram illustrating an example of a LUT diagram provided in an embodiment of this application.

[0027] Figure 8 This is a schematic diagram illustrating an example of a color-filtered overlay image provided in an embodiment of this application.

[0028] Figure 9This is a schematic diagram illustrating an example of a downsampled image provided in an embodiment of this application;

[0029] Figure 10 This is a schematic diagram of an example image after brightness enhancement provided in an embodiment of this application;

[0030] Figure 11 This is a schematic diagram illustrating another example of a color-filtered overlay image provided in an embodiment of this application.

[0031] Figure 12 This is a schematic diagram of an example image after adding particles, provided in an embodiment of this application.

[0032] Figure 13 A schematic diagram illustrating an example of a saturation filter provided in this application embodiment;

[0033] Figure 14 This is a schematic diagram of an image example after saturation filter processing, provided in an embodiment of this application.

[0034] Figure 15 This is a schematic diagram of an example image after color difference offset processing, provided in an embodiment of this application.

[0035] Figure 16 A schematic diagram illustrating an example of a Gaussian blurred image provided in an embodiment of this application;

[0036] Figure 17 A schematic diagram illustrating another example of a Gaussian blurred image provided in an embodiment of this application;

[0037] Figure 18 This is a schematic diagram of an image example after adding a pearlescent filter, provided in an embodiment of this application.

[0038] Figure 19 A schematic diagram illustrating a retro image example provided in this application embodiment;

[0039] Figure 20 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application;

[0040] Figure 21 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0041] Figure 22 A conceptual partial view of a computer program product provided for an embodiment of this application. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0043] In this article, the character " / " generally indicates that the objects before and after it are in an "or" relationship. For example, A / B can be understood as A or B.

[0044] The terms “first” and “second” in the specification and claims of this application are used to distinguish different objects, rather than to describe a specific order of objects.

[0045] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the steps or modules listed, but may optionally include other steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or device.

[0046] Furthermore, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner.

[0047] With the development of the internet, various social media platforms have emerged, allowing people to share images and videos. To meet users' personalized needs, these platforms also offer image editing features. For example, some platforms have launched special effects editing tools, allowing users to create cooler and more interesting effects on their shared images.

[0048] Images with a personalized style, such as pixel-style images reminiscent of a bygone era, also known as retro images, have become a common special effect used by users in scenarios such as sharing images due to their unique and interesting artistic effects. However, the implementation of retro effects in related technologies generally only involves adjusting the image's tone, such as converting an image to sepia using a retro filter. This simply changes the image's tone, resulting in a poor representation of the retro effect.

[0049] To address the aforementioned issues, this application provides an image processing method to create a low-resolution vintage filter effect, allowing users to transform their images into the low-resolution vintage style popular in the early 2000s after applying the effect template. In this method, the image to be processed is compressed to obtain at least two compressed images, each with a different resolution. Each compressed image is then blurred to obtain a blurred compressed image corresponding to each compressed image. The multiple blurred compressed images are then blended to obtain the target image. This eliminates the need for manual parameter adjustments by the user, improving the efficiency of generating retro images. Furthermore, this solution not only gives the target image a retro style in terms of tone but also at the pixel level. Moreover, the blending of blurred images at different resolutions creates a glow effect in the blended image, enhancing the display effect of the retro image.

[0050] The image processing method of this application embodiment can be executed by an electronic device, which can be a terminal or a server, etc. This application embodiment does not impose any special limitations on the specific form of the electronic device. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a distributed system. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0051] After introducing the application scenarios of the embodiments of this application, the image processing method provided by the embodiments of this application will be described in detail below.

[0052] In some embodiments, the electronic device may display a gallery page. Then, in response to a user's image selection, the electronic device may acquire the image to be processed. Next, in response to a user's filter selection, the electronic device may determine a retro filter. Then, in response to a user's image processing operation, the electronic device may render the image to be processed using the retro filter to obtain the target image.

[0053] The following section details the process of using a retro filter to render an image on an electronic device to obtain the target image.

[0054] like Figure 1 As shown, an image processing method provided in an embodiment of this application is included:

[0055] S101. Obtain the image to be processed and compress it to obtain at least two compressed images.

[0056] Each compressed image has a different resolution.

[0057] It should be noted that the number of compressed images is not limited in the embodiments of this application. For example, the number of compressed images can be 3, 4, 5, etc.

[0058] In one possible implementation, the image to be processed can be downsampled according to multiple preset downsampling levels to obtain multiple compressed images, with each compressed image corresponding to a preset downsampling level and a resolution.

[0059] It should be noted that the purpose of downsampling is to reduce the resolution of the image, thereby reducing the image file size and speeding up processing. Multiple preset downsampling levels can be achieved through different downsampling algorithms or downsampling factors.

[0060] For example, the image to be processed can be downsampled using different downsampling algorithms to obtain multiple compressed images. The downsampling algorithms may include, but are not limited to, nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, Lanczos interpolation, etc.

[0061] Alternatively, different downsampling factors can be used to downsample the image to be processed, resulting in multiple compressed images. For example, the downsampling factor can be 2, 3, 4, etc. For instance, if the resolution of the image to be processed is 1920x1080 and the downsampling factor is 2, then the resolution of the downsampled image will be 960x540.

[0062] Optionally, the compression process described above may include texture compression.

[0063] S102. Perform image blurring processing on each compressed image to obtain the blurred compressed image corresponding to each compressed image.

[0064] It should be noted that the image blurring processing described in this application is not limited. For example, image blurring processing can be Gaussian blurring, mean blurring, bilateral filtering, Kawase blurring, etc. The following description uses Gaussian blurring as an example to illustrate the embodiments of this application.

[0065] In one possible implementation, a Gaussian function can be used to blur each compressed image, resulting in a blurred compressed image corresponding to each compressed image.

[0066] In one possible design, the blurred compressed image corresponding to each compressed image has the same degree of blurring. Alternatively, the blurred compressed image corresponding to each compressed image has a different degree of blurring.

[0067] It should be noted that the specific process of adjusting the blur level of each blurred compressed image can refer to the conventional techniques for adjusting the blur level of blurred images, and will not be elaborated on in this application embodiment.

[0068] S103. The target image is obtained by mixing multiple blurred and compressed images.

[0069] In one possible implementation, multiple blurred compressed images can be blended to obtain a blurred blended image. Then, the blurred blended image is blended with the image to be processed to obtain the target image.

[0070] In one possible design, multiple blurred and compressed images can be blended according to a preset blending strategy. This preset blending strategy includes: pixel-based blending, region-based blending, or feature-based blending.

[0071] Optionally, multiple blurred and compressed images can be blended according to a preset blending intensity. Different blending intensities correspond to different adjustments to the opacity and / or blending ratio of the images involved in the blending.

[0072] For example, the blending ratio of the blurred compressed image corresponding to high resolution is greater than that of the blurred compressed image corresponding to low resolution, and the opacity of the blurred compressed image corresponding to high resolution is greater than that of the blurred compressed image corresponding to low resolution.

[0073] It should be understood that the above is an exemplary description of mixing multiple blurred compressed images according to a preset mixing intensity, and the embodiments of this application do not limit the preset mixing intensity. Furthermore, during the mixing process, multiple blurred compressed images with different resolutions are upsampled to ensure that the resolution of each image is the same as the resolution of the image to be processed, thereby completing the mixing process.

[0074] Based on the above technical solution, multiple compressed images with different resolutions corresponding to the image to be processed are obtained. This reduces the amount of image data and improves the efficiency of subsequent image processing. Then, each compressed image can be blurred to obtain a blurred compressed image for each image. Finally, multiple blurred compressed images can be blended to obtain the target image. This eliminates the need for manual parameter adjustment by the user, improving the efficiency of retro image generation. Furthermore, the above solution not only gives the target image a retro style in terms of tone but also at the pixel level. Moreover, by blending blurred images at different resolutions, a glow effect is created in the blended image, improving the display effect of the retro image.

[0075] In some embodiments, after obtaining multiple blurred and compressed images, in order to improve the display effect of the retro image, relevant image processing can be performed on subsequent images to improve the display effect of the image.

[0076] like Figure 2 As shown, another image processing method provided in this application embodiment, wherein step S103 may include:

[0077] S201. Mix multiple blurred compressed images to obtain a blurred mixed image.

[0078] It should be noted that the method of mixing multiple blurred compressed images to obtain a blurred mixed image can be referred to the description of S103 in the above embodiment, and will not be repeated here.

[0079] S202. Extract the color value of the first color channel of each pixel in the blurred image to obtain the first color parameter.

[0080] It should be noted that the embodiments of this application do not limit the first color channel. For example, the first color channel can be a red channel, a green channel, a blue channel, or a cyan channel, a magenta channel, a yellow channel, and a black channel, etc. Furthermore, the embodiments of this application do not limit the number of first color channels, such as one or more first color channels.

[0081] In one possible implementation, the color value of each pixel in the blurred image is obtained. Then, the color value of the first color channel of each pixel is extracted according to the first color channel.

[0082] Optionally, the first color parameter also includes the relationship between the position of each pixel in the blurred blend image and the color value of the first color channel.

[0083] S203. Perform a color filtering operation on the image to be processed, and overlay the image after the color filtering operation on the image based on the first color parameter to obtain the target image.

[0084] Among them, Screen and Overlay are two different layer blending modes, and the embodiments of this application can be used in combination to produce specific effects.

[0085] Specifically, the Screen mode is a layer blending mode used to examine the color information in each channel and combine the complementary color of the blended color with the base color, resulting in a brighter color. In Screen mode, any color combined with white produces white, and any color combined with black remains unchanged. The Screen mode is similar to the imaging principle of televisions and monitors, using the superposition effect of light to obtain a brighter image.

[0086] When two colors are screened, if one is black, the result is unaffected; if the other is white, the result is white; screening with other colors will produce a bleaching effect.

[0087] In other words, after applying a color filter to the image, dark colors are removed while bright colors are retained, resulting in an overall brighter image. Furthermore, the overlay mode combines the features of both Multiply and Screen blending modes. In overlay mode, the brighter parts of the base colors become even brighter, while the darker parts become even darker.

[0088] For example, the color value (highColor.b) of the blue color channel of the blurred image can be stored in a preset color parameter green, and green can be used to perform color filtering on the image to be processed. Wherein, green = vec4(0.0,0.0,highColor.b,1.0).

[0089] Understandably, after obtaining the blurred blended image, the color value of the first color channel of each pixel in the blurred blended image can be extracted to obtain the first color parameter. Then, the filtered image to be processed can be superimposed based on the first color parameter, thus controlling the glow effect produced by the first color channel in the target image. Furthermore, since the image to be processed has undergone a color filtering operation, the overall brightness of the image can be increased, thereby further enhancing the glow effect of the target image.

[0090] In some embodiments, a first color-corrected image can be obtained by overlaying the first color parameter on the image to be processed after the color filtering operation. Then, image quality adjustment and / or color parameter adjustment are performed based on the first color-corrected image to obtain the target image.

[0091] In one possible implementation, after obtaining the first color-corrected image, image quality adjustment can be performed on the first color-corrected image to obtain the target image. This image quality adjustment refers to adjusting the image resolution or reducing noise details.

[0092] In the embodiments of this application, image quality adjustment includes at least one of the following: downsampling processing, image blurring processing, and adding noise.

[0093] In one possible design, after obtaining the first color-corrected image, the first color-corrected image can be downsampled to obtain the target image.

[0094] For example, by downsampling, the resolution of the target image can be reduced to one-quarter of that of the first color-corrected image.

[0095] Understandably, downsampling can not only reduce the amount of image data, thereby improving the efficiency of subsequent image processing, but also reduce the image resolution and detail, thus increasing the blurriness of the target image.

[0096] Alternatively, after obtaining the first color-corrected image, it can be blurred to obtain the target image.

[0097] This reduces noise and detail in the first color-corrected image, decreases the image's sense of depth, and makes the target image more blurred, thereby improving the display effect of the target image.

[0098] Alternatively, after obtaining the first color-corrected image, noise can be added to the first color-corrected image to obtain the target image.

[0099] This makes the image appear blurry to the user, thus improving the display effect of the target image.

[0100] Alternatively, after obtaining the first color-corrected image, it can be downsampled, noise can be added, and then the image can be blurred to obtain the target image.

[0101] It should be noted that the embodiments of this application do not limit the order or number of downsampling, image blurring, and noise addition processes. For example, one or more image quality adjustment strategies can be executed.

[0102] It is understandable that by adjusting the image quality of the first color-corrected image, the target image can appear more blurry and vintage, thereby improving the display effect of the target image.

[0103] In another possible implementation, after obtaining the first color-corrected image, image quality adjustment can be performed by adjusting the color parameters of the first color-corrected image to obtain the target image. Here, color parameter adjustment refers to adjusting the color parameters of the image.

[0104] In this application embodiment, color parameter adjustment includes at least one of the following: adjusting saturation, adjusting color difference offset, and increasing brightness.

[0105] In one possible design, a preset saturation filter can be used to process the first color-corrected image to obtain the target image.

[0106] The saturation filter is an image processing tool that alters the visual effect of an image by adjusting the saturation of colors. Saturation refers to the vividness of a color, which depends on the ratio of chromatic components to achromatic components (gray).

[0107] Alternatively, the second color channel can be determined from the first color-corrected image. Then, the second color channel of the first color-corrected image is adjusted for color difference to obtain the target image.

[0108] It should be noted that chromatic aberration, also known as color fringing, is a common phenomenon in optical systems, mainly occurring in the edge areas of images, especially high-contrast edges. It manifests as different wavelengths of light (such as red, blue, and green light) not focusing at the same location during imaging, resulting in color blurring or color separation at image edges. This application does not limit the second color channel. For example, the second color channel can be the same as the first color channel. Alternatively, the second color channel can be different from the first color channel.

[0109] It is understandable that by adjusting the color difference of the first color-corrected image, the edges of the target image will appear blurred or separated, thereby improving the display effect of the target image.

[0110] Alternatively, the brightness of the first color-corrected image can be increased to obtain the target image.

[0111] For example, the brightness value of the first color-corrected image can be increased.

[0112] It is understandable that since the first color-corrected image already has a glow effect, further increasing the brightness of the image can further enhance this glow effect, thereby improving the display effect of the target image.

[0113] Alternatively, after obtaining the first color-corrected image, the saturation of the first color-corrected image can be adjusted, color difference shift adjustment can be performed, and brightness can be increased to obtain the target image.

[0114] It should be noted that the embodiments of this application do not limit the execution order or number of adjustments to saturation, color difference shift, and brightness. For example, one or more color parameter adjustment strategies can be executed.

[0115] It is understandable that by adjusting the color parameters of the first color-corrected image, the colors of the target image can appear more vintage, thereby improving the display effect of the target image.

[0116] In another possible implementation, after obtaining the first color-corrected image, image quality and color parameters can be adjusted based on the first color-corrected image to obtain the target image.

[0117] Based on the above scheme, after obtaining the first color-corrected image, image quality and / or color parameter adjustments can be made based on the first color-corrected image to obtain the target image. This makes the target image appear more blurred and / or its colors more vintage, thereby improving the display effect of the target image.

[0118] In some embodiments, the image to be processed may include a target object region. The degree of blurring in different regions can be adjusted by applying different image blurring techniques to different regions.

[0119] like Figure 3 As shown, another image processing method provided in this application embodiment, wherein step S203 may include:

[0120] S301. Adjust the image quality and / or color parameters of the first color-corrected image to obtain the target adjusted image.

[0121] It should be noted that the description of image quality adjustment and / or color parameter adjustment of the first color-corrected image can be found in S203 of the above embodiment, and will not be repeated here.

[0122] S302. Perform image blurring on the target adjusted image to obtain a first blurred image and a second blurred image.

[0123] The target adjustment image can include the target object region and non-target object regions.

[0124] It should be noted that the target object region and the non-target object region can be divided according to the position of the target object in the image. This application does not limit the target object or the target object region. For example, in a photograph of a person, the target object region can be the area of ​​the person in the photograph, and the non-target object region can be the area outside the person in the photograph, such as the background area. In a photograph of an object, the target object region can be the area of ​​the object in the photograph, and the non-target object region can be the area outside the object in the photograph.

[0125] In the embodiments of this application, the degree of blurring and / or the blurring area are different between the first blurred image and the second blurred image.

[0126] In one possible design, the degree of blurring in the first blurred image is greater than the degree of blurring in the second blurred image. The blurred areas in the first blurred image represent non-target object regions, while the blurred areas in the second blurred image represent target object regions.

[0127] S303. Mix the first blurred image with the second blurred image to obtain the target image.

[0128] Among them, the blurriness of the target object region in the target image is less than that of the non-target object region.

[0129] In one possible implementation, the first blurred image and the second blurred image can be blended according to a preset blending strategy. This preset blending strategy includes: pixel-based blending, region-based blending, or feature-based blending.

[0130] In another possible implementation, the blending intensity can be obtained. Then, based on the blending intensity, the first blurred image and the second blurred image are blended to obtain the target image; different blending intensities correspond to different adjustments of the opacity and / or blending ratio of the images involved in the blending.

[0131] For example, suppose the blur level in the first blurred image is greater than the blur level in the second blurred image. The blurred area in the first blurred image is a non-target object region, while the blurred area in the second blurred image is a target object region. Then, the blending ratio of the second blurred image is greater than that of the first blurred image, and the opacity of the first blurred image is greater than that of the second blurred image.

[0132] It should be noted that the embodiments of this application do not limit the opacity and blending ratio. For example, the blending ratio can be 0.2, 0.4, 0.6, etc., and the opacity can be 0.2, 0.4, 0.6, etc.

[0133] Understandably, by adjusting the blending intensity, the ratio and opacity of the blending of the first and second blurred images can be adjusted. This allows for further adjustment of the display effect of the target object region within the target image.

[0134] In some embodiments, after blending the first blurred image and the second blurred image, a preset filter can be added to the blended blurred image to obtain a filter image. Then, according to the blending intensity, the filter image and the blended blurred image are blended to obtain the target image.

[0135] This application does not limit the specific filters used. Depending on their function and effect, preset filters can be divided into various types, such as pearlescent filters, blur filters, sharpening filters, special effects filters, color balance filters, etc. This application embodiment can select any filter to adjust the tone of the image.

[0136] For example, a pearlescent filter can be added, and the blend intensity can be set to a slider value to indicate the specific blending strength. This slider value is a floating-point constant between 0 and 1, with a default value of 1.0. The lower the slider value, the weaker the blending strength, and the weaker the filter effect on the target image; conversely, the higher the slider value, the stronger the filter effect. A target image adjusted for tone using a pearlescent filter will have a softer halo around the glowing areas, resulting in a better visual effect.

[0137] Based on the above technical solution, since the blur degree and / or blur area are different between the first blurred image and the second blurred image, the blending degree of different regions in the resulting target image may also be different. Setting the blur degree of the target object region in the target image to be less than the blur degree of the non-target object region can make the overall image blurry to achieve the effect of an old photo, while also making the target object region clearer than other regions, highlighting the display effect of the target object.

[0138] It should be noted that, in the above embodiments S301-S303, after obtaining the blurred mixed image, the quality, color, etc. of the blurred mixed image are further adjusted, and different regions are subjected to different degrees of Gaussian blurring to obtain the target image.

[0139] In some embodiments, in order to improve the generation efficiency of the target image, different regions can be subjected to different degrees of Gaussian blurring after obtaining the blurred mixed image to obtain the target image.

[0140] In one possible implementation, obtaining the target image by blending multiple blurred compressed images (i.e., S103) may include: blending the multiple blurred compressed images to obtain a blurred mixed image; then, performing image blurring processing on the blurred mixed image to obtain a first blurred image and a second blurred image; the first blurred image and the second blurred image have different degrees of blurring and / or different blurred areas. Then, blending the first blurred image and the second blurred image to obtain the target image, wherein the blurring degree of the target object region in the target image is less than the blurring degree of the non-target object region.

[0141] Understandably, since the degree of blur and / or the area of ​​blurring differ between the first and second blurred images, the degree of blending in different areas of the resulting target image may also vary. Setting the blur level of the target object area in the target image to be less than that of the non-target object areas allows the overall image to be blurred to achieve an old photo effect, while simultaneously making the target object area clearer than other areas, thus highlighting the display effect of the target object.

[0142] In some embodiments, the image to be processed can be color-corrected before downsampling to give it a more retro feel.

[0143] like Figure 4 As shown, another image processing method provided in this application embodiment is described, wherein step S101 may include:

[0144] S401. Based on the pixel value mapping relationship, the image to be processed is color-corrected to obtain a second color-corrected image.

[0145] The pixel value mapping relationship is used to indicate the mapping relationship between input pixel values ​​and output pixel values. It should be understood that, in this embodiment, the input pixel values ​​are the pixel values ​​of the pixels in the image to be processed.

[0146] For example, as shown in Table 1, it illustrates the pixel value mapping relationship.

[0147] Table 1

[0148] Input pixel value Output pixel values 0-31 0 32-127 Input pixel value 128-191 Input pixel value + 32 192-255 255

[0149] In other words, for pixels with input values ​​between 0 and 31, the output pixel value is mapped to 0, thus making the dark areas of the image darker. For pixels with input values ​​between 32 and 127, the output pixel value remains unchanged, preserving the grayscale of the central areas of the image. For pixels with input values ​​between 128 and 191, the output pixel value is mapped to the input value plus 32, which makes the bright areas of the image brighter. For pixels with input values ​​between 192 and 255, the output pixel value is mapped to 255, further enhancing the bright areas of the image.

[0150] It's important to note that pixel value mappings can be represented using a LUT (Look-Up Table). LUTs are widely used in computer graphics, digital image processing, video processing, color management, and many other fields. Essentially, a look-up table is an array or table that stores the mapping between input and output values. By querying this table, electronic devices can quickly convert an input value into its corresponding output value without complex calculations.

[0151] In image processing, LUTs are particularly useful for tasks such as color correction, color conversion, and color space conversion. For example, a color lookup table can define how to convert the color value of each pixel in an image from one color space (such as RGB) to another (such as CMYK), or simply adjust the brightness, contrast, and color balance of an image.

[0152] Understandably, color correction is applied to the image through pixel value mapping, making the colors more prominent. This enhances the color prominence of vintage images, thereby improving the display quality.

[0153] In some embodiments, a first region and a second region of the image to be processed can be determined first. The brightness of the first region is greater than or equal to a preset brightness threshold, and the brightness of the second region is less than the preset brightness threshold. Then, the first region of the image to be processed can be filled with a preset color, and the second region can be set to black. Then, based on the pixel value mapping relationship, the image to be processed is color-corrected to obtain a second color-corrected image.

[0154] It should be noted that the brightness threshold (adjustable_range) is 0-1, for example, it can be set to 0.8. This application embodiment does not limit the specific brightness threshold. The first region can be a bright region, the second region can be a dark region, or vice versa.

[0155] For any pixel in the image to be processed, if the color values ​​of all three RGB channels of the pixel are greater than the threshold, it is determined to be a bright area; otherwise, it is determined to be a dark area.

[0156] In one possible design, the default color is a blend color, which can be used to fill bright areas. For example, colors color1 = vec4(0.0117, 0.537, 1.0, 1.0) and color2 = vec4(0.415, 0.0, 0.988, 1.0) can be mixed at a blend strength of 0.95, resulting in color3 = mix(color1, color2, 0.95). Color3 will display as a purplish-blue. Then, color3 is blended with the image to be processed using a color-filtering method, and LUT is used to adjust the colors of the blended image.

[0157] Understandably, by filling the bright areas of the image to be processed with a preset color and setting the dark areas to black, the edges and details of the image can be highlighted. In this way, based on the pixel value mapping relationship, the image to be processed can be color-corrected to obtain a second color-corrected image, further enhancing the image's color effect.

[0158] S402. Perform downsampling processing on the second color-corrected image multiple times to obtain multiple compressed images.

[0159] In one possible implementation, the second color-corrected image can be downsampled according to multiple preset downsampling levels to obtain multiple compressed images, with each compressed image corresponding to a preset downsampling level and a resolution.

[0160] It should be noted that the embodiments of this application do not limit the number of downsampling processes of different degrees. For example, the resolution of the downsampled image can be 1 / 4, 1 / 16, 1 / 32, 1 / 64, 1 / 8, etc. of the initial image.

[0161] It should be noted that the process of performing multiple downsampling processes on the second color-corrected image at different degrees can be found in the description of the downsampling process of the image to be processed according to multiple preset downsampling degrees in S101, and will not be repeated here.

[0162] Based on the above technical solution, it is known that color correction of the image to be processed based on pixel value mapping can adjust the overall color effect of the image. Then, the second color-corrected image undergoes multiple downsampling processes of varying degrees to obtain multiple compressed images, thereby reducing the image data volume and resolution, and thus improving the image generation efficiency.

[0163] The embodiments of this application will be described below with specific examples. Step one: Based on the brightness threshold, determine as follows... Figure 5 The bright and dark areas of the image to be processed. Then, the colors color1 = vec4(0.0117, 0.537, 1.0, 1.0) and color2 = vec4(0.415, 0.0, 0.988, 1.0) are blended at an intensity of 0.95, and the result is denoted as color3 =

[0164] `mix(color1, color2, 0.95)`. Step two: Mix the colors of the image to be processed and color3 using the filter method to obtain the result as shown below. Figure 6 The image shown was edged to highlight details. Step three, you can use... Figure 7 The LUT diagram shown is a pair of Figure 6 The edged image was color-corrected to improve details, resulting in... Figure 8 The image shown is lutColor. Step four involves downsampling the lutColor image to varying degrees to obtain... Figure 9 The image shown is `resizeColor` (comprising 5 compressed images). Step five involves blurring the 5 compressed images in `resizeColor`, then summing them, and finally enhancing their brightness to obtain... Figure 10 The image shown is highColor. Step 6: Store the color value of the blue color channel of the highColor image into the color green, and denote green = vec4(0.0,0.0,highColor.b,1.0).

[0165] Step 7: Overlay the green color and the image to be processed using a color filter to obtain... Figure 11 The image shown is a color-corrected image. Step eight: [The text abruptly ends here, likely due to an incomplete Figure 11 The color-corrected image shown is downsampled, reduced to one-quarter of the original size, and grain noise is added to obtain... Figure 12 The image shown is rainColor. Step nine, [the text abruptly ends here]. Figure 13 The saturation filter shown is applied to Figure 12 The image shown, rainColor, is obtained. Figure 13 The image is lutColor2. Step 10 involves performing a color shift on the green color channel of image lutColor2 to obtain... Figure 14 The image shown is offsetColor. Step eleven: Blur the image offsetColor to obtain... Figure 15 The image shown is gaussColor. Step 12: Blur the target object region (such as the portrait area) of the image offsetColor, making the blurring less pronounced than that of the image gaussColor, to obtain... Figure 16 The image shown is gaussColor2.

[0166] Step thirteen: Blend the image gaussColor and the image gausssColor2. The blending mask is the image mask, meaning the image area is less blurred and the non-image area is more blurred, resulting in... Figure 17 The image shown is mixColor. Step fourteen: Add a pearlescent filter to the mixColor image to obtain... Figure 18 The image shown is lutColor3. Step fifteen: Blend the image mixColor and the image lutColor3, and set the blending intensity to the slider value (default 1.0), resulting in the image shown. Figure 19 The target image shown.

[0167] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above-mentioned functions, the image processing apparatus includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the image processing method steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0168] This application also provides an image processing apparatus. This image processing apparatus can be an electronic device, a CPU within the aforementioned electronic device, a processing module for image processing within the aforementioned electronic device, or a client device for displaying multimedia resources within the aforementioned electronic device.

[0169] This application embodiment can divide the image processing device into functional modules or functional units according to the above method examples. For example, each function can be divided into its own functional modules or functional units, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or in software functional modules or functional units. The module or unit division in this application embodiment is illustrative and represents only one logical functional division; other division methods may be used in actual implementation.

[0170] like Figure 20 The diagram shown is a structural schematic of an image processing apparatus provided in an embodiment of this application. The image processing apparatus is used to perform... Figure 1 The image processing method shown. The image processing apparatus may include an acquisition module 2001 and a processing module 2002.

[0171] The acquisition module 2001 is used to acquire the image to be processed and compress it to obtain at least two compressed images, each with a different resolution. The processing module 2002 is used to perform image blurring on each compressed image to obtain a blurred compressed image corresponding to each compressed image. The processing module 2002 is also used to blend multiple blurred compressed images to obtain a target image.

[0172] In one possible implementation, the processing module 2002 is further configured to blend multiple blurred compressed images to obtain a blurred blended image. The color value of the first color channel of each pixel in the blurred blended image is extracted to obtain a first color parameter. A color filtering operation is performed on the image to be processed, and the filtered image is superimposed based on the first color parameter to obtain the target image.

[0173] In one possible implementation, the processing module 2002 is further configured to perform overlay processing on the image to be processed after the color filtering operation of the first color parameters to obtain a first color-corrected image. Based on the first color-corrected image, image quality adjustment and / or color parameter adjustment are performed to obtain the target image.

[0174] One possible implementation method for image quality adjustment includes at least one of the following: downsampling, image blurring, and adding noise.

[0175] In one possible implementation, color parameter adjustment includes at least one of the following: adjusting saturation, adjusting color difference offset, and increasing brightness.

[0176] In one possible implementation, the image to be processed includes a target object region. The processing module 2002 is further configured to blend multiple blurred compressed images to obtain a blurred blended image. The blurred blended image is then subjected to image blurring processing to obtain a first blurred image and a second blurred image; the first blurred image and the second blurred image have different degrees of blurring and / or different blurred regions. The first blurred image and the second blurred image are then blended to obtain a target image, in which the blurring degree of the target object region is less than the blurring degree of the non-target object regions.

[0177] In one possible implementation, the acquisition module 2001 is further configured to acquire the blending intensity. The processing module 2002 is further configured to blend the first blurred image and the second blurred image based on the blending intensity to obtain the target image; different blending intensities correspond to different adjustments of the opacity and / or blending ratio of the images involved in the blending.

[0178] In one possible implementation, the acquisition module 2001 is further configured to color-correct the image to be processed based on the pixel value mapping relationship to obtain a second color-corrected image. The second color-corrected image is then subjected to multiple downsampling processes of varying degrees to obtain multiple compressed images.

[0179] In one possible implementation, the processing module 2002 is further configured to fill a first region of the image to be processed with a preset color and set a second region of the image to be processed to black, wherein the brightness of the first region is greater than or equal to a preset brightness threshold, and the brightness of the second region is less than the preset brightness threshold. Based on the pixel value mapping relationship, the image to be processed is color-corrected to obtain a second color-corrected image.

[0180] Figure 21 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. The electronic device may include a processor 2102, which is used to execute application code to implement the image processing method of this application.

[0181] The processor 2102 may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.

[0182] like Figure 21As shown, the electronic device may also include a memory 2103. The memory 2103 stores application code that executes the scheme of this application, and its execution is controlled by the processor 2102.

[0183] Memory 2103 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 2103 may exist independently and be connected to processor 2102 via bus 2104. Memory 2103 may also be integrated with processor 2102.

[0184] like Figure 21 As shown, the electronic device may also include a communication interface 2101, wherein the communication interface 2101, processor 2102, and memory 2103 may be coupled to each other, for example, through a bus 2104. The communication interface 2101 is used for information interaction with other devices, for example, supporting information interaction between the electronic device and other devices.

[0185] It should be pointed out that, Figure 21 The device structure shown does not constitute a limitation on the electronic device, except... Figure 21 In addition to the components shown, the electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0186] In actual implementation, the functions implemented by the processing module 2002 can be provided by... Figure 21 The processor 2102 shown calls the program code in memory 2103 to implement it.

[0187] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor of a computer device, enable the computer to perform the image processing method provided in the embodiments described above. For example, the computer-readable storage medium may be a memory 2103 including instructions, which may be executed by a processor 2102 of a computer device to complete the method. Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, such as a ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0188] Figure 22 A conceptual partial view of a computer program product provided in an embodiment of this application is shown schematically. The computer program product includes a computer program for executing computer processes on a computing device.

[0189] In one embodiment, the computer program product is provided using signal bearer medium 2200. Signal bearer medium 2200 may include one or more program instructions that, when executed by one or more processors, can provide the above-mentioned... Figure 1 The described function or part of the function. Therefore, for example, refer to... Figure 1 In the embodiment shown, one or more features of S101-S104 can be provided by one or more instructions associated with the signal carrying medium 2200. Furthermore, Figure 22 The program instructions in the document also describe example instructions.

[0190] In some examples, the signal carrying medium 2200 may include a computer-readable medium 2201, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video optical disc (DVD), a digital magnetic tape, a memory, a read-only memory (ROM), or a random access memory (RAM), and so on.

[0191] In some implementations, the signal carrying medium 2200 may include a computer recordable medium 2202, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, and so on.

[0192] In some implementations, the signal carrying medium 2200 may include a communication medium 2203, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).

[0193] The signal-bearing medium 2200 can be transmitted by a wireless communication medium 2203. One or more program instructions can be, for example, computer-executable instructions or logical implementation instructions.

[0194] In some examples, such as targeting Figure 20 The described image processing apparatus can be configured to provide various operations, functions, or actions in response to one or more program instructions in a computer-readable medium 2201, a computer-recordable medium 2202, and / or a communication medium 2203.

[0195] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0197] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the constituent units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0198] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0199] If the integrated unit is implemented as 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 embodiments of this application, essentially, or the part that contributes to the prior art, or a complete or partial classification of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, ROM, RAM, magnetic disk, or optical disk.

[0200] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that, The method includes: The image to be processed is compressed to obtain at least two compressed images, each with a different resolution. Each compressed image is subjected to image blurring processing to obtain a blurred compressed image corresponding to each compressed image; The target image is obtained by blending multiple blurred and compressed images.

2. The method according to claim 1, characterized in that, The process of mixing multiple blurred and compressed images to obtain a target image includes: The multiple blurred compressed images are blended to obtain a blurred blended image; Extract the color value of the first color channel of each pixel in the blurred image to obtain the first color parameter; The image to be processed is subjected to a color filtering operation, and the image after the color filtering operation is superimposed based on the first color parameter to obtain the target image.

3. The method according to claim 2, characterized in that, The target image is obtained by overlaying the filtered image onto the first color parameter, including: The first color parameter is applied to the image to be processed after the color filtering operation to obtain the first color-corrected image; The target image is obtained by adjusting the image quality and / or color parameters based on the first color-corrected image.

4. The method according to claim 1, characterized in that, The image to be processed includes a target object region. The target image is obtained by blending multiple blurred and compressed images, including: The multiple blurred compressed images are blended to obtain a blurred blended image; The blurred image is subjected to image blurring processing to obtain a first blurred image and a second blurred image; the first blurred image and the second blurred image have different degrees of blurring and / or different blurred areas; The first blurred image and the second blurred image are mixed to obtain the target image, wherein the blur degree of the target object region in the target image is less than the blur degree of the non-target object region.

5. The method according to claim 4, characterized in that, The step of mixing the first blurred image and the second blurred image to obtain the target image includes: Obtain the mixing intensity; Based on the blending intensity, the first blurred image and the second blurred image are blended to obtain the target image; different blending intensities correspond to different adjustments to the opacity and / or blending ratio of the images involved in the blending.

6. The method according to claim 1, characterized in that, The process of acquiring the image to be processed and compressing it yields at least two compressed images, including: The image to be processed is color-corrected based on the pixel value mapping relationship to obtain a second color-corrected image; The second color-corrected image is downsampled multiple times to different degrees to obtain multiple compressed images.

7. The method according to claim 6, characterized in that, The step of color-correcting the image to be processed based on pixel value mapping to obtain a second color-corrected image includes: The first region of the image to be processed is filled with a preset color, and the second region of the image to be processed is set to black. The brightness of the first region is greater than or equal to a preset brightness threshold, and the brightness of the second region is less than the preset brightness threshold. Based on the pixel value mapping relationship, the image to be processed is color-corrected to obtain the second color-corrected image.

8. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the image to be processed and perform compression processing to obtain at least two compressed images, each of which has a different resolution; The processing module is used to perform image blurring processing on each of the compressed images to obtain a blurred compressed image corresponding to each of the compressed images; The processing module is also used to mix multiple blurred and compressed images to obtain a target image.

9. An electronic device, characterized in that, include: Memory and processor; Memory and processor are coupled; The memory is used to store instructions that can be executed by the processor; When the processor executes the instructions, it performs the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-7.

11. A computer program product containing instructions, characterized in that, When the instructions are executed by a computer, the computer performs the method as described in any one of claims 1-7.