CN113808120A - Image processing method, image processing device, electronic equipment and storage medium - Google Patents

Image processing method, image processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113808120A
CN113808120A CN202111123949.7A CN202111123949A CN113808120A CN 113808120 A CN113808120 A CN 113808120A CN 202111123949 A CN202111123949 A CN 202111123949A CN 113808120 A CN113808120 A CN 113808120A
Authority
CN
China
Prior art keywords
image
color
pixel block
sub
filling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111123949.7A
Other languages
Chinese (zh)
Inventor
吴禹辰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202111123949.7A priority Critical patent/CN113808120A/en
Publication of CN113808120A publication Critical patent/CN113808120A/en
Priority to PCT/CN2022/119581 priority patent/WO2023045857A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Abstract

The application discloses an image processing method and device, electronic equipment and a storage medium, and belongs to the field of image processing. The method comprises the following steps: obtaining a pixel block image corresponding to the first image based on the first image which is divided according to the preset size and the RGB value of each pixel point in the first image, wherein the pixel block image comprises M pixel block sub-images, and M is a positive integer; dividing the pixel block image into K color block areas based on first color parameters of each pixel block sub-image, wherein the first color parameters comprise hue and lightness, K is a positive integer and is less than or equal to M; and determining the filling colors of each color block region from the N filling colors corresponding to the pixel block images based on the RGB mean values of the color block regions to obtain a second image, wherein the filling colors are used for filling the corresponding color block regions, the N filling colors corresponding to the pixel block images are determined based on preset color categories, the RGB values of the sub-images of the pixel blocks and second color parameters, the second color parameters comprise brightness and saturation, and N is a positive integer.

Description

Image processing method, image processing device, electronic equipment and storage medium
Technical Field
The present application belongs to the field of image processing, and in particular, relates to an image processing method, an image processing apparatus, an electronic device, and a storage medium.
Background
With the development of image processing technology and the pursuit of users for the image appearance, the elements displayed by the image are more diversified and the color is more and more abundant.
However, due to the difference of the aesthetic sense of the users, the demands of the users on the personalized images are higher and higher, and the existing image processing method still cannot meet the personalized demands of the users.
Disclosure of Invention
An embodiment of the present application provides an image processing method, an image processing apparatus, an electronic device, and a storage medium, which can solve a problem that an existing image processing method cannot meet personalized requirements of a user.
In a first aspect, an embodiment of the present application provides an image processing method, including:
obtaining a pixel block image corresponding to a first image based on the first image which is divided according to a preset size and RGB values of all pixel points in the first image, wherein the pixel block image comprises M pixel block sub-images, and M is a positive integer;
dividing the pixel block image into K color block regions based on first color parameters of the pixel block sub-images, wherein the first color parameters comprise hue and lightness, K is a positive integer and is less than or equal to M;
and determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB mean value of the color block region to obtain a second image, wherein the filling color is used for filling the color block region corresponding to the pixel block image, the N filling colors corresponding to the pixel block image are determined based on a preset color category, the RGB value of each pixel block sub-image and a second color parameter, the second color parameter comprises lightness and saturation, and N is a positive integer.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
the image processing device comprises a first dividing unit, a second dividing unit and a processing unit, wherein the first dividing unit is used for obtaining a pixel block image corresponding to a first image based on the first image which is divided according to a preset size and RGB values of all pixel points in the first image, the pixel block image comprises M pixel block sub-images, and M is a positive integer;
the second dividing unit is used for dividing the pixel block image into K color block areas based on the first color parameters of the pixel block sub-images, wherein the first color parameters comprise hue and lightness, K is a positive integer and is not more than M;
and the color filling unit is used for determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB average value of the color block region to obtain a second image, wherein the filling color is used for filling the corresponding color block region, the N filling colors corresponding to the pixel block image are determined based on a preset color category, the RGB value of each pixel block sub-image and a second color parameter, the second color parameter comprises lightness and saturation, and N is a positive integer.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, the first image is divided into a plurality of pixel block sub-images based on the RGB values of all pixel points in the first image, a pixel block image corresponding to the first image is obtained, the pixel block image is divided into a plurality of color block regions based on the difference degree of lightness or hue between all pixel block sub-images in the pixel block image, a plurality of pixel block sub-image sets belonging to the same type of color are determined based on the RGB values and preset color types of all pixel block sub-images in the pixel block image, so that a few types of color types with large distribution range in the pixel block image are determined, filling colors for filling colors in all the color block regions are determined according to the lightness and saturation of all the pixel block sub-images corresponding to each type of color, and the main hue and the filling colors distributed in the first image can be represented by the few types of filling colors, and generating a second image, wherein the second image is formed by splicing a plurality of pure-color blocks, so that a very simplified style visual effect with simple and striking colors can be provided for a user, the user can set the personalized style of the image, and the personalized requirements of the user are met.
Drawings
Fig. 1 is a schematic flowchart of an image processing method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a second image generated by an image processing method provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of dividing a color block region provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a display of a subject color identifier provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image processing method, the image processing apparatus, the electronic device, and the storage medium according to the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The image processing method, the image processing apparatus, the electronic device, and the storage medium according to the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of an image processing method provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
step 101, obtaining a pixel block image corresponding to a first image based on the first image divided according to a preset size and RGB values of pixel points in the first image, wherein the pixel block image comprises M pixel block sub-images, and M is a positive integer;
specifically, the first image described in the embodiment of the present application may be an image stored inside the electronic device, or may also be an image received by the electronic device from the outside, and may include a color image, a grayscale image, and a black-and-white image, and may specifically be an image in a system theme stored in the electronic device or a captured image, which is not specifically limited herein.
The preset size described in the embodiment of the present application may be a preset defined size. The first image divided according to the preset size is composed of M first sub-images with preset sizes. Wherein M is a positive integer.
In this embodiment of the application, the electronic Device may be any terminal Device supporting image display, such as a mobile phone, a touch screen computer, a handheld computer, a vehicle-mounted terminal, a wearable Device, a PAD (Portable Android Device), and the like, and this embodiment of the application is not specifically limited herein.
The pixel block sub-image described in the embodiment of the present application is obtained by performing average calculation on RGB values of pixels in each first sub-image in the first image, and adjusting all pixels in each first sub-image to the average value.
The pixel block image described in the embodiment of the present application refers to an image formed by pixel block sub-images after processing M first sub-images in a first image into the pixel block sub-images, where the pixel block image includes M pixel block sub-images.
102, dividing the pixel block image into K color block areas based on a first color parameter of each pixel block sub-image, wherein the first color parameter comprises hue and lightness, K is a positive integer and is less than or equal to M;
specifically, the first color parameter described in the embodiment of the present application includes hue and lightness, which are used to determine a color difference between sub-images of pixel blocks in a pixel block image, so as to perform color block region division.
It should be noted that, in order to ensure the appearance of the finally generated color-block image, in the embodiment of the present application, the divided color-block region at least includes two pixel block sub-images.
In the embodiment of the application, as a user can intuitively feel the difference between different colors through the hue and the lightness, the pixel block sub-image region with obviously changed hue or lightness in the pixel block image can be judged according to the hue or the lightness of each pixel block sub-image in the pixel block image, namely, the hue or the lightness of adjacent pixel block sub-images in the pixel block sub-image region have obvious difference, the color types corresponding to the adjacent pixel block sub-images are obviously different, and then the pixel block sub-image region with hue or lightness difference in each part of the pixel block image is divided, so that K color block regions can be obtained. Illustratively, K may take a value of 5, 7, 10, etc., which is determined according to the color distribution in the actual first image, and the application is not limited thereto.
The color block region described in the embodiment of the present application refers to a region determined by dividing a pixel block image into color blocks based on a first color parameter between pixel block sub-images.
And 103, determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB mean value of the color block region to obtain a second image, wherein the filling color is used for filling the color block region corresponding to the pixel block image, the N filling colors corresponding to the pixel block image are determined based on a preset color category, the RGB value of each pixel block sub-image and a second color parameter, the second color parameter includes lightness and saturation, and N is a positive integer.
Specifically, in the embodiment of the present application, the colors of the pixel block sub-images in the color block region are similar, but there are some differences, and in order to determine the dominant hue of the color block region, the dominant hue may be determined by calculating the average value of the RGB values of the pixel block sub-images in the color block region.
The RGB mean value of the color block region described in the embodiment of the present application is obtained by calculating the mean value of the RGB values of the pixel block sub-images in the color block region.
The preset color category described in the embodiment of the present application refers to a color category preset in the present application, for example, the preset color category may be 10 types of colors, such as red, orange, yellow, green, cyan, blue, purple, black, white, and gray, each type of color has a corresponding RGB value region, and the color category corresponding to each pixel block sub-image may be determined by the RGB value interval corresponding to each color category and the RGB value of each pixel block sub-image.
The fill color described in the embodiments of the present application refers to a color for filling each color patch area.
The second image described in the embodiment of the present application refers to a color block image obtained by performing color block area division on a pixel block image and then filling colors into each color block area.
The second color parameter described in the embodiments of the present application includes lightness or saturation, which is used to perform color expansion on a pixel block sub-image color having a dominant hue feature selected from a pixel block image to generate a fill color.
The N filling colors corresponding to the pixel block image described in the embodiment of the present application refer to colors that can represent a dominant hue and a color distribution of the pixel block image, and are determined based on a preset color category, an RGB value of each pixel block sub-image, and a second color parameter, and a specific obtaining manner of the N filling colors may be that, a pixel block sub-image corresponding to each preset color category in the pixel block image is determined according to the RGB value of each pixel block sub-image in the image and the RGB value corresponding to the preset color category, so as to select a color category that can represent a dominant hue and a color distribution of the first image, and brightness or saturation adjustment is performed on the pixel block sub-images corresponding to the color categories, so as to obtain N filling colors corresponding to the pixel block image, where N is a positive integer. Illustratively, N may take a value of 4, 6, 12, etc., which is determined according to actual computing requirements, and is not specifically limited herein.
Further, according to the RGB mean value of the color block region and the RGB value of each fill color, the fill color for color filling of each color block region can be determined from the N fill colors corresponding to the pixel block image.
In the embodiment of the present application, after the filling colors of the color block regions are determined, the filling colors are filled into the color block regions corresponding to each other, so that a color block image, that is, a second image can be obtained. The second image has a simple color block style, and can meet the personalized requirements of users.
Fig. 2 is a schematic view of a second image generated by the image processing method provided in the embodiment of the present application, and exemplarily, as shown in fig. 2, the second image is a color block image, and includes 3 color block regions, and colors in each color block region are different and are respectively blue, orange, and red.
In the embodiment of the application, the first image is divided into a plurality of pixel block sub-images based on the RGB values of all pixel points in the first image, a pixel block image corresponding to the first image is obtained, the pixel block image is divided into a plurality of color block regions based on the difference degree of lightness or hue between all pixel block sub-images in the pixel block image, a plurality of pixel block sub-image sets belonging to the same type of color are determined based on the RGB values and preset color types of all pixel block sub-images in the pixel block image, so that a few types of color types with large distribution range in the pixel block image are determined, filling colors for filling colors in all the color block regions are determined according to the lightness and saturation of all the pixel block sub-images corresponding to each type of color, and the main hue and the filling colors distributed in the first image can be represented by the few types of filling colors, and generating a second image, wherein the second image is formed by splicing a plurality of pure-color blocks, so that a very simplified style visual effect with simple and striking colors can be provided for a user, the user can set the personalized style of the image, and the personalized requirements of the user are met.
Optionally, before the determining the filling color of each color block region from the N filling colors corresponding to the pixel block image, the method further includes:
determining a pixel block sub-image set corresponding to each preset color class based on the RGB value of each pixel block sub-image and the RGB value interval corresponding to each preset color class, wherein each pixel block sub-image set comprises one or more pixel block sub-images;
determining L target pixel block sub-image sets in each pixel block sub-image set based on the number of pixel block sub-images in each pixel block sub-image set, wherein L is a positive integer;
determining a target pixel block sub-image in the target pixel block sub-image set based on the second color parameter of each pixel block sub-image in the target pixel block sub-image set;
and generating N filling colors corresponding to the pixel block images based on the target pixel block subimages.
Specifically, in the embodiment of the present application, the RGB values of the pixel block sub-images are compared with the RGB value intervals corresponding to the preset color categories, so as to classify the colors of the pixel block sub-images in the pixel block image, and determine the preset color categories corresponding to the pixel block sub-images, so as to subsequently determine the pixel block sub-images capable of representing the main hue and color distribution of the first image.
The set of pixel-block sub-images described in the embodiments of the present application refers to a set of pixel-block sub-images belonging to the same color class, which may include one or more pixel-block sub-images.
The target pixel block sub-image set described in the embodiment of the present application refers to L pixel block sub-image sets selected from the respective pixel block sub-image sets, where the color category corresponding to the target pixel block sub-image set may represent a dominant hue and a color distribution of the first image, and L is a positive integer. Illustratively, L may be 4, 5, 7, etc., which are determined specifically according to actual calculations, and the present application is not limited thereto specifically.
In the embodiment of the present application, by determining the number of each pixel block sub-image in the pixel block sub-image set, the distribution range of the preset color category corresponding to each pixel block sub-image set in the pixel block image can be determined, for example, the color category is that the number of the pixel block sub-images in the pixel block sub-image set corresponding to red is the largest, which indicates that the color distribution range of red in the pixel block image is the largest; the number of the pixel block sub-images in the pixel block sub-image set corresponding to the color category of yellow is the minimum, which indicates that the color distribution range of yellow in the pixel block image is the minimum.
Further, based on the number of the pixel block sub-images in each pixel block sub-image set, sorting the pixel block sub-images from at least two to screen out the first pixel block sub-image sets with a larger number of pixel block sub-images, thereby determining a plurality of pixel block sub-image sets capable of representing the dominant hue and color distribution of the first image, and obtaining each target pixel block sub-image set.
The target pixel block sub-image described in the embodiments of the present application is determined based on the second color parameters, i.e. brightness and saturation, of each pixel block sub-image in the target pixel block sub-image set, which may represent the color with the most balanced color parameter in the same preset color category.
Optionally, in an embodiment of the present application, the brightness and the saturation of each pixel block sub-image in the target pixel block sub-image set are sorted, for example, the colors of each pixel block sub-image are sorted according to a rule from dark to bright and from gray to pure, then the pixel block sub-image at the center position is selected from the sorted pixel block sub-images, and the pixel block sub-image at the center position is taken as the target pixel block sub-image. It will be appreciated that in the set of L pixel block sub-images, L target pixel block sub-images may be determined.
In the embodiment of the present application, in order to make the color vividness of the finally generated filling color more balanced and ensure the color purity, after the pixel block sub-image at the center position is selected, saturation preprocessing may be performed on the pixel block sub-image to control the saturation of the color of the pixel block sub-image to be within a fixed preset saturation interval, so as to obtain the target pixel block sub-image.
Optionally, a preset saturation interval may be selected to be (10-50), and if the saturation of the color of the selected central position pixel block sub-image exceeds the preset saturation interval, that is, when the saturation of the color of the pixel block sub-image is less than an interval threshold value of 10, the saturation of the color of the pixel block sub-image is adjusted to be 10, so that the adjusted pixel block sub-image is used as a target pixel block sub-image; and when the saturation of the color of the pixel block sub-image is greater than the interval threshold value 50, adjusting the saturation of the color of the pixel block sub-image to 50, and taking the adjusted pixel block sub-image as a target pixel block sub-image.
Further, after obtaining each target pixel block sub-image, the brightness or saturation of each target pixel block sub-image may be adjusted based on each target pixel block sub-image, and each target pixel block sub-image is expanded into N colors.
Optionally, the brightness of each target pixel block sub-image may be increased by 10 or decreased by 10, and the colors of the target pixel block sub-images are expanded into 3 colors, so that L colors corresponding to L target pixel block sub-images may be obtained by the brightness adjustment, and the 3L colors are used as final filling colors, where N is 3L; similarly, the saturation of each target pixel block sub-image may be increased by 10 or decreased by 10, and the saturation of each target pixel block sub-image may be increased by 20 or decreased by 20, so that the color of the target pixel block sub-image is expanded to 5 colors, whereby L colors corresponding to L target pixel block sub-images may be obtained by the saturation adjustment to obtain 5L colors, and the 5L colors may be set as the final fill color, where N is 5L.
In the embodiment of the application, the colors of the pixel block sub-images are classified based on the RGB values of the pixel block sub-images and the RGB value intervals corresponding to the preset color categories to obtain the pixel block sub-image sets corresponding to the preset color categories, so as to determine a plurality of pixel block sub-image sets with a large color distribution range in the pixel block images, and further determine target pixel block sub-images which can represent the dominant hue and color distribution of the first image from the pixel block sub-image sets, so that a plurality of filling colors corresponding to the pixel block images are generated based on the target pixel block sub-images, and each filling color can still maintain the dominant hue and color distribution of the pixel block images.
Optionally, the dividing the pixel block image into K color block regions based on the first color parameter of each pixel block sub-image includes:
determining color block dividing lines in the pixel block image based on the first color parameters of the pixel block sub-images in the pixel block image;
and dividing the pixel block image into K color block areas according to the color block dividing lines.
Specifically, in the embodiment of the present application, in combination with the color distribution regionalization feature of the image display, each color distribution region in the pixel block image may be identified based on the first color parameter, i.e., hue or brightness, of each pixel block sub-image in the pixel block image, and each color block dividing line in the pixel block image may be determined, where the color block dividing line may be one or more.
The color block dividing lines described in the embodiments of the present application are generated based on the hue or brightness of each pixel block sub-image in the pixel block image, and the color block dividing lines are generated between the pixel block sub-images having continuous and significant changes in hue or brightness in the pixel block image.
Fig. 3 is a schematic diagram of dividing color block regions according to the embodiment of the present application, and as shown in fig. 3, a pixel block image is divided according to hue or brightness of each pixel block sub-image in the pixel block image to obtain 3 color block regions.
In the embodiment of the application, by determining color block dividing lines in a pixel block image, sub-image regions of the pixel block image with different obvious lightness or color difference are divided to obtain K color block regions.
Optionally, selecting a point at any vertex in the pixel block image as an origin, establishing an X-Y axis plane coordinate system, taking the pixel block sub-image with the origin as a starting point, identifying the hue or lightness of each pixel block sub-image one by one along the X-axis direction and then along the Y-axis direction from the origin to determine the pixel block sub-image area with the hue or lightness close to each other, when a continuously significant hue or brightness difference occurs in pixel block sub-image regions adjacent to this pixel block sub-image region, e.g., the neighboring pixel block sub-image regions belong to different pre-set color classes, the color block dividing line between the neighboring pixel block sub-image regions is determined, therefore, color block dividing lines between adjacent pixel block sub-image regions with obvious differences in the pixel block images are determined, and K color block regions are obtained through division finally, wherein the size of each color block region must exceed 2 pixel blocks.
Optionally, any pixel block sub-image at the center of the pixel block image is selected as a starting point, the pixel block sub-image is taken as a circle center, the hue or the lightness between the pixel block sub-images around the pixel block sub-image is subjected to diffusion type identification, a pixel block sub-image region with the hue or the lightness close to that of the pixel block sub-image region is determined, when continuous and obvious hue or lightness difference occurs between the pixel block sub-image regions adjacent to the pixel block sub-image region, color block dividing lines between the adjacent pixel block sub-image regions with the obvious difference are determined, and finally, K color block regions are obtained through division.
In the embodiment of the application, based on the color distribution regionalization characteristics of image display, each color distribution region in the pixel block image is identified by identifying the hue or the lightness of each pixel block sub-image in the pixel block image, the color block dividing line in the pixel block image is determined, and then the pixel block image is divided into a plurality of color block regions according to each color block dividing line so as to determine the main body color distribution condition in the first image, which is beneficial to maintaining the original tone style of the first image after the subsequent color block regions are subjected to color filling.
Optionally, the determining, based on the RGB mean values of the color block regions, the filling color of each color block region from the N filling colors corresponding to the pixel block image includes:
and determining the filling color corresponding to each color block area based on the difference value between the RGB mean value of each color block area and the RGB value of each filling color.
Specifically, in the embodiment of the present application, after the color block regions and the filling colors are divided from the pixel blocks, the filling colors corresponding to the color block regions need to be determined, so as to perform color refilling on the color block regions. In order to keep the main color tone of each color block region unchanged, the average value of the RGB values of all the pixels in each color block region may be calculated to obtain the RGB average value of each color block region.
Further, the difference between the RGB average value of each color patch area and the RGB value of each filling color may be calculated, and the filling color corresponding to the minimum difference is determined, that is, the filling color is closest to the main tone of the color patch area, so that the filling color is used as the color filling the color patch area. Thus, the filling color corresponding to each color patch area can be determined.
Optionally, when color filling is performed on each color block region, the filling color corresponding to the target pixel block sub-image in the filling colors close to the color of the color block region may be preferentially filled.
Optionally, when color filling is performed on the color block region, the preset color type to which each pixel block sub-image belongs in the color block region is identified first, and the preset color type is compared with all other color block regions belonging to the same preset color type according to the preset color type, if the color brightness of the color block region is lower, filling colors with similar and slightly dark colors are selected from each filling color, and if the color brightness of the color block region is higher, filling colors with similar and brighter colors are selected from each filling color for filling.
In the embodiment of the application, the filling color closest to the dominant hue of each color block region is determined from each filling color by calculating the difference between the RGB average value of each color block region and the RGB value of each filling color, so that the filling color corresponding to each color block region can be determined, and the original hue style of the first image is still maintained after the color block region is filled with the color.
Optionally, the obtaining a pixel block image corresponding to the first image based on the first image divided according to the preset size and the RGB values of the pixels in the first image includes:
determining M first sub-images based on the first image divided according to the preset size;
obtaining a pixel block sub-image corresponding to the first sub-image based on the RGB mean value of the first sub-image;
and obtaining a pixel block image corresponding to the first image based on the pixel block sub-image corresponding to each first sub-image.
Specifically, in the embodiment of the present application, after the first image is divided according to the preset size, M first sub-images may be obtained, where M is a positive integer, M represents the number of the first sub-images obtained after the first image is divided according to the preset size, and M may take a value of 20, 40, 50, or the like, which is specifically determined according to actual calculation requirements, and the present application is not specifically limited thereto.
Optionally, taking pixel points as a unit, if the image size of the first image is 300 × 500, that is, the length of the first image is 300 pixel points, and the width of the first image is 500 pixel points, a preset size of 15 × 25, that is, a preset size of 15 pixel points and a preset size of 25 pixel points may be selected, and the first image is divided to obtain 20 first sub-images; or the first image may be divided by selecting a preset size of 6 × 10, that is, a preset size of 6 pixels in length and 10 pixels in width, to obtain 50 first sub-images.
The RGB mean value of the first sub-image described in the embodiment of the present application is obtained by calculating the mean value of the RGB values of each pixel point in the first sub-image.
And adjusting all pixel points in the first sub-image to be the same average value through the RGB average value of the first sub-image, thereby obtaining a pixel block sub-image corresponding to the first sub-image.
Further, after the pixel block sub-images corresponding to the first sub-images are obtained, the pixel block images corresponding to the first images can be obtained.
In the embodiment of the application, a plurality of first sub-images are obtained through the first image divided according to the preset size, and each first sub-image is pixilated based on the calculation of the RGB mean value of the first sub-image, so that a pixel block image corresponding to the first image is obtained, and the generated pixel block image can still keep the dominant hue and color distribution of the first image.
Optionally, after the determining the filling color of each color block region from the N filling colors corresponding to the pixel block image to obtain a second image, the method further includes:
receiving a first input of a user;
displaying T subject color identifiers in response to the first input, wherein each subject color identifier corresponds to a subject color matching scheme generated based on filling colors of each color block region in the second image, and T is a positive integer;
receiving second input of a user to a target subject color identifier in the T subject color identifiers;
and responding to the second input, and adjusting the color attribute of the system control identification in the system interface according to the theme color matching scheme corresponding to the target theme color identification.
Specifically, the system control identifier described in the embodiment of the present application may specifically be an image identifier of a system component, a system module, a desktop component, an application program, a lock screen, and the like in an electronic device system, where the system component includes a component control of the electronic device system, such as check, single-check, frame check, progress bar, volume bar, cue point, button, index, text frame check, and the like; the system module comprises a control center, a notification center, a system setting interface, an alarm clock, a calculator, a compass, a recorder and other application programs; the system application program may specifically be an application program of the electronic device itself, or an application program installed by the electronic device by downloading from the outside.
The theme toning scheme described in the embodiment of the present application refers to a scheme for adjusting color parameters of a system control in a system interface, and may specifically be a toning scheme determined according to filling colors of each color block region in a second image. Optionally, the filling color of each color block area in the second image may have 5 colors of red, yellow, blue, green, and purple, and a plurality of 3 color combinations may be selected according to the 5 colors, such as a group combination of red, yellow, and blue, a group combination of yellow, blue, and green, and a group combination of yellow, blue, and purple, so that 3 theme color matching schemes may be determined, that is, a theme color matching scheme with red, yellow, and blue as theme colors, a theme color matching scheme with yellow, blue, and green as theme colors, and a theme color matching scheme with yellow, blue, and purple as theme colors.
The first input described in the embodiment of the present application refers to an operation for generating a theme toning scheme based on fill colors of each color block region in the second image, and the first input may be an input operated by a user on the second image, and specifically may be a single-click operation, a double-click operation, a long-press operation, or the like.
The subject color identifiers described in the embodiments of the present application refer to subject color image identifiers corresponding to subject color matching schemes, and each subject color identifier corresponds to one subject color matching scheme.
Optionally, the filling color of each color block area in the second image may have 6 colors of red, yellow, blue, green, purple, and white, and 4 combinations of 3 colors selected according to the 6 colors may be set, such as a group combination of red, yellow, and white, a group combination of yellow, green, and white, a group combination of blue, purple, and white, and a group combination of red, blue, and white, so that 4 theme color matching schemes may be determined, that is, a theme color matching scheme with red, yellow, and white as theme colors, a theme color matching scheme with yellow, green, and white as theme colors, a theme color matching scheme with blue, purple, and white as theme colors, and a theme color matching scheme with red, blue, and white as theme colors, and thus, according to the 4 theme color matching schemes, 4 theme color identifiers may be corresponded.
Further, after receiving a first input from a user, the electronic device displays T theme color identifiers in response to the first input, where T is a positive integer.
Fig. 4 is a schematic display diagram of the theme color identifier provided in the embodiment of the present application, and as shown in fig. 4, 6 theme color identifiers are displayed, which are respectively the first theme color identifier 41 and correspond to theme color matching schemes using red, orange and white as theme colors; a second theme color identifier 42 corresponding to a theme color matching scheme using orange, green and white as theme colors; a third theme color identifier 43 corresponding to a theme color matching scheme using blue, violet, and white as theme colors; a fourth theme color identifier 44 corresponding to a theme color matching scheme using red, blue, and white as theme colors; a fifth theme color identifier 45 corresponding to a theme color matching scheme using orange, blue, and white as theme colors; and a sixth theme color identifier 46 corresponding to a theme color scheme with blue, green and white as theme colors.
The color attributes described in the embodiments of the present application refer to the hue, saturation, and lightness of the system control identifying the display color.
The target theme color identifier described in the embodiment of the present application refers to a theme color identifier selected by a user from the respective theme color identifiers, and is used to adjust the color attribute of each system control identifier in the system interface based on a corresponding theme color matching scheme.
The second input described in the embodiment of the present application refers to an operation for selecting the target subject color identifier from the T subject color identifiers, and the second input may be an input of a user operating the target subject color identifier, which may specifically be a single-click operation, a double-click operation, a long-press operation, or the like.
Further, receiving a second input of the target subject color identifier in the T subject color identifiers by the user, for example, an operation of clicking to select or long-press the target subject color identifier by the user, in response to the second input, the electronic device adjusts the color attribute of each system control identifier in the system interface, such as the color attribute of the image identifier of the system component, the system module, the desktop component, the application program, or the lock screen, to the color attribute consistent with the subject color according to the subject color attribute in the subject color matching scheme corresponding to the target subject color identifier, so as to implement color re-matching on the color displayed by the image identifier of each system component, the system module, the desktop component, the application program, or the lock screen.
In this embodiment of the application, when a blue system theme color matching scheme and a green system theme color matching scheme are generated according to filling colors of each color block region in the second image, after a user clicks a green system theme color identifier corresponding to the green system theme color matching scheme, the green system color matching is applied to each system control identifier in the system interface, and for example, a progress bar image identifier, a volume bar image identifier, a control center image identifier, a progress bar image identifier, a display time image identifier, a button image identifier, and the like are all adjusted to green system color matching.
In the embodiment of the application, the color matching of the desktop application image identifier and the desktop component image identifier of the system is also changed according to the theme color matching scheme generated by the filling colors of each color block region in the second image, the system reads the color of the desktop application image identifier, performs intelligent color partitioning on the color of the image identifier, fills the theme color in the theme color matching scheme into the color partition, generates a newly color-matched desktop application image identifier, and replaces the old image identifier; the theme color mixing scheme of the desktop component image identifier can change the color of the character identifier in the desktop component and the color of the desktop component image identifier, the desktop component can calculate the difference between the self color and the desktop background color, and color matching different from the background color is selected, so that the situation that the color of the desktop component image identifier and the color of the desktop background are integrated and cannot be distinguished is avoided.
In this embodiment of the application, when the purple system theme color matching scheme and the yellow system theme color matching scheme are generated according to the filling colors of each color block region in the second image, after the user clicks the purple system theme color identifier corresponding to the purple system theme color matching scheme, the desktop application image identifier and the desktop component image identifier are adjusted to be purple system color matching.
In this embodiment of the application, according to the theme color matching scheme generated by the filling colors of each color block region in the second image, the color of the system lock screen image identifier may also be changed, so that each image identifier in the system lock screen interface is adjusted to the theme color corresponding to the theme color matching scheme.
In the embodiment of the application, when the theme color mixing scheme for the lock screen image identifier is the same as the theme color mixing scheme for the desktop image identifier, the color of the lock screen image identifier after color mixing is the same as the color of the desktop image identifier after color mixing; when the color matching scheme for the lock screen image identifier is different from the color matching scheme for the desktop image identifier, the color of the lock screen image identifier after color matching is different from the color of the desktop image identifier after color matching, and the system can select the colors of two theme color matching schemes corresponding to the lock screen image identifier and the desktop image identifier to perform color matching on the lock screen image identifier, for example, the yellow system theme color matching scheme corresponding to the lock screen image identifier and the blue system theme color matching scheme corresponding to the desktop image identifier are both applied to the interface of the lock screen, so that the lock screen image identifier in the interface has the image identifier of the yellow system color matching and also has the image identifier of the blue system color matching.
In the embodiment of the application, a plurality of theme color mixing schemes are generated based on the filling colors of each color block area in the second image, so that a user can select the theme color mixing schemes according to personal requirements, the user-defined setting and adjustment of the color of the system control identification in the electronic equipment are realized, the color of the system control identification can be changed along with different theme color mixing schemes, and the personalized requirements of the user are met.
In the embodiment of the present application, for a pure color image, for example, pure gray, pure white, pure black, pure green, and the like, a preset color block area division manner may be used to perform area division and color filling, the pure color image may be divided into 3, 4, or more color block areas, and then, with the pure color as a reference, a corresponding number of gradient colors are generated to fill each divided color block area, so as to generate a color block image.
Optionally, a preset color block area dividing mode can be performed on the pure gray image to divide 3 color block areas, and then 3 colors of different RGB values are filled in the 3 color block areas, so that the pure gray image does not present a monotonous pure color, but can present an extremely simple color block pattern.
It should be noted that, in the image processing method provided in the embodiment of the present application, the execution subject may be an image processing apparatus, or a control module in the image processing apparatus for executing the image processing method. The embodiment of the present application takes a method for executing image processing by an image processing apparatus as an example, and describes an apparatus for image processing provided in the embodiment of the present application.
Fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application, and as shown in fig. 5, the image processing apparatus includes:
a first dividing unit 510, configured to obtain a pixel block image corresponding to a first image based on the first image divided according to a preset size and an RGB value of each pixel point in the first image, where the pixel block image includes M pixel block sub-images, and M is a positive integer;
a second dividing unit 520, configured to divide the pixel block image into K color block regions based on a first color parameter of each pixel block sub-image, where the first color parameter includes hue and lightness, K is a positive integer, and K is not greater than M;
a color filling unit 530, configured to determine, based on the RGB mean values of the color block regions, filling colors of each color block region from N filling colors corresponding to the pixel block images, so as to obtain a second image, where the filling colors are used to fill the corresponding color block regions, the N filling colors corresponding to the pixel block images are determined based on preset color categories, the RGB values of the pixel block sub-images, and second color parameters, the second color parameters include lightness and saturation, and N is a positive integer.
Optionally, the apparatus further comprises:
a first determining unit, configured to determine a pixel block sub-image set corresponding to each preset color category based on an RGB value of each pixel block sub-image and an RGB value interval corresponding to each preset color category, where each pixel block sub-image set includes one or more pixel block sub-images;
a second determining unit, configured to determine L target pixel block sub-image sets in each pixel block sub-image set based on the number of pixel block sub-images in each pixel block sub-image set, where L is a positive integer;
a third determining unit, configured to determine a target pixel block sub-image in the target pixel block sub-image set based on a second color parameter of each pixel block sub-image in the target pixel block sub-image set;
and the generating unit is used for generating N filling colors corresponding to the pixel block images based on the target pixel block sub-images.
Optionally, the second dividing unit 520 is further specifically configured to:
determining color block dividing lines in the pixel block image based on the first color parameters of the pixel block sub-images in the pixel block image;
and dividing the pixel block image into K color block areas according to the color block dividing lines.
Optionally, the color filling unit 530 is further specifically configured to:
and determining the filling color corresponding to each color block area based on the difference value between the RGB mean value of each color block area and the RGB value of each filling color.
Optionally, the first dividing unit 510 is further specifically configured to:
determining M first sub-images based on the first image divided according to the preset size;
obtaining a pixel block sub-image corresponding to the first sub-image based on the RGB mean value of the first sub-image;
and obtaining a pixel block image corresponding to the first image based on the pixel block sub-image corresponding to each first sub-image.
Optionally, the apparatus further comprises:
a first input unit for receiving a first input of a user;
a first response unit, configured to display T theme color identifiers in response to the first input, where each theme color identifier corresponds to a theme color matching scheme generated based on filling colors of each color block region in the second image, where T is a positive integer;
the second input unit is used for receiving second input of a target subject color identifier in the T subject color identifiers by a user;
and the second response unit is used for responding to the second input and adjusting the color attribute of the system control identifier in the system interface according to the theme color matching scheme corresponding to the target theme color identifier.
In the embodiment of the application, the first image is divided into a plurality of pixel block sub-images based on the RGB values of all pixel points in the first image, a pixel block image corresponding to the first image is obtained, the pixel block image is divided into a plurality of color block regions based on the difference degree of lightness or hue between all pixel block sub-images in the pixel block image, a plurality of pixel block sub-image sets belonging to the same type of color are determined based on the RGB values and preset color types of all pixel block sub-images in the pixel block image, so that a few types of color types with large distribution range in the pixel block image are determined, filling colors for filling colors in all the color block regions are determined according to the lightness and saturation of all the pixel block sub-images corresponding to each type of color, and the main hue and the filling colors distributed in the first image can be represented by the few types of filling colors, and generating a second image, wherein the second image is formed by splicing a plurality of pure-color blocks, so that a very simplified style visual effect with simple and striking colors can be provided for a user, the user can set the personalized style of the image, and the personalized requirements of the user are met.
The image processing apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The image processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The image processing apparatus provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 6, and is not described herein again to avoid repetition.
Optionally, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 6, an embodiment of the present application further provides an electronic device 600, which includes a processor 601, a memory 602, and a program or an instruction stored in the memory 602 and capable of being executed on the processor 601, and when the program or the instruction is executed by the processor 601, the process of the embodiment of the image processing method is implemented, and the same technical effect can be achieved, and details are not repeated here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 710 is configured to obtain a pixel block image corresponding to a first image based on the first image divided according to a preset size and an RGB value of each pixel point in the first image, where the pixel block image includes M pixel block sub-images, and M is a positive integer;
the processor 710 is configured to divide the pixel block image into K color block regions based on a first color parameter of each pixel block sub-image, where the first color parameter includes hue and lightness, K is a positive integer, and K is not greater than M;
the processor 710 is configured to determine, based on the RGB mean values of the color block regions, fill colors of each color block region from N fill colors corresponding to the pixel block images, to obtain a second image, where the fill colors are used to fill the color block regions corresponding to the pixel block images, the N fill colors corresponding to the pixel block images are determined based on preset color categories, the RGB values of the pixel block sub-images, and second color parameters, the second color parameters include lightness and saturation, and N is a positive integer.
The processor 710 is configured to determine a pixel block sub-image set corresponding to each preset color category based on the RGB values of the pixel block sub-images and the RGB value intervals corresponding to the preset color categories, where each pixel block sub-image set includes one or more pixel block sub-images;
determining L target pixel block sub-image sets in each pixel block sub-image set based on the number of pixel block sub-images in each pixel block sub-image set, wherein L is a positive integer;
determining a target pixel block sub-image in the target pixel block sub-image set based on the second color parameter of each pixel block sub-image in the target pixel block sub-image set;
and generating N filling colors corresponding to the pixel block images based on the target pixel block subimages.
The processor 710 is configured to determine color block dividing lines in the pixel block image based on the first color parameters of the pixel block sub-images in the pixel block image;
and dividing the pixel block image into K color block areas according to the color block dividing lines.
The processor 710 is configured to determine a filling color corresponding to each of the color block regions based on a difference between the RGB mean value of each of the color block regions and the RGB value of each of the filling colors.
The processor 710 is configured to determine M first sub-images based on the first image divided according to the preset size;
obtaining a pixel block sub-image corresponding to the first sub-image based on the RGB mean value of the first sub-image;
and obtaining a pixel block image corresponding to the first image based on the pixel block sub-image corresponding to each first sub-image.
A user input unit 707 for receiving a first input by a user;
the display unit 706 is configured to display T subject color identifiers in response to the first input, where each subject color identifier corresponds to a subject color matching scheme generated based on filling colors of each color block region in the second image, where T is a positive integer;
the user input unit 707 is further configured to receive a second input of a target subject color identifier from the T subject color identifiers from the user;
the processor 710 is configured to adjust a color attribute of a system control identifier in the system interface according to the theme toning scheme corresponding to the target theme color identifier in response to the second input.
In the embodiment of the application, the first image is divided into a plurality of pixel block sub-images based on the RGB values of all pixel points in the first image, a pixel block image corresponding to the first image is obtained, the pixel block image is divided into a plurality of color block regions based on the difference degree of lightness or hue between all pixel block sub-images in the pixel block image, a plurality of pixel block sub-image sets belonging to the same type of color are determined based on the RGB values and preset color types of all pixel block sub-images in the pixel block image, so that a few types of color types with large distribution range in the pixel block image are determined, filling colors for filling colors in all the color block regions are determined according to the lightness and saturation of all the pixel block sub-images corresponding to each type of color, and the main hue and the filling colors distributed in the first image can be represented by the few types of filling colors, and generating a second image, wherein the second image is formed by splicing a plurality of pure-color blocks, so that a very simplified style visual effect with simple and striking colors can be provided for a user, the user can set the personalized style of the image, and the personalized requirements of the user are met.
It should be understood that in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics Processing Unit 7041 processes image data of still pictures or videos obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 709 may be used to store software programs as well as various data, including but not limited to applications and operating systems. Processor 710 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the embodiment of the image processing method, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. An image processing method, comprising:
obtaining a pixel block image corresponding to a first image based on the first image which is divided according to a preset size and RGB values of all pixel points in the first image, wherein the pixel block image comprises M pixel block sub-images, and M is a positive integer;
dividing the pixel block image into K color block regions based on first color parameters of the pixel block sub-images, wherein the first color parameters comprise hue and lightness, K is a positive integer and is less than or equal to M;
and determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB mean value of the color block region to obtain a second image, wherein the filling color is used for filling the color block region corresponding to the pixel block image, the N filling colors corresponding to the pixel block image are determined based on a preset color category, the RGB value of each pixel block sub-image and a second color parameter, the second color parameter comprises lightness and saturation, and N is a positive integer.
2. The image processing method according to claim 1, further comprising, before said determining fill colors of the respective color patch regions from among N fill colors corresponding to the pixel block image:
determining a pixel block sub-image set corresponding to each preset color class based on the RGB value of each pixel block sub-image and the RGB value interval corresponding to each preset color class, wherein each pixel block sub-image set comprises one or more pixel block sub-images;
determining L target pixel block sub-image sets in each pixel block sub-image set based on the number of pixel block sub-images in each pixel block sub-image set, wherein L is a positive integer;
determining a target pixel block sub-image in the target pixel block sub-image set based on the second color parameter of each pixel block sub-image in the target pixel block sub-image set;
and generating N filling colors corresponding to the pixel block images based on the target pixel block subimages.
3. The method according to claim 1, wherein said dividing the pixel block image into K patch regions based on the first color parameter of each of the pixel block sub-images comprises:
determining color block dividing lines in the pixel block image based on the first color parameters of the pixel block sub-images in the pixel block image;
and dividing the pixel block image into K color block areas according to the color block dividing lines.
4. The method according to claim 1, wherein the determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB mean values of the color block regions comprises:
and determining the filling color corresponding to each color block area based on the difference value between the RGB mean value of each color block area and the RGB value of each filling color.
5. The image processing method according to claim 1, wherein obtaining the pixel block image corresponding to the first image based on the first image divided according to the preset size and the RGB values of the pixels in the first image comprises:
determining M first sub-images based on the first image divided according to the preset size;
obtaining a pixel block sub-image corresponding to the first sub-image based on the RGB mean value of the first sub-image;
and obtaining a pixel block image corresponding to the first image based on the pixel block sub-image corresponding to each first sub-image.
6. The image processing method according to claim 1, wherein after determining the fill color of each of the patch regions from the N fill colors corresponding to the pixel block image to obtain a second image, the method further comprises:
receiving a first input of a user;
displaying T subject color identifiers in response to the first input, wherein each subject color identifier corresponds to a subject color matching scheme generated based on filling colors of each color block region in the second image, and T is a positive integer;
receiving second input of a user to a target subject color identifier in the T subject color identifiers;
and responding to the second input, and adjusting the color attribute of the system control identification in the system interface according to the theme color matching scheme corresponding to the target theme color identification.
7. An image processing apparatus characterized by comprising:
the image processing device comprises a first dividing unit, a second dividing unit and a processing unit, wherein the first dividing unit is used for obtaining a pixel block image corresponding to a first image based on the first image which is divided according to a preset size and RGB values of all pixel points in the first image, the pixel block image comprises M pixel block sub-images, and M is a positive integer;
the second dividing unit is used for dividing the pixel block image into K color block areas based on the first color parameters of the pixel block sub-images, wherein the first color parameters comprise hue and lightness, K is a positive integer and is not more than M;
and the color filling unit is used for determining the filling color of each color block region from the N filling colors corresponding to the pixel block image based on the RGB average value of the color block region to obtain a second image, wherein the filling color is used for filling the corresponding color block region, the N filling colors corresponding to the pixel block image are determined based on a preset color category, the RGB value of each pixel block sub-image and a second color parameter, the second color parameter comprises lightness and saturation, and N is a positive integer.
8. The image processing apparatus according to claim 7, characterized in that the apparatus further comprises:
a first determining unit, configured to determine a pixel block sub-image set corresponding to each preset color category based on an RGB value of each pixel block sub-image and an RGB value interval corresponding to each preset color category, where each pixel block sub-image set includes one or more pixel block sub-images;
a second determining unit, configured to determine L target pixel block sub-image sets in each pixel block sub-image set based on the number of pixel block sub-images in each pixel block sub-image set, where L is a positive integer;
a third determining unit, configured to determine a target pixel block sub-image in the target pixel block sub-image set based on a second color parameter of each pixel block sub-image in the target pixel block sub-image set;
and the generating unit is used for generating N filling colors corresponding to the pixel block images based on the target pixel block sub-images.
9. The image processing apparatus according to claim 7, wherein the second dividing unit is further configured to:
determining color block dividing lines in the pixel block image based on the first color parameters of the pixel block sub-images in the pixel block image;
and dividing the pixel block image into K color block areas according to the color block dividing lines.
10. The image processing apparatus according to claim 7, wherein the color-filling unit is further configured to:
and determining the filling color corresponding to each color block area based on the difference value between the RGB mean value of each color block area and the RGB value of each filling color.
11. An electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 6.
12. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps of the image processing method according to any one of claims 1 to 6.
CN202111123949.7A 2021-09-24 2021-09-24 Image processing method, image processing device, electronic equipment and storage medium Pending CN113808120A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111123949.7A CN113808120A (en) 2021-09-24 2021-09-24 Image processing method, image processing device, electronic equipment and storage medium
PCT/CN2022/119581 WO2023045857A1 (en) 2021-09-24 2022-09-19 Image processing method and apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111123949.7A CN113808120A (en) 2021-09-24 2021-09-24 Image processing method, image processing device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113808120A true CN113808120A (en) 2021-12-17

Family

ID=78896581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111123949.7A Pending CN113808120A (en) 2021-09-24 2021-09-24 Image processing method, image processing device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113808120A (en)
WO (1) WO2023045857A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115408552A (en) * 2022-07-28 2022-11-29 深圳市磐鼎科技有限公司 Display adjustment method, device, equipment and storage medium
WO2023045857A1 (en) * 2021-09-24 2023-03-30 维沃移动通信有限公司 Image processing method and apparatus, electronic device and storage medium
CN117596489A (en) * 2024-01-18 2024-02-23 荣耀终端有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116703916B (en) * 2023-08-07 2023-10-20 山东正基药业有限公司 Washing water quality monitoring method based on image processing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011142471A (en) * 2010-01-06 2011-07-21 Canon Inc Image processing apparatus, control method, and program
JP2013031000A (en) * 2011-07-28 2013-02-07 Kyocera Document Solutions Inc Image processing program and image processing method
CN103106670A (en) * 2013-01-16 2013-05-15 西安理工大学 Automatic establishing and converting method for color models of computer input device
US20170200289A1 (en) * 2012-02-07 2017-07-13 Zencolor Corporation Normalization of color from a captured image into a universal digital color system for specification and matching
CN109358926A (en) * 2018-09-20 2019-02-19 珠海市君天电子科技有限公司 A kind of color setting method, device and electronic equipment
CN109783178A (en) * 2019-01-24 2019-05-21 北京字节跳动网络技术有限公司 A kind of color adjustment method of interface assembly, device, equipment and medium
CN111062993A (en) * 2019-12-12 2020-04-24 广东智媒云图科技股份有限公司 Color-merged drawing image processing method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395030A (en) * 2019-08-16 2021-02-23 腾讯科技(深圳)有限公司 Page processing method and device, electronic device and storage medium
CN113808120A (en) * 2021-09-24 2021-12-17 维沃移动通信有限公司 Image processing method, image processing device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011142471A (en) * 2010-01-06 2011-07-21 Canon Inc Image processing apparatus, control method, and program
JP2013031000A (en) * 2011-07-28 2013-02-07 Kyocera Document Solutions Inc Image processing program and image processing method
US20170200289A1 (en) * 2012-02-07 2017-07-13 Zencolor Corporation Normalization of color from a captured image into a universal digital color system for specification and matching
CN103106670A (en) * 2013-01-16 2013-05-15 西安理工大学 Automatic establishing and converting method for color models of computer input device
CN109358926A (en) * 2018-09-20 2019-02-19 珠海市君天电子科技有限公司 A kind of color setting method, device and electronic equipment
CN109783178A (en) * 2019-01-24 2019-05-21 北京字节跳动网络技术有限公司 A kind of color adjustment method of interface assembly, device, equipment and medium
CN111062993A (en) * 2019-12-12 2020-04-24 广东智媒云图科技股份有限公司 Color-merged drawing image processing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045857A1 (en) * 2021-09-24 2023-03-30 维沃移动通信有限公司 Image processing method and apparatus, electronic device and storage medium
CN115408552A (en) * 2022-07-28 2022-11-29 深圳市磐鼎科技有限公司 Display adjustment method, device, equipment and storage medium
CN117596489A (en) * 2024-01-18 2024-02-23 荣耀终端有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
WO2023045857A1 (en) 2023-03-30

Similar Documents

Publication Publication Date Title
CN113808120A (en) Image processing method, image processing device, electronic equipment and storage medium
CN103164231A (en) Input method virtual keyboard skin management method and device
CN113126862B (en) Screen capture method and device, electronic equipment and readable storage medium
CN109859283A (en) One kind taking color method, takes color device, electronic equipment and can storage medium
CN113282212A (en) Interface display method, interface display device and electronic equipment
WO2023066294A1 (en) Icon display method and apparatus, and electronic device
CN107203312B (en) Mobile terminal and picture rendering method and storage device thereof
CN113157357A (en) Page display method, device, terminal and storage medium
CN112037160A (en) Image processing method, device and equipment
CN112702531B (en) Shooting method and device and electronic equipment
CN111901519B (en) Screen light supplement method and device and electronic equipment
CN112419218A (en) Image processing method and device and electronic equipment
CN113018856A (en) Image processing method, image processing device, electronic equipment and storage medium
CN113645476A (en) Picture processing method and device, electronic equipment and storage medium
CN112541955A (en) Image processing method, device and equipment
CN111562955B (en) Method and device for configuring theme colors of terminal equipment and terminal equipment
CN114138215A (en) Display method and related equipment
CN111857507A (en) Desktop image processing method and device and electronic equipment
CN112053416A (en) Image processing method, image processing device, storage medium and computer equipment
CN111835937A (en) Image processing method and device and electronic equipment
CN113393391B (en) Image enhancement method, image enhancement device, electronic apparatus, and storage medium
CN113487497A (en) Image processing method and device and electronic equipment
CN113747076A (en) Shooting method and device and electronic equipment
CN112148409A (en) Window image effect realization method and device and storage medium
CN112511890A (en) Video image processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination