CN113222851A - Image color gradation simplifying method and device, equipment and storage medium - Google Patents

Image color gradation simplifying method and device, equipment and storage medium Download PDF

Info

Publication number
CN113222851A
CN113222851A CN202110572391.4A CN202110572391A CN113222851A CN 113222851 A CN113222851 A CN 113222851A CN 202110572391 A CN202110572391 A CN 202110572391A CN 113222851 A CN113222851 A CN 113222851A
Authority
CN
China
Prior art keywords
color
color level
target
adjacent
level
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
CN202110572391.4A
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.)
Guangzhou Classic Fashion Industry Co ltd
ZHUHAI JIANXUAN GARMENT CO Ltd
Original Assignee
Guangzhou Classic Fashion Industry Co ltd
ZHUHAI JIANXUAN GARMENT 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 Guangzhou Classic Fashion Industry Co ltd, ZHUHAI JIANXUAN GARMENT CO Ltd filed Critical Guangzhou Classic Fashion Industry Co ltd
Priority to CN202110572391.4A priority Critical patent/CN113222851A/en
Publication of CN113222851A publication Critical patent/CN113222851A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for simplifying image color gradation, wherein the method comprises the following steps: determining at least two target color levels from the color level number sequence of the original image data; wherein, the color gradation number sequence comprises all color gradations arranged according to sizes; mixing every two adjacent target color levels into a target pseudo color level unit; and filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image, wherein the brightness color level gradation effect can be kept, and the color level of the simplified image is softer.

Description

Image color gradation simplifying method and device, equipment and storage medium
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to an image color gradation simplifying method, an image color gradation simplifying device, image color gradation simplifying equipment and an image color gradation simplifying storage medium.
Background
As is well known, in an image with a fixed resolution, the larger the number of color gradations, the better the color fullness and fineness of the image, and the softer the light-dark relationship, the more gradation, or vice versa. It is conventionally understood that the greater the number of color levels of an image should be, the more advantageous, but in practice, the different requirements for the color levels of the image are in product applications in various industries. Due to the limitation of various factors (such as cost, hardware technology and effect quality), rich image effects cannot be effectively expressed in products in some industry fields, and the products can only be used after images are simplified and a plurality of target color levels are left.
For example, in the knitting industry, one target color level corresponds to one group of color yarns, and the image has fewer target color levels, which means that less color yarns can be used for knitting, so that the cost is lower and the knitting efficiency is higher. In consideration of cost and quality, in the process of carrying out computerized flat knitting jacquard on multi-gradation images, the gradation simplification of the original images is needed, and the target gradation number is generally controlled to be between 2 and 6.
The conventional color gradation simplification method is realized by directly simplifying the color gradation of an original image through the processing of computer flat knitting machine plate-making software, combining a secondary color gradation and an adjacent main target color gradation according to fixed program operation and simplifying to obtain a corresponding target color gradation. The color between adjacent target color levels of the image obtained by the method is excessively hard, and the gradation effect of the brightness color level is seriously lost, so that the image expression effect is distorted, and the impression is greatly influenced.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for simplifying image color levels, which can keep the gradation effect of brightness color levels and make the simplified image color levels more soft.
The first aspect of the embodiments of the present invention discloses a method for simplifying image color levels, including:
determining at least two target color levels from the color level number sequence of the original image data; wherein the color gradation number sequence comprises all color gradations arranged according to sizes;
mixing every two adjacent target color levels into a target pseudo color level unit;
and filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image.
In one embodiment, the mixing of every two adjacent target color levels into the target pseudo color level unit includes:
mixing every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of corresponding mixing proportions to obtain X target pseudo color level units of adjacent color level groups formed by every two adjacent target color levels; wherein, X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and the X target pseudo-gradation units correspond to the X mixing ratios one by one;
and, the filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image, including:
covering X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain a simplified color level image.
In one embodiment, after determining at least two target color levels from the color level sequence of the original image data and before overlaying the X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain the simplified color level image, the method further includes:
determining X auxiliary color levels in an adjacent color level group formed by every two adjacent target color levels;
dividing the color level number sequence according to N target color levels and (N-1) X auxiliary color levels to obtain N + (N-1) X color level sub-number sequences, wherein each color level sub-number sequence corresponds to one target color level or auxiliary color level; wherein N is a positive integer greater than 1;
selecting at least one pixel corresponding to each color level sub-sequence from the original image data;
covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data;
and covering the X target pseudo tone scale units of each adjacent tone scale group into each corresponding adjacent tone scale group in the original image data to obtain a simplified tone scale image, including:
and filling and covering X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data one by one to obtain a simplified color level image.
In one embodiment, the step of filling and covering X target pseudo gamut units of each adjacent gamut group to corresponding X auxiliary gamut units in the first image data one by one to obtain a simplified gamut image includes:
carrying out one-to-one matching on X target pseudo color level units and X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and according to the matching relation, filling and covering X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data respectively to obtain a simplified color level image.
A second aspect of the embodiments of the present invention discloses an image tone scale simplification apparatus, including:
a determining unit configured to determine at least two target color levels from a color level number sequence of original image data; wherein the color gradation number sequence comprises all color gradations arranged according to sizes;
the mixing unit is used for mixing every two adjacent target color levels into a target pseudo color level unit;
and the covering unit is used for filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image.
In one embodiment, the mixing unit is specifically configured to mix every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of mixing ratios corresponding to the pseudo color level unit, so as to obtain X target pseudo color level units of an adjacent color level group formed by every two adjacent target color levels; wherein, X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and the X target pseudo-gradation units correspond to the X mixing ratios one by one;
the covering unit is specifically configured to cover X target pseudo gamut units of each adjacent gamut group into each corresponding adjacent gamut group in the original image data, so as to obtain a simplified gamut image.
In one embodiment, the image tone scale reduction apparatus further includes:
the dividing unit is used for determining X auxiliary color levels in an adjacent color level group formed by every two adjacent target color levels after the determining unit determines at least two target color levels from a color level number sequence of original image data and before the covering unit covers X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain a simplified color level image, and dividing the color level number sequence according to the N target color levels and the (N-1) X auxiliary color levels to obtain N + (N-1) X color level sub-number sequences, wherein each color level sub-number sequence corresponds to one target color level or one auxiliary color level; wherein N is a positive integer greater than 1;
the selecting unit is used for selecting at least one pixel corresponding to each color level sub-sequence from the original image data;
the merging unit is used for covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data;
and the covering unit is specifically configured to fill and cover the X target pseudo gamut units of each adjacent gamut group to the corresponding X auxiliary gamut units in the first image data one by one, respectively, so as to obtain a simplified gamut image.
In one embodiment, the covering unit includes:
the matching module is used for carrying out one-to-one matching on the X target pseudo color level units and the X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and the covering module is used for respectively filling and covering the X target pseudo color level units of each adjacent color level group to the corresponding X auxiliary color levels in the first image data according to the matching relation to obtain a simplified color level image.
A third aspect of an embodiment of the present invention discloses an electronic device, including a memory storing executable program codes and a processor coupled to the memory; the processor calls the executable program code stored in the memory for performing the image tone scale reduction method disclosed in the first aspect.
A fourth aspect of the present embodiments discloses a computer-readable storage medium storing a computer program, where the computer program causes a computer to execute the image tone scale simplification method disclosed in the first aspect.
The invention provides a method, a device, equipment and a storage medium for simplifying image color gradation, wherein the method comprises the following steps: determining at least two target color levels from the color level number sequence of the original image data; wherein, the color gradation number sequence comprises all color gradations arranged according to sizes; mixing every two adjacent target color levels into a target pseudo color level unit; filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image; therefore, the color levels of the simplified color level image can be visually increased by mixing every two adjacent target color levels into a pseudo color level unit and filling and covering the pseudo color level unit into a brightness interval range formed by every two adjacent target color levels, only N real color levels are actually reserved, the hierarchical effect of the brightness color levels can be reserved, and the color levels of the simplified image are excessively softer.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles and effects of the invention.
Unless otherwise specified or defined, the same reference numerals in different figures refer to the same or similar features, and different reference numerals may be used for the same or similar features.
FIG. 1 is a flow chart of a method for simplifying image color gradation according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for image level reduction according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of an original image disclosed by an embodiment of the present invention;
FIG. 4 is a series of target and auxiliary levels disclosed in an embodiment of the present invention;
fig. 5 is an exemplary diagram of a first image disclosed by an embodiment of the invention.
Fig. 6 is a schematic structural diagram of a pseudo gamut unit according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of overlaying a target pseudo gamut unit to an auxiliary gamut according to an embodiment of the disclosure.
Fig. 8 is a simplified tone scale image obtained under the image tone scale simplification method disclosed in the embodiment of the present invention.
Fig. 9 is a simplified tone scale image obtained under a conventional tone scale simplification method disclosed in an embodiment of the present invention.
Fig. 10 is a schematic structural diagram of an image tone scale simplification apparatus according to an embodiment of the present invention.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Description of reference numerals:
1001. a determination unit; 1002. a mixing unit; 1003. a covering unit; 1101. a memory; 1102. a processor.
Detailed Description
In order to facilitate an understanding of the invention, specific embodiments thereof will be described in more detail below with reference to the accompanying drawings.
Unless specifically stated or otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. In the case of combining the technical solutions of the present invention in a realistic scenario, all technical and scientific terms used herein may also have meanings corresponding to the purpose of achieving the technical solutions of the present invention. As used herein, "first and second …" are used merely for name differentiation and do not denote any particular quantity or order. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly secured to the other element or intervening elements may also be present; when an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present; when an element is referred to as being "mounted on" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "on" another element, it can be directly on the other element or intervening elements may also be present.
As used herein, unless otherwise specified or defined, the terms "comprises," "comprising," and "comprising" are used interchangeably to refer to the term "comprising," and are used interchangeably herein.
It is needless to say that technical contents or technical features which are contrary to the object of the present invention or clearly contradicted by the object of the present invention should be excluded.
As shown in fig. 1, an embodiment of the present invention discloses an image tone scale simplification method, including:
101. at least two target color levels are determined from the color level sequence of the original image data.
The original image data may be used to refer to an original image, which includes various image data of the original image, such as the number of color levels, the position of each pixel, the hue and the color level, and the like. Wherein the color gradation number sequence includes all color gradations arranged by size. The number of target color levels can be N, N positive integers greater than 1, and the specific value can be set by a developer according to actual needs. If the method is applied to the current knitting industry, the number of target color levels can be controlled between 2 and 6, namely N is more than or equal to 2 and less than or equal to 6. In other industries, the number of target color levels may vary, and is not specifically limited herein.
In step 101, a target color level can be determined from all color levels of the color level number sequence according to the number N of the target color levels, and every two adjacent target color levels form an adjacent color level group, that is, there are N-1 adjacent color level groups, so that the lightness differences between the head and the tail of each adjacent color level group are as close as possible to be equal.
It will be appreciated that the original image is a multi-tone image, and since the luminance tone scale ranges from 0 to 255, the original image has a maximum of 256 tone scales, at least N +1 tone scales. The color mode of the original image is a gray mode with a size of 450pix × 750pix, where pix is a unit of one pixel.
102. And mixing every two adjacent target color levels into a target pseudo color level unit.
The target color levels may be mixed by random mixing or permutation and combination, and the number of the target pseudo color level units may be one or more. Because brightness difference exists between every two adjacent target color levels, the target pseudo color level unit formed by mixing the two adjacent target color levels can generate brightness difference with the two target color levels respectively, and thus a transition effect is achieved.
103. And filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image.
By mixing every two adjacent target color levels into a pseudo color level unit and filling and covering the pseudo color level unit into an adjacent color level group (namely a brightness interval range) formed by every two adjacent target color levels, the color level of the simplified color level image is visually increased, only N real color levels are actually reserved, the brightness color level hierarchy effect can be reserved, and the color level of the simplified image is excessively softer.
Optionally, step 102 may comprise: and mixing every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of corresponding mixing proportions to obtain X target pseudo color level units of adjacent color level groups formed by every two adjacent target color levels. Wherein X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and the X target pseudo-gradation units correspond to the X mixing ratios one by one. Accordingly, step 103 may comprise: covering X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain a simplified color level image.
Optionally, X auxiliary color levels may be determined in an adjacent color level group formed by every two adjacent target color levels, and then X target pseudo color level units of each adjacent color level group are covered to X corresponding auxiliary color levels of each adjacent color level group in the original image data, so as to obtain a simplified color level image.
Therefore, target pseudo-color level units with different light and shade areas can be mixed based on different mixing proportions, and the target pseudo-color level units with different light and shade degrees are covered in corresponding brightness interval ranges in original image data, so that the color levels of simplified color level images can be visually increased, and more light and shade levels can be achieved. Finally, N target color levels and (N-1). X false color level effects are generated, the false color levels are formed by mixing every two adjacent target color levels, actually, the simplified color level image only has N real color levels, the simplified color level image feels finer visually, the brightness color level levels of more images are presented to a certain extent, the display effect of the image is richer under the condition of the simple color levels, and the color level effect is better when the image is watched at a long distance.
By implementing the embodiment of the invention, the multi-color-level original image data is better converted into the simple color-level image, the balance between the cost and the quality is considered, and the method and the device are better applied to pattern products in various industries.
As shown in fig. 2, another image tone scale simplification method disclosed in the embodiment of the present invention includes:
201. n target color levels are determined from the color level sequence of the original image data.
In this embodiment, an original image is obtained by taking an application of knitting jacquard by using a computerized flat knitting machine in the knitting industry as an example, as shown in fig. 3, a color mode of the original image is a gray mode, and a size of the original image is 450pix × 750 pix. Assuming that the original image has 256 levels, the number of levels is {0, … …, 127, … …, 255}, 3 target levels are determined, and two end points and a middle point, namely 0, 127, 255, are taken to generate 2 adjacent level groups, namely "0 + 127" and "127 + 255", respectively.
202. X auxiliary levels are determined within each set of adjacent levels formed by two adjacent target levels.
In the embodiment of the present invention, all the color levels in the color level number sequence are arranged according to the size order (e.g., from large to small or from small to large), so that part of the color levels included in each adjacent color level group are also arranged according to the size order, and X auxiliary color levels can be determined in each adjacent color level group according to an approximately halving method, so as to represent that the luminance level between each two adjacent target color levels is excessive.
The number of the auxiliary color levels is at least one, that is, X is a positive integer greater than or equal to 1, and the specific value thereof may be determined according to the number of elements in the adjacent color level group, and if there are more color levels in the adjacent color level group, a number of auxiliary color levels may be selected accordingly, which is not limited specifically herein.
Alternatively, 1-3 are generally selected. In this example, it is preferable to take X to 3, and as shown in fig. 4, the auxiliary gradations 31, 63, and 95 are determined in the adjacent gradation set "0 + 127", and the auxiliary gradations 159, 191, and 223 are determined in the adjacent gradation set "127 + 255".
203. Dividing the color level sequence according to N target color levels and (N-1) X auxiliary color levels to obtain N + (N-1) X color level sub-sequence, wherein each color level sub-sequence corresponds to one target color level or auxiliary color level.
In step 203, the remaining secondary levels except the N target levels and (N-1) · X auxiliary levels in the color level number series are merged into the adjacent target levels or auxiliary levels, and an approximately halving dividing method is adopted to keep the lightness differences between the first and last two bits in each color level sub-number series as close as possible.
For example, in this example, based on the target levels 0, 127, 255 and the auxiliary levels 31, 63, 95, 159, 191, 223, the levels in the range of levels 0-15 are divided into a first level sub-number sequence corresponding to the target level 0, the levels in the range of levels 16-47 are divided into a second level sub-number sequence corresponding to the auxiliary level 31, the levels in the range of levels 48-79 are divided into a third level sub-number sequence corresponding to the auxiliary level 63, and so on, N + (N-1) · X level sub-number sequences are formed, each level sub-number sequence including one target level or auxiliary level, and other secondary levels.
204. At least one pixel corresponding to each color gradation sub-sequence is selected from the original image data.
It should be noted that the original image includes a plurality of pixels, and the tone levels of some of the pixels may be the same. That is, each color level in the color level sequence may correspond to one or more pixels in the original image data, and each pixel corresponds to one color level. Therefore, the pixels corresponding to each color level in each color level sub-number sequence can be found based on the original corresponding relationship, so as to obtain at least one pixel corresponding to each color level sub-number sequence.
205. And covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data.
When the color level of at least one pixel corresponding to each color level sub-number sequence is covered into the corresponding target color level or auxiliary color level, the target color level or auxiliary color level is unchanged, and the other auxiliary color levels are covered into the corresponding target color level or auxiliary color level, and first image data is obtained, so that a first image with simplified preliminary color levels is obtained, and the first image has N + (N-1) · X color levels.
For example, the first image with the preliminary simplified gradation is obtained by covering the gradation of the pixels corresponding to the gradations 0 to 15 in the first gradation sub-number sequence with 0, the gradation of the pixels corresponding to the gradations 16 to 47 in the second gradation sub-number sequence with 31, and so on, as shown in fig. 5.
By implementing steps 202 to 205, the color level sequence may be divided, and other secondary color levels except for the N target color levels and the (N-1) · X auxiliary color levels in the color level sequence may be merged into the target color level or the auxiliary color level adjacent to the target color level, and then the target pseudo color level unit may be covered onto the merged auxiliary color level, so that the transition between every two adjacent target color levels may be more uniform and more natural, thereby further enhancing the brightness color level gradation effect.
206. And mixing every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of corresponding mixing proportions to obtain X target pseudo color level units of each adjacent color level group.
It should be noted that, the steps 202, 205 and 206 are not sequential, and in an embodiment, the step 201 may be executed, and the steps 202, 205 and 206 are executed at the same time, or the step 202, 205 may be executed first, and the step 206 is executed; alternatively, step 206 is performed first, and then step 202 and step 205 are performed.
In the embodiment of the invention, the brightness difference exists between every two adjacent target color levels, and the target color levels can be respectively determined as a bright color level and a dark color level. Optionally, the database may store a plurality of pseudo tone scale unit sizes, each corresponding to a plurality of different blending ratios.
In step 206, the size of the pseudo color gamut unit corresponding to Y mixing ratios may be determined from the database according to the size of X, where Y (Y is greater than or equal to X), then any X mixing ratios are determined from the Y mixing ratios of the pseudo color gamut unit size, the light color gamut and the dark color gamut are mixed (for example, permutation, combination or random mixing) to form a plurality of pseudo color gamut units corresponding to each mixing ratio, and finally a target pseudo color gamut unit is determined from the plurality of pseudo color gamut units corresponding to each mixing ratio to obtain X target pseudo color gamut units of each adjacent color gamut group.
Or the size of the pseudo-gradation unit may be a parameter preset by the user, and further, the number X of the auxiliary gradations in step 202 may be determined according to the specified size of the pseudo-gradation unit, for example, if the specified size of the pseudo-gradation unit corresponds to Z mixing ratios, then X ≦ Z is taken for X.
The X target pseudo-color gradation units correspond to the X mixing proportions one by one, so that each target pseudo-color gradation unit has light and dark areas with different brightness, a stronger brightness difference is generated visually, and the light and dark gradation effect presented by each different mixing proportion can be fully utilized.
The size of the pseudo-color level unit includes at least two pixels, such as 1pix × 2pix, 2pix × 2pix, or 2pix × 3pix, and the specific size may be obtained from a database, or may be preset by a developer according to actual requirements, and is not limited herein. Preferably, the size of the pseudo-color gradation unit is 2pix × 2pix, so that the effect of the detail gradation of the image can be better expressed.
Alternatively, if 1 ≦ X ≦ 3, the step 206 may include:
determining each two adjacent target color levels as a bright color level and a dark color level respectively;
mixing the light color gradation and the dark color gradation according to the size of the false color gradation unit of 2X 2 pixels and any X kinds of corresponding mixing proportions to obtain X target false color gradation units of each adjacent color gradation group;
wherein, if X is more than or equal to 1 and less than or equal to 3, the size of the false color gradation unit of 2pix X2 pix can be selected, and three mixing ratios are correspondingly provided, namely 1 to 3, 2 to 2 and 3 to 1. Or if the size of the false color gradation unit of 2pix X2 pix is set, X is more than or equal to 1 and less than or equal to 3.
Further alternatively, X mixing ratios may be selected from the three mixing ratios according to the size of X for mixing the light and dark steps.
Specifically, optionally, if X is 1, determining a mixing ratio of 2 to 2 from three mixing ratios of 1 to 3, 2 to 2, and 3 to 1, and mixing the light and dark color levels to obtain 1 target pseudo color level unit of each adjacent color level group;
if X is 2, determining two mixing ratios of 1:3 and 3:1 from three mixing ratios of 1:3, 2:2 and 3:1, and mixing the light color levels and the dark color levels to obtain 2 target pseudo color level units of each adjacent color level group;
if X is 3, three mixing ratios of 1:3, 2:2 and 3:1 are determined, and the light color levels and the dark color levels are mixed to obtain 3 target pseudo color level units of each adjacent color level group.
In this example, a pseudo-scale unit size of 2pix by 2pix is preferably used, so taking X to 3 just corresponds to the three blend ratios. Firstly, determining 0 as a bright level and 127 as a dark level for target levels 0 and 127 forming an adjacent level group '0 + 127'; determining 127 as a bright level and 255 as a dark level for target levels 127 and 255 forming an adjacent level group '127 + 255'; then, arranging and combining 0 and 127 according to three mixing ratios of 1:3, 2:2 and 3:1 to obtain a plurality of pseudo-gradation units corresponding to the three mixing ratios, as shown in fig. 6, fig. 6 only exemplarily shows a part of pseudo-gradation units corresponding to each mixing ratio, and then determining any one of the plurality of pseudo-gradation units corresponding to each mixing ratio as a target pseudo-gradation unit to obtain 3 target pseudo-gradation units corresponding to adjacent gradation groups of "0 + 127" as Aa, Ab and Ac respectively; similarly, the 3 target pseudo-gradation units corresponding to the adjacent gradation sets "127 + 255" are Ba, Bb, Bc, respectively.
207. And filling and covering the X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data one by one to obtain a simplified color level image.
Because every two target color levels forming the adjacent color level groups are mixed by adopting different mixing ratios, the brightness degrees of the X target pseudo color level units of each adjacent color level group are different, and the larger the color level value of the pixel is, the brighter the pixel is. In order to obtain better brightness transition effect, the target pseudo-gradation unit with higher brightness degree can be filled and covered to the auxiliary gradation with larger gradation value.
Specifically, step 207 may include:
carrying out one-to-one matching on X target pseudo color level units and X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and according to the matching relation, filling and covering X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data respectively to obtain a simplified color level image.
As shown in fig. 7, the target pseudo gradation units Aa, Ab, Ac, Ba, Bb, Bc of the present example are finally filled and overlaid on the corresponding auxiliary gradations 31, 63, 95, 159, 191, 223 in the first image data one by one, so as to obtain simplified gradation image data, and further obtain a simplified gradation image, as shown in fig. 8, which only includes three target gradations 0, 127, 255.
In the embodiment of the invention, the simplified color level image can be imported into the computerized flat knitting machine platemaking system, and knitting data is input, and the computerized flat knitting machine platemaking system can select corresponding color yarns (such as black, gray and white) to knit a finished product according to the knitting data and the target color level (such as 0, 127 and 255) of the simplified color level image.
For comparison, in this example, the original image shown in fig. 3 is directly imported into the computerized flat knitting machine platemaking system, and the original image is subjected to color level simplification by the computerized flat knitting machine platemaking system according to a conventional color level simplification method, and a target color level N is set to 3, so that a simplified color level image is obtained as shown in fig. 9.
By contrast, the simplified color gradation image (as shown in fig. 9) simplified by the conventional method has serious jagging and serious distortion of image expression, and the simplified color gradation image (as shown in fig. 8) simplified by the embodiment of the present invention greatly retains the brightness and color gradation effect of the original image shown in fig. 3, and greatly improves the problems of serious jagging and serious distortion of image expression.
Therefore, by implementing the embodiment of the invention, each two adjacent target color levels are mixed into the pseudo color level unit and filled and covered in the range of the brightness interval formed by each two adjacent target color levels, the color levels of the simplified color level image are visually increased, and only N real color levels are actually reserved, so that the gradation effect of the brightness color level can be reserved, and the color levels of the simplified image are excessively softer. When the glasses are watched for a long distance, the effect of the gradation of the color levels is better. The multi-color-level original image is better converted into the simple color-level image, the balance between cost and quality is considered, and the method is better applied to pattern products in various industries.
In addition, the color level number sequence can be divided, other secondary color levels except for the target color level and the auxiliary color level in the color level number sequence are combined into the target color level or the auxiliary color level adjacent to the target color level or the auxiliary color level, and then the target pseudo color level unit is covered on the combined auxiliary color level, so that the transition between every two adjacent target color levels is more uniform and natural, and the brightness color level layering effect is further enhanced.
As shown in fig. 10, the embodiment of the present invention discloses an image tone scale simplification apparatus, which includes a determination unit 1001, a mixing unit 1002, and an overlay unit 1003; wherein the content of the first and second substances,
a determining unit 1001 configured to determine at least two target color levels from a color level number series of original image data; wherein the color gradation number sequence includes all color gradations arranged by size.
A mixing unit 1002, configured to mix every two adjacent target color levels into a target pseudo color level unit.
The overlaying unit 1003 is configured to fill and overlay the target pseudo gamut unit into an adjacent gamut group formed by every two corresponding adjacent target gamuts in the original image data, so as to obtain a simplified gamut image.
Optionally, the mixing unit 1002 is specifically configured to mix every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of mixing ratios corresponding to the pseudo color level unit, so as to obtain X target pseudo color level units of an adjacent color level group formed by every two adjacent target color levels; wherein X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and X target pseudo-gradation units correspond to X mixing ratios one by one;
accordingly, the overlay unit 1003 is specifically configured to overlay X target pseudo gamut units of each adjacent gamut group into each corresponding adjacent gamut group in the original image data, so as to obtain a simplified gamut image.
Optionally, the image tone scale simplification apparatus shown in fig. 10 may further include the following units not shown:
a dividing unit, configured to determine, after the determining unit 1001 determines at least two target color levels from a color level number sequence of the original image data and before the covering unit 1003 covers X target pseudo color level units of each adjacent color level group to each corresponding adjacent color level group in the original image data to obtain a simplified color level image, determine X auxiliary color levels in the adjacent color level group formed by each two adjacent target color levels, and divide the color level sequence according to the N target color levels and the (N-1) · X auxiliary color levels to obtain N + (N-1) · X color level sub-number sequences, where each color level sub-number sequence corresponds to one target color level or one auxiliary color level; wherein N is a positive integer greater than 1;
the selecting unit is used for selecting at least one pixel corresponding to each color level sub-sequence from the original image data;
the merging unit is used for covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data;
and correspondingly, the overlaying unit 1003 is specifically configured to respectively fill and overlay the X target pseudo gamut units of each adjacent gamut group to the corresponding X auxiliary gamut units in the first image data one by one, so as to obtain a simplified gamut image.
Alternatively, the covering unit 1003 may include the following modules, which are not shown:
the matching module is used for carrying out one-to-one matching on the X target pseudo color level units and the X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and the covering module is used for respectively filling and covering the X target pseudo color level units of each adjacent color level group to the corresponding X auxiliary color levels in the first image data according to the matching relation to obtain a simplified color level image.
Alternatively, if 1 ≦ X ≦ 3, the mixing unit 1002 may include the following modules not shown:
the determining module is used for respectively determining each two adjacent target color levels as a light color level and a dark color level;
the mixing module is used for mixing the light color levels and the dark color levels according to the size of the pseudo color level units of 2X 2 pixels and any X kinds of corresponding mixing proportions to obtain X target pseudo color level units of each adjacent color level group; wherein, the size of the false color step unit of 2 x 2 pixels is corresponding to three mixing proportions which are 1 to 3, 2 to 2 and 3 to 1 respectively.
Further optionally, the mixing module may be specifically configured to determine a mixing ratio of 2 to 2 from three mixing ratios corresponding to the pseudo tone scale unit size of 2 × 2 pixels when X is 1, and mix the light tone scale and the dark tone scale to obtain 1 target pseudo tone scale unit of each adjacent tone scale group; when X is 2, determining two mixing ratios of 1:3 and 3:1 from three mixing ratios corresponding to the size of the pseudo color level unit of the 2X 2 pixel, and mixing the light color level and the dark color level to obtain 2 target pseudo color level units of each adjacent color level group; and when X is 3, mixing the light color gradation and the dark color gradation according to three mixing proportions corresponding to the size of the pseudo color gradation unit of 2X 2 pixels to obtain 3 target pseudo color gradation units of each adjacent color gradation group.
As shown in fig. 11, an embodiment of the present invention discloses an electronic device, which includes a memory 1101 storing executable program codes and a processor 1102 coupled to the memory 1101;
the processor 1102 calls the executable program code stored in the memory 1101 to execute the image tone scale reduction method described in each of the above embodiments.
The embodiment of the invention also discloses a computer readable storage medium which stores a computer program, wherein the computer program enables a computer to execute the image color gradation simplifying method described in the above embodiments.
The above embodiments are provided to illustrate, reproduce and deduce the technical solutions of the present invention, and to fully describe the technical solutions, the objects and the effects of the present invention, so as to make the public more thoroughly and comprehensively understand the disclosure of the present invention, and not to limit the protection scope of the present invention.
The above examples are not intended to be exhaustive of the invention and there may be many other embodiments not listed. Any alterations and modifications without departing from the spirit of the invention are within the scope of the invention.

Claims (10)

1. The image tone scale simplification method is characterized by comprising the following steps:
determining at least two target color levels from the color level number sequence of the original image data; wherein the color gradation number sequence comprises all color gradations arranged according to sizes;
mixing every two adjacent target color levels into a target pseudo color level unit;
and filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image.
2. The image tone scale reduction method of claim 1, wherein mixing every two adjacent target tone scales into a target pseudo tone scale unit comprises:
mixing every two adjacent target color levels according to the size of the pseudo color level unit and any X kinds of corresponding mixing proportions to obtain X target pseudo color level units of adjacent color level groups formed by every two adjacent target color levels; wherein, X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and the X target pseudo-gradation units correspond to the X mixing ratios one by one;
and, the filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image, including:
covering X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain a simplified color level image.
3. The method of claim 2, wherein after determining at least two target levels from the number sequence of levels in the original image data and before overlaying the X target pseudo-level cells of each neighboring level set into each corresponding neighboring level set in the original image data to obtain the simplified level image, the method further comprises:
determining X auxiliary color levels in an adjacent color level group formed by every two adjacent target color levels;
dividing the color level number sequence according to N target color levels and (N-1) X auxiliary color levels to obtain N + (N-1) X color level sub-number sequences, wherein each color level sub-number sequence corresponds to one target color level or auxiliary color level; wherein N is a positive integer greater than 1;
selecting at least one pixel corresponding to each color level sub-sequence from the original image data;
covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data;
and covering the X target pseudo tone scale units of each adjacent tone scale group into each corresponding adjacent tone scale group in the original image data to obtain a simplified tone scale image, including:
and filling and covering X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data one by one to obtain a simplified color level image.
4. The method for image level reduction according to claim 3, wherein the step of filling the X target pseudo level units of each adjacent level group one by one into the corresponding X auxiliary levels in the first image data to obtain the reduced level image comprises:
carrying out one-to-one matching on X target pseudo color level units and X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and according to the matching relation, filling and covering X target pseudo color level units of each adjacent color level group to corresponding X auxiliary color levels in the first image data respectively to obtain a simplified color level image.
5. An image tone scale reduction apparatus, comprising:
a determining unit configured to determine at least two target color levels from a color level number sequence of original image data; wherein the color gradation number sequence comprises all color gradations arranged according to sizes;
the mixing unit is used for mixing every two adjacent target color levels into a target pseudo color level unit;
and the covering unit is used for filling and covering the target pseudo color level unit into an adjacent color level group formed by every two corresponding adjacent target color levels in the original image data to obtain a simplified color level image.
6. The image tone scale simplification device of claim 5, wherein the mixing unit is specifically configured to mix every two adjacent target tone scales according to the size of the pseudo tone scale unit and any X kinds of mixing ratios corresponding to the pseudo tone scale unit, so as to obtain X target pseudo tone scale units of an adjacent tone scale group formed by every two adjacent target tone scales; wherein, X is a positive integer greater than or equal to 1, the size of the pseudo-gradation unit at least comprises two pixels, and the X target pseudo-gradation units correspond to the X mixing ratios one by one;
the covering unit is specifically configured to cover X target pseudo gamut units of each adjacent gamut group into each corresponding adjacent gamut group in the original image data, so as to obtain a simplified gamut image.
7. The image tone scale reduction device of claim 6, further comprising:
the dividing unit is used for determining X auxiliary color levels in an adjacent color level group formed by every two adjacent target color levels after the determining unit determines at least two target color levels from a color level number sequence of original image data and before the covering unit covers X target pseudo color level units of each adjacent color level group into each corresponding adjacent color level group in the original image data to obtain a simplified color level image, and dividing the color level number sequence according to the N target color levels and the (N-1) X auxiliary color levels to obtain N + (N-1) X color level sub-number sequences, wherein each color level sub-number sequence corresponds to one target color level or one auxiliary color level; wherein N is a positive integer greater than 1;
the selecting unit is used for selecting at least one pixel corresponding to each color level sub-sequence from the original image data;
the merging unit is used for covering the color level of at least one pixel corresponding to each color level sub-sequence into a corresponding target color level or auxiliary color level to obtain first image data;
and the covering unit is specifically configured to fill and cover the X target pseudo gamut units of each adjacent gamut group to the corresponding X auxiliary gamut units in the first image data one by one, respectively, so as to obtain a simplified gamut image.
8. The image tone scale reduction device of claim 7, wherein the overlay unit comprises:
the matching module is used for carrying out one-to-one matching on the X target pseudo color level units and the X auxiliary color levels of each adjacent color level group; the larger the value of the auxiliary color level is, the higher the brightness of the matched target pseudo color level unit is;
and the covering module is used for respectively filling and covering the X target pseudo color level units of each adjacent color level group to the corresponding X auxiliary color levels in the first image data according to the matching relation to obtain a simplified color level image.
9. An electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory for performing the image tone scale reduction method of any of claims 1 to 4.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, wherein the computer program causes a computer to execute the image tone scale simplification method according to any one of claims 1 to 4.
CN202110572391.4A 2021-05-25 2021-05-25 Image color gradation simplifying method and device, equipment and storage medium Pending CN113222851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110572391.4A CN113222851A (en) 2021-05-25 2021-05-25 Image color gradation simplifying method and device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110572391.4A CN113222851A (en) 2021-05-25 2021-05-25 Image color gradation simplifying method and device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113222851A true CN113222851A (en) 2021-08-06

Family

ID=77098326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110572391.4A Pending CN113222851A (en) 2021-05-25 2021-05-25 Image color gradation simplifying method and device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113222851A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222104A (en) * 2021-12-17 2022-03-22 深圳市巨烽显示科技有限公司 Method, device and equipment for improving color display capability of low-bit display equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1598907A (en) * 2003-09-19 2005-03-23 三星电子株式会社 Method and apparatus for displaying image and computer-readable recording medium for storing computer program
CN101052096A (en) * 2006-04-04 2007-10-10 广达电脑股份有限公司 Method and device for regulating image contrast ratio
CN102120384A (en) * 2009-12-17 2011-07-13 永经堂印刷有限公司 Multiple primitive color printing quality control method
CN104618701A (en) * 2015-01-13 2015-05-13 小米科技有限责任公司 Image processing method and device and electronic device
CN109844809A (en) * 2017-11-30 2019-06-04 深圳配天智能技术研究院有限公司 A kind of image processing method and device, computer readable storage medium
CN111784590A (en) * 2019-04-29 2020-10-16 北京京东尚科信息技术有限公司 Image processing method, device and system and computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1598907A (en) * 2003-09-19 2005-03-23 三星电子株式会社 Method and apparatus for displaying image and computer-readable recording medium for storing computer program
CN101052096A (en) * 2006-04-04 2007-10-10 广达电脑股份有限公司 Method and device for regulating image contrast ratio
CN102120384A (en) * 2009-12-17 2011-07-13 永经堂印刷有限公司 Multiple primitive color printing quality control method
CN104618701A (en) * 2015-01-13 2015-05-13 小米科技有限责任公司 Image processing method and device and electronic device
CN109844809A (en) * 2017-11-30 2019-06-04 深圳配天智能技术研究院有限公司 A kind of image processing method and device, computer readable storage medium
CN111784590A (en) * 2019-04-29 2020-10-16 北京京东尚科信息技术有限公司 Image processing method, device and system and computer storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114222104A (en) * 2021-12-17 2022-03-22 深圳市巨烽显示科技有限公司 Method, device and equipment for improving color display capability of low-bit display equipment

Similar Documents

Publication Publication Date Title
CN105574918B (en) A kind of material adding method, device and the terminal of 3D models
US5734369A (en) Method and apparatus for dithering images in a digital display system
CN100573636C (en) The method and apparatus of processing video image displayed data on display device
US7064864B2 (en) Method and apparatus for compressing reproducible color gamut
US5175807A (en) Video signal processing with added probabilistic dither
EP0895408B1 (en) Color halftone error-diffusion with local brightness variation reduction
CN1012302B (en) Color image dispaly system
KR20130002960A (en) Display and display control circuit
CN101185113A (en) Stacked display device
US20010014175A1 (en) Method for rapid color keying of color video images using individual color component look-up-tables
GB2236463A (en) Method and apparatus for dithering antialiased vectors
US6989839B2 (en) Method for converting color to monochrome to maintain differentiability
KR100517189B1 (en) Graphical and video signal mixing devices and their mixing methods
EP0270259B1 (en) Improvements relating to video signal processing systems
CN113222851A (en) Image color gradation simplifying method and device, equipment and storage medium
JPH01321578A (en) Picture display system
Han Real-time color gamut mapping method for digital TV display quality enhancement
CN103325330A (en) Image processor and image processing method
US6271850B1 (en) Image generation apparatus, image generation method, image generation program recording medium, image composition apparatus, image composition method, and image composition program recording medium
US7071947B1 (en) Automatic adjustment of floating point output images
CN110689860B (en) Image representation method, device and computer storage medium
JP2002041000A (en) Liquid crystal display device and its color correcting method
Wu et al. Threshold visual cryptography scheme for color images with no pixel expansion
KR100809348B1 (en) Method and apparatus for modulating sub-pixel in grayscale display
CN101540137A (en) Method and system for treating image by AC type plasma displayer

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