Image Processing Method, Apparatus, Device, and Computer-Readable Storage Medium

By obtaining and processing the attributes of the initial picture, determining the target reference picture and generating target pictures suitable for electronic devices, the problem of mismatch in picture display on devices with different screen sizes is solved and the display effect is improved.

CN112669291BActive Publication Date: 2025-07-08BEIJING PHOENIX AUTO INTELLIGENCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011623440.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2025-07-08
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

The image display effect of the same APP on electronic devices with different screen sizes is inconsistent, resulting in the problem of display mismatch.

Method used

By obtaining the attributes of the initial picture, determining the target reference picture, and processing it according to the picture attributes, a target picture adapted to the electronic device is generated.

Benefits of technology

Improve the display effect of pictures on electronic devices and ensure that pictures are suitable for devices with different screen sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112669291B_ABST
    Figure CN112669291B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method, apparatus, device and computer-readable storage medium, belonging to the field of computer technology. The method includes: obtaining an initial image to be processed and the image attributes of the initial image, where the image attributes include at least one of the image height, image width, image pixel quality and image format of the initial image, and the number of initial images is at least one; determining a target reference image based on the image attributes of the initial image, where the target reference image is an image matching at least one image attribute of the initial image; obtaining at least one processing method corresponding to the target reference image; processing the initial image according to the at least one processing method to obtain a target image, and the target image is adapted to an electronic device. This method enables the target image obtained after processing the initial image to be adapted to an electronic device, and the image processing process of the initial image is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technologies, and particularly to an image processing method, apparatus, device, and computer-readable storage medium. Background Art

[0002] With the continuous development of computer technologies, there are more and more brands of electronic devices, and the screen sizes of different brands of electronic devices are also different. Therefore, various adaptation problems are brought to application (APP) developers.

[0003] When the screen sizes of electronic devices are fragmented, it is easy to have the problem that the display sizes of pictures of the same APP on electronic devices with different screen sizes are the same. For example, when the display sizes of pictures of the same APP on an electronic device with a screen size of 320*480 and an electronic device with a screen size of 720*1280 are the same, if this display size is suitable for the screen of the electronic device with a screen size of 320*480, then it is not suitable for the screen of the electronic device with a screen size of 720*1280. This easily leads to the problem of poor display effects of pictures on electronic devices.

[0004] Therefore, there is an urgent need for an image processing method to process the pictures of APPs so that the display effects of the processed pictures on electronic devices are better. Summary of the Invention

[0005] Embodiments of the present application provide an image processing method, apparatus, device, and computer-readable storage medium, which can be used to solve the problems in the related technologies. The technical solutions are as follows:

[0006] On the one hand, embodiments of the present application provide an image processing method, and the method includes:

[0007] Obtain an initial picture to be processed and the picture attributes of the initial picture, where the picture attributes include at least one of the picture height, picture width, picture pixel quality, and picture format of the initial picture, and the number of the initial pictures is at least one;

[0008] Based on the picture attributes of the initial picture, determine a target reference picture, where the target reference picture is a picture that matches at least one picture attribute of the initial picture;

[0009] Obtain at least one processing method corresponding to the target reference picture;

[0010] Process the initial picture according to the at least one processing method to obtain a target picture, and the target picture is adapted to the electronic device.

[0011] In a possible implementation, determining the target reference picture based on the picture attributes of the initial picture includes:

[0012] Based on the picture attributes of the initial picture, determine the target reference picture in the picture repository, where the picture repository stores reference pictures and at least one picture corresponding to each reference picture, and the at least one picture corresponding to each reference picture is a picture with target picture attributes obtained after processing the reference picture.

[0013] In a possible implementation, before determining the target reference picture based on the picture attributes of the initial picture, the method further includes:

[0014] Obtain a picture sample set and target picture attributes, where the picture sample set includes reference pictures and the picture attributes of the reference pictures, and the target picture attributes are picture attributes adapted to the electronic device;

[0015] Based on the target picture attributes and the picture attributes of the reference pictures, process the reference pictures to obtain at least one picture with the target picture attributes;

[0016] Based on the reference pictures and the at least one picture, establish the picture repository.

[0017] In a possible implementation, processing the reference pictures based on the target picture attributes and the picture attributes of the reference pictures to obtain at least one picture with the target picture attributes includes at least one of the following:

[0018] In response to the target picture attribute being the target height and the picture height of the reference picture not matching the target height, process the picture height of the reference picture to obtain a first picture corresponding to the reference picture, where the picture height of the first picture matches the target height;

[0019] In response to the target picture attribute being the target width and the picture width of the reference picture not matching the target width, process the picture width of the reference picture to obtain a second picture corresponding to the reference picture, where the picture width of the second picture matches the target width;

[0020] In response to the target picture attribute being the target pixel quality and the picture pixel quality of the reference picture not matching the target pixel quality, process the picture pixel quality of the reference picture to obtain a third picture corresponding to the reference picture, where the picture pixel quality of the third picture matches the target pixel quality;

[0021] In response to the target picture attribute being the target format and the picture format of the reference picture not matching the target format, process the picture format of the reference picture to obtain a fourth picture corresponding to the reference picture, where the picture format of the fourth picture matches the target format.

[0022] In one possible implementation, the obtaining at least one processing method corresponding to the target reference picture includes at least one of the following:

[0023] In response to the picture height of the initial picture matching the picture height of the target reference picture, obtain a first picture corresponding to the target reference picture, and based on the target reference picture and the first picture, determine a first processing method, where the first picture is a picture obtained by processing the height of the target reference picture, and the first processing method is used for height processing;

[0024] In response to the picture width of the initial picture matching the picture width of the target reference picture, obtain a second picture corresponding to the target reference picture, and based on the target reference picture and the second picture, determine a second processing method, where the second picture is a picture obtained by processing the width of the target reference picture, and the second processing method is used for width processing;

[0025] In response to the picture pixel quality of the initial picture matching the picture pixel quality of the target reference picture, obtain a third picture corresponding to the target reference picture, and based on the target reference picture and the third picture, determine a third processing method, where the third picture is a picture obtained by processing the pixel quality of the target reference picture, and the third processing method is used for pixel quality processing;

[0026] In response to the picture format of the initial picture matching the picture format of the target reference picture, obtain a fourth picture corresponding to the target reference picture, and based on the target reference picture and the fourth picture, determine a fourth processing method, where the fourth picture is a picture obtained by processing the format of the target reference picture, and the fourth processing method is used for format processing.

[0027] In one possible implementation, the processing the initial picture according to the at least one processing method to obtain a target picture includes:

[0028] Combine the at least one processing method to obtain a target processing method;

[0029] Process the initial picture according to the target processing method to obtain the target picture.

[0030] In one possible implementation, the method further includes:

[0031] Process the initial image according to the at least one processing method to obtain at least one fifth image, where the fifth image is the image after being processed according to various processing methods respectively;

[0032] Add the initial image and the at least one fifth image to the image repository.

[0033] On the other hand, an embodiment of the present application provides an image processing device, and the device includes:

[0034] An acquisition module, configured to acquire an initial image to be processed and the image attributes of the initial image, where the image attributes include at least one of the image height, image width, image pixel quality, and image format of the initial image, and the number of the initial images is at least one;

[0035] A determination module, configured to determine a target reference image based on the image attributes of the initial image, where the target reference image is an image that matches at least one image attribute of the initial image;

[0036] The acquisition module is further configured to acquire at least one processing method corresponding to the target reference image;

[0037] A processing module, configured to process the initial image according to the at least one processing method to obtain a target image, and the target image is adapted to the electronic device.

[0038] In a possible implementation manner, the determination module is configured to determine the target reference image in the image repository based on the image attributes of the initial image, where the image repository stores reference images and at least one image corresponding to the reference image, and the at least one image corresponding to the reference image is an image with target image attributes obtained after processing the reference image.

[0039] In a possible implementation manner, the device further includes:

[0040] A building module, configured to acquire an image sample set and target image attributes, where the image sample set includes reference images and the image attributes of the reference images, and the target image attributes are image attributes adapted to the electronic device;

[0041] Based on the target image attributes and the image attributes of the reference images, process the reference images to obtain at least one image with the target image attributes;

[0042] Based on the reference images and the at least one image, build the image repository.

[0043] In a possible implementation, the determining module includes at least one of the following:

[0044] In response to the target picture attribute being the target height and the picture height of the reference picture not matching the target height, process the picture height of the reference picture to obtain a first picture corresponding to the reference picture, where the picture height of the first picture matches the target height;

[0045] In response to the target picture attribute being the target width and the picture width of the reference picture not matching the target width, process the picture width of the reference picture to obtain a second picture corresponding to the reference picture, where the picture width of the second picture matches the target width;

[0046] In response to the target picture attribute being the target pixel quality and the picture pixel quality of the reference picture not matching the target pixel quality, process the picture pixel quality of the reference picture to obtain a third picture corresponding to the reference picture, where the picture pixel quality of the third picture matches the target pixel quality;

[0047] In response to the target picture attribute being the target format and the picture format of the reference picture not matching the target format, process the picture format of the reference picture to obtain a fourth picture corresponding to the reference picture, where the picture format of the fourth picture matches the target format.

[0048] In a possible implementation, the obtaining module includes at least one of the following:

[0049] In response to the picture height of the initial picture matching the picture height of the target reference picture, obtain a first picture corresponding to the target reference picture, and based on the target reference picture and the first picture, determine a first processing method, where the first picture is a picture obtained by processing the height of the target reference picture, and the first processing method is used for height processing;

[0050] In response to the picture width of the initial picture matching the picture width of the target reference picture, obtain a second picture corresponding to the target reference picture, and based on the target reference picture and the second picture, determine a second processing method, where the second picture is a picture obtained by processing the width of the target reference picture, and the second processing method is used for width processing;

[0051] In response to the picture pixel quality of the initial picture matching the picture pixel quality of the target reference picture, obtain a third picture corresponding to the target reference picture, and determine a third processing method based on the target reference picture and the third picture. The third picture is a picture obtained by performing pixel quality processing on the target reference picture, and the third processing method is used for pixel quality processing;

[0052] In response to the picture format of the initial picture matching the picture format of the target reference picture, obtain a fourth picture corresponding to the target reference picture, and determine a fourth processing method based on the target reference picture and the fourth picture. The fourth picture is a picture obtained by performing format processing on the target reference picture, and the fourth processing method is used for format processing.

[0053] In a possible implementation manner, the processing module is configured to combine the at least one processing method to obtain a target processing method;

[0054] Process the initial picture according to the target processing method to obtain the target picture.

[0055] In a possible implementation manner, the processing module is further configured to process the initial picture according to the at least one processing method to obtain at least one fifth picture, where the fifth picture is a picture obtained by processing according to various processing methods respectively;

[0056] The apparatus further includes:

[0057] An adding module, configured to add the initial picture and the at least one fifth picture to the picture repository.

[0058] On the other hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory. At least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the picture processing method described in any one of the above.

[0059] On the other hand, a computer-readable storage medium is further provided. At least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor to implement the picture processing method described in any one of the above.

[0060] On the other hand, a computer program or a computer program product is further provided. At least one computer instruction is stored in the computer program or the computer program product, and the at least one computer instruction is loaded and executed by a processor to implement any one of the above picture processing methods.

[0061] The technical solutions provided by the embodiments of the present application at least bring the following beneficial effects:

[0062] The technical solution provided by the embodiment of the present application processes the initial image according to the processing method of the target reference image, so that the target image obtained after processing the initial image can adapt to the electronic device, and the image processing process of the initial image is more accurate. Then, when displaying the image, the processed target image is displayed, so that the display effect of the target image is better. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0064] Figure 1 is a schematic diagram of the implementation environment of a picture processing method provided by the embodiment of the present application;

[0065] Figure 2 is a flowchart of a picture processing method provided by the embodiment of the present application;

[0066] Figure 3 is a schematic diagram of the establishment of a picture warehouse provided by the embodiment of the present application;

[0067] Figure 4 is a flowchart of a picture processing method provided by the embodiment of the present application;

[0068] Figure 5 is a schematic diagram of the structure of a picture processing device provided by the embodiment of the present application;

[0069] Figure 6 is a schematic diagram of the structure of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0070] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the drawings.

[0071] Figure 1 is a schematic diagram of the implementation environment of a picture processing method provided by the embodiment of the present application, as Figure 1 shown, the implementation environment includes: an electronic device 101.

[0072] The electronic device 101 may be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, and a laptop computer. The electronic device 101 is used to execute the picture processing method provided in the embodiments of the present application.

[0073] The electronic device 101 may generally refer to one of a plurality of electronic devices. In this embodiment, only the electronic device 101 is taken as an example for illustration. Those skilled in the art can know that the number of the above-mentioned electronic devices 101 may be more or less. For example, the above-mentioned electronic device 101 may be only one, or the above-mentioned electronic device 101 may be dozens or hundreds, or more. The embodiments of the present application do not limit the number and type of the electronic devices.

[0074] Based on the above implementation environment, the embodiments of the present application provide a picture processing method to Figure 2 Taking the flowchart of a picture processing method provided in the embodiments of the present application shown as an example, this method may be executed by Figure 1 the electronic device 101 therein. As Figure 2 shown, this method includes the following steps 201 to step 204:

[0075] In step 201, obtain an initial picture to be processed and the picture attributes of the initial picture.

[0076] In a possible implementation, the image attributes include at least one of the image height, image width, image pixel quality, and image format of the initial image. Among them, the image height and image width are the number of pixel points occupied by the image in the height direction and the number of pixel points occupied by the image in the width direction, respectively. The image pixel quality is the number of bytes occupied by one pixel point in the image. The image format includes BMP (Bitmap) format, JPEG (Joint Photographic Experts Group) format, GIF (Graphics Interchange Format) format, PSD (Photoshop Document) format, PNG (Portable Network Graphics) format, TIFF (Tagged Image File Format) format, and TGA (Tagged Graphics) format. Of course, the image format may also include other formats. The embodiments of the present application only take the above several image formats as examples for illustration, and do not limit the image format.

[0077] In a possible implementation, the application includes multiple images, which are used to help the application display better. The initial image to be processed is any one of the images in the application, and the embodiments of the present application do not limit this. The number of initial images is at least one. The embodiments of the present application only take the number of initial images as one as an example for the description of image processing. When the number of initial images is multiple, the processing process of each initial image is the same as that of the image processing when the number of initial images is one. After obtaining the initial image to be processed, the attribute information of the initial image is called to obtain the image attributes of the initial image.

[0078] Exemplarily, the electronic device obtains the initial image and the image attributes of the initial image. The image attributes of the initial image are: the image height of the initial image is 500, the image width is 300, the image pixel quality is 4 bytes, and the image format is BMP format. Among them, 500 indicates that the number of pixel points occupied by the initial image in the height direction is 500, 400 indicates that the number of pixel points occupied by the initial image in the width direction is 400, and 4 bytes indicates that the number of bytes occupied by each pixel point is 4.

[0079] In step 202, based on the image attributes of the initial image, a target reference image is determined, and the target reference image is an image that matches at least one image attribute of the initial image.

[0080] Among them, the pictures that match at least one picture attribute of the initial picture include pictures that are consistent with at least one picture attribute of the initial picture, or pictures whose error from at least one picture attribute of the initial picture is within the target threshold. The target threshold can be set based on experience or adjusted according to the picture type of the initial picture, and the embodiments of this application do not limit this.

[0081] In a possible implementation, before determining the target reference picture based on the picture attributes of the initial picture, a picture warehouse needs to be established. The picture warehouse stores reference pictures and at least one picture corresponding to each reference picture. The at least one picture corresponding to a reference picture is a picture with target picture attributes obtained by processing the reference picture. The process of establishing the picture warehouse is as follows:

[0082] Obtain a picture sample set and target picture attributes. The picture sample set includes reference pictures and the picture attributes of the reference pictures. The target picture attributes are picture attributes suitable for the electronic device; based on the target picture attributes and the picture attributes of the reference pictures, process the reference pictures to obtain pictures with target picture attributes; establish a picture warehouse based on the reference pictures and at least one picture.

[0083] In a possible implementation, the pictures included in the picture sample set are pictures that do not meet the target picture attributes. The target picture attributes are any one of the target height, target width, target pixel quality, and target format supported by the electronic device. The process of determining the target picture attributes is as follows: The electronic device calls the setting function, and in the setting function, the picture height, picture width, and picture pixel quality supported by the electronic device can be obtained. As for the picture format, generally, the electronic device supports pictures in any format. Of course, there are also exceptions where some electronic devices only support one picture format or only support a target number of picture formats.

[0084] In a possible implementation, based on the target picture attributes and the picture attributes of the reference pictures, processing the reference pictures to obtain pictures with target picture attributes includes at least one of the following cases 1 to 4:

[0085] Case 1: In response to the target picture attribute being the target height and the picture height of the reference picture not matching the target height, process the picture height of the reference picture to obtain a first picture corresponding to the reference picture, and the picture height of the first picture matches the target height.

[0086] In a possible implementation, in response to the target picture attribute being the target height and the picture height of the reference picture not matching the target height, adjust the picture height of the reference picture to the target height to obtain an adjusted picture, which is also the first picture corresponding to the reference picture.

[0087] Exemplarily, the picture height of the reference picture is 500, the picture width is 300, the picture pixel quality is 4 bytes, the picture format is BMP format, and the target picture attribute is the target height of 400. Since the picture height of the reference picture is not consistent with the target height, the picture height of the reference picture is adjusted to the target height to obtain the first picture. The picture attributes of the first picture are that the picture height is 400, the picture width is 300, the picture pixel quality is 4 bytes, and the picture format is BMP format.

[0088] Case 2: In response to the target picture attribute being the target width and the picture width of the reference picture not matching the target width, process the picture width of the reference picture to obtain the second picture corresponding to the reference picture, and the picture width of the second picture matches the target width.

[0089] In a possible implementation, in response to the target picture attribute being the target width and the picture width of the reference picture not matching the target width, adjust the picture width of the reference picture to the target width to obtain the adjusted picture, which is also the second picture corresponding to the reference picture.

[0090] Exemplarily, the picture height of the reference picture is 500, the picture width is 300, the picture pixel quality is 4 bytes, the picture format is BMP format, and the target picture attribute is the target width of 180. Since the picture width of the reference picture is not consistent with the target width, the picture width of the reference picture is adjusted to the target width to obtain the second picture. The picture attributes of the second picture are that the picture height is 500, the picture width is 180, the picture pixel quality is 4 bytes, and the picture format is BMP format.

[0091] Case 3: In response to the target picture attribute being the target pixel quality and the picture pixel quality of the reference picture not matching the target pixel quality, process the picture pixel quality of the reference picture to obtain the third picture corresponding to the reference picture, and the picture pixel quality of the third picture matches the target pixel quality.

[0092] In a possible implementation, in response to the target picture attribute being the target pixel quality and the picture pixel quality of the reference picture not matching the target pixel quality, adjust the picture pixel quality of the reference picture to the target pixel quality to obtain the adjusted picture, which is also the third picture corresponding to the reference picture.

[0093] Exemplarily, the picture height of the reference picture is 500, the picture width is 300, the picture pixel quality is 4 bytes, the picture format is BMP format, and the target picture attribute is that the target pixel quality is 8 bytes. Since the picture pixel quality of the reference picture is inconsistent with the target pixel quality, the picture pixel quality of the reference picture is adjusted to the target pixel quality to obtain a third picture. The picture attributes of the third picture are that the picture height is 500, the picture width is 300, the picture pixel quality is 8 bytes, and the picture format is BMP format.

[0094] Situation 4: In response to the target picture attribute being the target format and the picture format of the reference picture not matching the target format, process the picture format of the reference picture to obtain a fourth picture corresponding to the reference picture, and the picture format of the fourth picture matches the target format.

[0095] In a possible implementation manner, in response to the target picture attribute being the target format and the picture format of the reference picture not matching the target format, adjust the picture format of the reference picture to the target format to obtain an adjusted picture, that is, the fourth picture corresponding to the reference picture.

[0096] Exemplarily, the picture height of the reference picture is 500, the picture width is 300, the picture pixel quality is 4 bytes, the picture format is BMP format, and the target picture attribute is that the target format is JPEG format. Since the picture format of the reference picture is inconsistent with the target format, the picture format of the reference picture is adjusted to the target format to obtain a fourth picture. The picture attributes of the fourth picture are that the picture height is 500, the picture width is 300, the picture pixel quality is 4 bytes, and the picture format is JPEG format.

[0097] In a possible implementation manner, after obtaining at least one picture with target picture attributes, when establishing a picture warehouse based on the reference picture and the at least one picture, divide the storage space of the picture warehouse into five equal parts to obtain five picture pools. Among them, the first picture pool is the reference picture pool, which is used to store the reference picture and the picture attributes of the reference picture; the second picture pool is the height picture pool, which is used to store the first picture corresponding to the reference picture, that is, the picture obtained by adjusting the picture height; the third picture pool is the width picture pool, which is used to store the second picture corresponding to the reference picture, that is, the picture obtained by adjusting the picture width; the fourth picture pool is the pixel quality picture pool, which is used to store the third picture corresponding to the reference picture, that is, the picture obtained by adjusting the picture pixel quality; the fifth picture pool is the format picture pool, which is used to store the fourth picture corresponding to the reference picture, that is, the picture obtained by adjusting the picture format.

[0098] In a possible implementation, the process of determining the target reference image based on the image attributes of the initial image is as follows: Based on the image attributes of the initial image, determine the target reference image in the reference image pool of the image repository, and the determined target reference image is the reference image that matches at least one image attribute of the initial image.

[0099] In step 203, obtain at least one processing method corresponding to the target reference image.

[0100] In a possible implementation, obtaining at least one processing method corresponding to the target reference image includes at least one of the following first to fourth cases.

[0101] In the first case, in response to the image height of the initial image matching the image height of the target reference image, obtain the first image corresponding to the target reference image, and based on the target reference image and the first image, determine the first processing method. The first image is the image obtained by processing the height of the target reference image, and the first processing method is used for height processing.

[0102] In a possible implementation, in response to the image height of the initial image matching the image height of the target reference image, obtain the first image corresponding to the target reference image in the height image pool of the image repository. The process of determining the first processing method based on the target reference image and the first image is as follows: Based on the target reference image, obtain the image height of the target reference image, based on the first image, obtain the image height of the first image, and based on the image height of the target reference image and the image height of the first image, determine the first processing method.

[0103] Exemplarily, the image height of the initial image is 500, and the image height of the target reference image is 500; since the image height of the initial image is the same as the image height of the target reference image, obtain the first image corresponding to the target reference image. The image height of the first image is 400, and based on the image height of the target reference image and the image height of the first image, determine the first processing method as: adjust the image height to 80% of the original.

[0104] In the second case, in response to the image width of the initial image matching the image width of the target reference image, obtain the second image corresponding to the target reference image, and based on the target reference image and the second image, determine the second processing method. The second image is the image obtained by processing the width of the target reference image, and the second processing method is used for width processing.

[0105] In a possible implementation, in response to the matching of the picture width of the initial picture and the picture width of the target reference picture, obtain the second picture corresponding to the target reference picture from the width picture pool in the picture repository. The process of determining the second processing method based on the target reference picture and the second picture is as follows: Based on the target reference picture, obtain the picture height of the target reference picture; based on the second picture, obtain the picture height of the second picture; based on the picture height of the target reference picture and the picture height of the second picture, determine the second processing method.

[0106] Exemplarily, the picture width of the initial picture is 300, and the picture width of the target reference picture is 300; since the picture width of the initial picture is the same as the picture width of the target reference picture, obtain the second picture corresponding to the target reference picture. The picture width of the second picture is 180. Based on the picture width of the target reference picture and the picture width of the second picture, determine the second processing method as: adjust the picture width to 60% of the original.

[0107] In the third case, in response to the matching of the picture pixel quality of the initial picture and the picture pixel quality of the target reference picture, obtain the third picture corresponding to the target reference picture. Based on the target reference picture and the third picture, determine the third processing method. The third picture is a picture obtained by performing pixel quality processing on the target reference picture, and the third processing method is used for pixel quality processing.

[0108] In a possible implementation, in response to the matching of the picture pixel quality of the initial picture and the picture pixel quality of the target reference picture, obtain the third picture corresponding to the target reference picture from the pixel quality picture pool in the picture repository. The process of determining the third processing method based on the target reference picture and the third picture is as follows: Based on the target reference picture, obtain the picture pixel quality of the target reference picture; based on the third picture, obtain the picture pixel quality of the third picture; based on the picture pixel quality of the target reference picture and the picture pixel quality of the third picture, determine the third processing method.

[0109] Exemplarily, the picture pixel quality of the initial picture is 4 bytes, and the picture display high-speed quality of the target reference picture is 4 bytes; since the picture pixel quality of the initial picture is the same as the picture pixel quality of the target reference picture, obtain the third picture corresponding to the target reference picture. The picture pixel quality of the third picture is 8 bytes. Based on the picture pixel quality of the target reference picture and the picture pixel quality of the third picture, determine the third processing method as: adjust the picture pixel quality to 200% of the original.

[0110] Fourth case: In response to the image format of the initial image matching the image format of the target reference image, obtain the fourth image corresponding to the target reference image. Based on the target reference image and the fourth image, determine the fourth processing method. The fourth image is an image obtained by performing format processing on the target reference image, and the fourth processing method is used for format processing.

[0111] In a possible implementation, in response to the image format of the initial image matching the image format of the target reference image, obtain the fourth image corresponding to the target reference image from the format image pool in the image repository. The process of determining the fourth processing method based on the target reference image and the fourth image is as follows: Based on the target reference image, obtain the image format of the target reference image. Based on the fourth image, obtain the image format of the fourth image. Based on the image format of the target reference image and the image format of the fourth image, determine the fourth processing method.

[0112] Exemplarily, the image format of the initial image is the BMP format, and the image format of the target reference image is the BMP format. Since the image format of the initial image is the same as the image format of the target reference image, obtain the fourth image corresponding to the target reference image. The image format of the fourth image is the JPEG format. Based on the image format of the target reference image and the image format of the fourth image, determine the fourth processing method as: Adjust the image format to the JPEG format.

[0113] It should be noted that in response to there being only one matching image attribute between the initial image and the target reference image, only obtain the processing method corresponding to the matching image attribute. In response to there being at least one matching image attribute between the initial image and the target reference image, obtain the processing method corresponding to each matching image attribute.

[0114] In step 204, process the initial image according to at least one processing method to obtain a target image, and the target image is adapted to the electronic device.

[0115] In a possible implementation, based on the at least one processing method obtained in the above step 203, the process of processing the initial image is as follows: Combine the at least one processing method to obtain a target processing method, and process the initial image according to the target processing method to obtain a target image.

[0116] The process of combining the at least one processing method to obtain a target processing method is: Merge the at least one processing method to obtain a target processing method.

[0117] Exemplarily, based on the four processing methods obtained in step 203 above, these four processing methods are combined to obtain a target processing method, which is: adjust the image height to 80% of the original, adjust the image width to 60% of the original, adjust the image pixel quality to 200% of the original, and adjust the image format to JPEG format. Process the initial image according to this target processing method to obtain a target image. The image attributes of the target image are: the image height is 400, the image width is 180, the image pixel quality is 8 bytes, and the image format is JPEG format.

[0118] It should be noted that the above is only an example with four processing methods. In the actual image processing process, there may not be four processing methods, and there may only be one processing method, two processing methods, or three processing methods.

[0119] In a possible implementation, after obtaining the target image after processing the initial image, the target image is displayed on the display interface of the electronic device.

[0120] In a possible implementation, the initial image can also be processed successively according to various processing methods to obtain at least one fifth image. The fifth image is the image processed according to various processing methods respectively; the initial image and at least one fifth image are added to the image repository.

[0121] Among them, the process of processing the initial image successively according to various processing methods to obtain at least one fifth image is as follows: process the initial image according to the first processing method to obtain the first fifth image; process the initial image according to the second processing method to obtain the second fifth image; process the initial image according to the third processing method to obtain the third fifth image; process the initial image according to the fourth processing method to obtain the fourth fifth image.

[0122] After obtaining at least one fifth image, the process of adding the initial image and at least one fifth image to the image repository is as follows: add the initial image to the reference image pool in the image repository; add the first fifth image to the height image pool in the image repository; add the second fifth image to the width image pool in the image repository; add the third fifth image to the pixel quality image pool in the image repository; add the fourth fifth image to the format image pool in the image repository. The purpose of adding the initial image and at least one fifth image corresponding to the initial image to the image repository is to increase the number of images in the image repository, so as to improve the accuracy of the determined target reference image when determining the target reference image based on the image repository in the subsequent process, and improve the accuracy of image processing when processing the image to be processed based on the processing method of the target reference image.

[0123] The above method processes the initial image according to the processing method of the target reference image, so that the target image obtained after processing the initial image can be adapted to the electronic device, and the image processing process of the initial image is more accurate. Then, when displaying the image, the processed target image is displayed, so that the display effect of the target image is better.

[0124] Figure 3 The following shows a schematic diagram of the establishment of a picture warehouse provided by an embodiment of the present application. In this Figure 3 process, the picture height of the reference picture is processed to obtain a first picture, and the first picture is stored in the height picture pool; the picture width of the reference picture is processed to obtain a second picture, and the second picture is stored in the width picture pool; the picture pixel quality of the reference picture is processed to obtain a third picture, and the third picture is stored in the pixel quality picture pool; the picture format of the reference picture is processed to obtain a fourth picture, and the fourth picture is stored in the format picture pool; the reference picture is stored in the reference picture pool. A picture warehouse is formed based on the reference picture pool, the height picture pool, the width picture pool, the pixel quality picture pool, and the format picture pool.

[0125] Figure 4 The following shows a flowchart of a picture processing method provided by an embodiment of the present application. In this Figure 4 process, based on the initial picture and the reference picture pool, the target reference picture corresponding to the initial picture is determined, and at least one processing method corresponding to the target reference picture is determined; the initial picture is processed based on the at least one processing method to obtain a target picture.

[0126] Figure 5 The following shows a schematic structural diagram of a picture processing device provided by an embodiment of the present application. As Figure 5 shown, the device includes:

[0127] An acquisition module 501, configured to acquire an initial picture to be processed and the picture attributes of the initial picture, where the picture attributes include at least one of the picture height, picture width, picture pixel quality, and picture format of the initial picture, and the number of the initial pictures is at least one;

[0128] A determination module 502, configured to determine a target reference picture based on the picture attributes of the initial picture, where the target reference picture is a picture that matches at least one picture attribute of the initial picture;

[0129] The acquisition module 501 is further configured to acquire at least one processing method corresponding to the target reference picture;

[0130] A processing module 503, configured to process the initial picture according to the at least one processing method to obtain a target picture, and the target picture is adapted to the electronic device.

[0131] In a possible implementation, the determining module 502 is configured to determine the target reference picture in the picture repository based on the picture attributes of the initial picture. The picture repository stores reference pictures and at least one picture corresponding to each reference picture. The at least one picture corresponding to each reference picture is a picture with target picture attributes obtained after processing the reference picture.

[0132] In a possible implementation, the apparatus further includes:

[0133] A building module, configured to obtain a picture sample set and target picture attributes. The picture sample set includes reference pictures and the picture attributes of the reference pictures. The target picture attributes are picture attributes adapted to the electronic device;

[0134] Based on the target picture attributes and the picture attributes of the reference pictures, process the reference pictures to obtain at least one picture with the target picture attributes;

[0135] Based on the reference pictures and the at least one picture, build the picture repository.

[0136] In a possible implementation, the determining module 502 includes at least one of the following:

[0137] In response to the target picture attribute being the target height and the picture height of the reference picture not matching the target height, process the picture height of the reference picture to obtain a first picture corresponding to the reference picture. The picture height of the first picture matches the target height;

[0138] In response to the target picture attribute being the target width and the picture width of the reference picture not matching the target width, process the picture width of the reference picture to obtain a second picture corresponding to the reference picture. The picture width of the second picture matches the target width;

[0139] In response to the target picture attribute being the target pixel quality and the picture pixel quality of the reference picture not matching the target pixel quality, process the picture pixel quality of the reference picture to obtain a third picture corresponding to the reference picture. The picture pixel quality of the third picture matches the target pixel quality;

[0140] In response to the target picture attribute being the target format and the picture format of the reference picture not matching the target format, process the picture format of the reference picture to obtain a fourth picture corresponding to the reference picture. The picture format of the fourth picture matches the target format.

[0141] In a possible implementation, the obtaining module 501 includes at least one of the following:

[0142] In response to the picture height of the initial picture matching the picture height of the target reference picture, obtain the first picture corresponding to the target reference picture, and based on the target reference picture and the first picture, determine the first processing method. The first picture is a picture obtained by performing height processing on the target reference picture, and the first processing method is used for height processing;

[0143] In response to the picture width of the initial picture matching the picture width of the target reference picture, obtain the second picture corresponding to the target reference picture, and based on the target reference picture and the second picture, determine the second processing method. The second picture is a picture obtained by performing width processing on the target reference picture, and the second processing method is used for width processing;

[0144] In response to the picture pixel quality of the initial picture matching the picture pixel quality of the target reference picture, obtain the third picture corresponding to the target reference picture, and based on the target reference picture and the third picture, determine the third processing method. The third picture is a picture obtained by performing pixel quality processing on the target reference picture, and the third processing method is used for pixel quality processing;

[0145] In response to the picture format of the initial picture matching the picture format of the target reference picture, obtain the fourth picture corresponding to the target reference picture, and based on the target reference picture and the fourth picture, determine the fourth processing method. The fourth picture is a picture obtained by performing format processing on the target reference picture, and the fourth processing method is used for format processing.

[0146] In a possible implementation manner, the processing module 503 is configured to combine the at least one processing method to obtain a target processing method;

[0147] Process the initial picture according to the target processing method to obtain the target picture.

[0148] In a possible implementation manner, the processing module 503 is further configured to process the initial picture according to the at least one processing method to obtain at least one fifth picture, and the fifth picture is a picture obtained by processing according to various processing methods respectively;

[0149] The apparatus further includes:

[0150] An adding module, configured to add the initial picture and the at least one fifth picture to the picture repository.

[0151] The above device processes the initial image in the same way as the target reference image, so that the target image obtained after processing the initial image can be adapted to the electronic device, and the image processing process of the initial image is more accurate. Then, when displaying the image, the processed target image is displayed, so that the display effect of the target image is better.

[0152] It should be understood that when the above Figure 5 provided device implements its functions, only the division of the above function modules is used for illustration. In actual applications, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the method embodiment belong to the same concept. For the specific implementation process, please refer to the method embodiment and will not be elaborated here.

[0153] Figure 6 FIG. shows a block diagram of an electronic device 600 provided by an exemplary embodiment of the present application. The electronic device 600 may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The electronic device 600 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.

[0154] Generally, the electronic device 600 includes: a processor 601 and a memory 602.

[0155] The processor 601 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0156] The memory 602 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 602 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 602 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 601 to implement the image processing method provided in the method embodiments of the present application.

[0157] In some embodiments, the electronic device 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602, and the peripheral device interface 603 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 603 through a bus, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608, and a power supply 609.

[0158] The peripheral device interface 603 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.

[0159] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.

[0160] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on or above the surface of the display screen 605. The touch signals can be input to the processor 601 as control signals for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 605, which is provided on the front panel of the electronic device 600; in other embodiments, there may be at least two display screens 605, which are respectively provided on different surfaces of the electronic device 600 or are in a foldable design; in other embodiments, the display screen 605 may be a flexible display screen, which is provided on the curved surface or the folding surface of the electronic device 600. Even, the display screen 605 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 605 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0161] The camera module 606 is used to capture images or videos. Optionally, the camera module 606 includes a front camera and a rear camera. Generally, the front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to implement functions such as background blurring by fusing the main camera and the depth-of-field camera, panoramic shooting by fusing the main camera and the wide-angle camera, and VR (Virtual Reality) shooting function or other fused shooting functions. In some embodiments, the camera module 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0162] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 601 for processing, or input them to the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 600. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.

[0163] The positioning component 608 is used to locate the current geographical location of the electronic device 600 to achieve navigation or LBS (Location Based Service). The positioning component 608 may be a positioning component based on the GPS (Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.

[0164] The power supply 609 is used to supply power to each component in the electronic device 600. The power supply 609 may be alternating current, direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0165] In some embodiments, the electronic device 600 further includes one or more sensors 610. The one or more sensors 610 include but are not limited to: an acceleration sensor 611, a gyroscope sensor 612, a pressure sensor 613, a fingerprint sensor 614, an optical sensor 615, and a proximity sensor 616.

[0166] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the electronic device 600. For example, the acceleration sensor 611 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for games or the collection of the user's motion data.

[0167] The gyroscope sensor 612 can detect the body orientation and rotation angle of the electronic device 600. The gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect the 3D actions of the user on the electronic device 600. Based on the data collected by the gyroscope sensor 612, the processor 601 can implement the following functions: motion sensing (such as changing the UI according to the user's tilting operation), image stabilization during shooting, game control, and inertial navigation.

[0168] The pressure sensor 613 can be disposed on the side frame of the electronic device 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is disposed on the side frame of the electronic device 600, it can detect the holding signal of the user on the electronic device 600, and the processor 601 can perform left / right hand recognition or quick operation based on the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed on the lower layer of the display screen 605, the processor 601 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 605. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0169] The fingerprint sensor 614 is used to collect the fingerprints of the user. The processor 601 can identify the user's identity based on the fingerprints collected by the fingerprint sensor 614, or the fingerprint sensor 614 can identify the user's identity based on the collected fingerprints. When the identified user identity is a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, and the sensitive operations include unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings, etc. The fingerprint sensor 614 can be disposed on the front, back, or side of the electronic device 600. When there are physical buttons or manufacturer logos on the electronic device 600, the fingerprint sensor 614 can be integrated with the physical buttons or manufacturer logos.

[0170] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is decreased. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera module 606 according to the ambient light intensity collected by the optical sensor 615.

[0171] A proximity sensor 616, also known as a distance sensor, is usually disposed on the front panel of the electronic device 600. The proximity sensor 616 is used to collect the distance between the user and the front of the electronic device 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from the lit state to the off state; when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from the off state to the lit state.

[0172] Those skilled in the art can understand that Figure 6 the structure shown in does not constitute a limitation on the electronic device 600, and may include more or fewer components than those shown, or combine certain components, or adopt a different component layout.

[0173] In an exemplary embodiment, there is also provided a computer-readable storage medium storing at least one program code, which is loaded and executed by a processor to implement any one of the above-described picture processing methods.

[0174] Optionally, the above computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0175] In an exemplary embodiment, there is also provided a computer program or a computer program product storing at least one computer instruction, which is loaded and executed by a processor to implement any one of the above-described picture processing methods.

[0176] It should be understood that the term "plurality" as mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0177] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0178] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for image processing, characterized in that, The method includes: Obtaining an initial image to be processed and the image attributes of the initial image, where the image attributes include at least one of the image height, image width, image pixel quality, and image format of the initial image, and the number of the initial images is at least one; Based on the image attributes of the initial image, determining a target reference image in the reference image pool of the image repository, where the target reference image is an image that matches at least one image attribute of the initial image; Obtaining at least one processing method corresponding to the target reference image; Processing the initial image according to the at least one processing method to obtain a target image, where the target image is adapted to an electronic device; The process of establishing the image repository includes: obtaining an image sample set and target image attributes, where the image sample set includes reference images and the image attributes of the reference images, and the target image attributes are image attributes adapted to the electronic device; based on the target image attributes and the image attributes of the reference images, processing the reference images to obtain at least one image with the target image attributes; establishing the image repository based on the reference images and the at least one image; the image repository includes a reference image pool, a height image pool, a width image pool, a pixel quality image pool, and a format image pool, and the reference image pool is used to store the reference images and the attributes of the reference images.

2. The method according to claim 1, wherein The processing the reference images based on the target image attributes and the image attributes of the reference images to obtain at least one image with the target image attributes includes at least one of the following: In response to the target image attribute being a target height and the image height of the reference image not matching the target height, processing the image height of the reference image to obtain a first image corresponding to the reference image, where the image height of the first image matches the target height; In response to the target image attribute being a target width and the image width of the reference image not matching the target width, processing the image width of the reference image to obtain a second image corresponding to the reference image, where the image width of the second image matches the target width; In response to the target image attribute being a target pixel quality and the image pixel quality of the reference image not matching the target pixel quality, processing the image pixel quality of the reference image to obtain a third image corresponding to the reference image, where the image pixel quality of the third image matches the target pixel quality; In response to the target image attribute being a target format and the image format of the reference image not matching the target format, processing the image format of the reference image to obtain a fourth image corresponding to the reference image, where the image format of the fourth image matches the target format.

3. The method according to claim 1 or 2, characterized in that, The obtaining at least one processing method corresponding to the target reference image includes at least one of the following: In response to the picture height of the initial picture matching the picture height of the target reference picture, obtain the first picture corresponding to the target reference picture. Based on the target reference picture and the first picture, determine the first processing method. The first picture is a picture obtained by performing height processing on the target reference picture, and the first processing method is used for height processing; In response to the picture width of the initial picture matching the picture width of the target reference picture, obtain the second picture corresponding to the target reference picture. Based on the target reference picture and the second picture, determine the second processing method. The second picture is a picture obtained by performing width processing on the target reference picture, and the second processing method is used for width processing; In response to the picture pixel quality of the initial picture matching the picture pixel quality of the target reference picture, obtain the third picture corresponding to the target reference picture. Based on the target reference picture and the third picture, determine the third processing method. The third picture is a picture obtained by performing pixel quality processing on the target reference picture, and the third processing method is used for pixel quality processing; In response to the picture format of the initial picture matching the picture format of the target reference picture, obtain the fourth picture corresponding to the target reference picture. Based on the target reference picture and the fourth picture, determine the fourth processing method. The fourth picture is a picture obtained by performing format processing on the target reference picture, and the fourth processing method is used for format processing.

4. The method according to claim 1 or 2, characterized in that, The step of processing the initial picture according to the at least one processing method to obtain a target picture includes: Combine the at least one processing method to obtain a target processing method; Process the initial picture according to the target processing method to obtain the target picture.

5. The method according to claim 1 or 2, characterized in that, The method further includes: Process the initial picture according to the at least one processing method to obtain at least one fifth picture. The fifth picture is a picture obtained by processing according to various processing methods respectively; Add the initial picture and the at least one fifth picture to the picture repository.

6. An image processing apparatus, characterized in that, The apparatus includes: An acquisition module, configured to acquire an initial picture to be processed and the picture attributes of the initial picture. The picture attributes include at least one of the picture height, picture width, picture pixel quality, and picture format of the initial picture, and the number of initial pictures is at least one; A determination module, configured to determine a target reference picture in a reference picture pool of a picture repository based on the picture attributes of the initial picture. The target reference picture is a picture that matches at least one picture attribute of the initial picture; The acquisition module is further configured to acquire at least one processing method corresponding to the target reference picture; A processing module, configured to process the initial picture according to the at least one processing method to obtain a target picture, and the target picture is adapted to an electronic device. A building module, configured to obtain a picture sample set and target picture attributes, where the picture sample set includes reference pictures and the picture attributes of the reference pictures, and the target picture attributes are picture attributes adapted to the electronic device; process the reference pictures based on the target picture attributes and the picture attributes of the reference pictures to obtain at least one picture with the target picture attributes; establish the picture repository based on the reference pictures and the at least one picture; the picture repository includes a reference picture pool, a height picture pool, a width picture pool, a pixel quality picture pool, and a format picture pool, and the reference picture pool is used to store the reference pictures and the attributes of the reference pictures.

7. An electronic device, characterized in that, The electronic device includes a processor and a memory, and at least one program code is stored in the memory and is loaded and executed by the processor to implement the picture processing method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, At least one program code is stored in the computer-readable storage medium and is loaded and executed by a processor to implement the picture processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image conversion method and device, storage medium and electronic device

    CN110163794A

  • Picture display method and device, storage medium and intelligent equipment

    CN111176602A