CN113222851B - Image tone simplifying method and device, equipment and storage medium - Google Patents

Image tone simplifying method and device, equipment and storage medium Download PDF

Info

Publication number
CN113222851B
CN113222851B CN202110572391.4A CN202110572391A CN113222851B CN 113222851 B CN113222851 B CN 113222851B CN 202110572391 A CN202110572391 A CN 202110572391A CN 113222851 B CN113222851 B CN 113222851B
Authority
CN
China
Prior art keywords
tone scale
tone
target
adjacent
pseudo
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.)
Active
Application number
CN202110572391.4A
Other languages
Chinese (zh)
Other versions
CN113222851A (en
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/CN113222851B/en
Publication of CN113222851A publication Critical patent/CN113222851A/en
Application granted granted Critical
Publication of CN113222851B publication Critical patent/CN113222851B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 an image tone simplifying method, a device, equipment and a storage medium, wherein the method comprises the following steps: determining at least two target color levels from a color level sequence of the original image data; wherein the tone scale number column includes all tone scales arranged according to the size; mixing every two adjacent target color levels into a target pseudo color level unit; and filling and covering the target pseudo-tone scale units into adjacent tone scale groups formed by every two corresponding adjacent target tone scales in the original image data to obtain a simplified tone scale image, so that the effect of the brightness tone scale level can be kept, and the tone scale of the simplified image is excessively softer.

Description

Image tone 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 level simplifying method, an image color level simplifying device, image color level simplifying equipment and a storage medium.
Background
It is well known that in a fixed resolution image, a higher number of levels of its color means that the better the color fullness and definition of the image, the softer the shading relationship, the more hierarchical it is, and vice versa. It is conventionally understood that the more the image color levels should be, the more advantageous, but in practice the image color levels are not the same in the product applications of the respective industries. Some industries cannot effectively express such rich image effects in products due to limitations of various factors (such as cost, hardware technology and effect quality), and only can simplify images, and a plurality of target color levels are left for use.
For example, in the knitting industry, one target color level corresponds to one group of color yarns, and the image is knitted with fewer target color levels, which means that fewer color yarns can be used for knitting, so that the cost is lower and the knitting efficiency is higher. In view of cost and quality, in the process of knitting jacquard of a computerized flat knitting machine on a multi-color-level image, the original image needs to be subjected to color level simplification, and the target color level is generally controlled to be between 2 and 6.
The conventional method for simplifying the color levels is realized by directly simplifying the color levels of an original image through processing of a computerized flat knitting machine edition software, merging the secondary color levels with the adjacent main target color levels according to fixed program operation, and simplifying to obtain corresponding target color levels. The color between each adjacent target color level of the image obtained by the method is excessively hard, and the effect of the brightness color level is seriously lost, so that the image expression effect is distorted and the look and feel are extremely influenced.
Disclosure of Invention
The invention aims to provide an image tone simplifying method, an image tone simplifying device, image tone simplifying equipment and a storage medium, which can keep the effect of brightness tone gradation so that the tone gradation of the simplified image is excessively softer.
The first aspect of the embodiment of the invention discloses an image color level simplifying method, which comprises the following steps:
determining at least two target color levels from a color level sequence of the original image data; wherein the color gradation sequence comprises all color gradations arranged according to the size;
mixing every two adjacent target color levels into a target pseudo color level unit;
and filling and covering the target pseudo-tone scale units into adjacent tone scale groups formed by every two corresponding adjacent target tone scales in the original image data to obtain a simplified tone scale image.
In one embodiment, the mixing of each two adjacent target color levels into a 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 corresponding X mixing proportion, and obtaining 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-tone scale unit at least comprises two pixels, and the X target pseudo-tone scale units are in one-to-one correspondence with the X mixing ratios;
And filling and covering the target pseudo-tone scale units into adjacent tone scale groups formed by every two corresponding adjacent target tone scales in the original image data to obtain a simplified tone scale image, wherein the method comprises the following steps of:
and covering 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.
In one embodiment, after the determining at least two target color levels from the color level columns of the original image data and before the overlaying the X target pseudo color level units of each adjacent color level group into the corresponding each 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 adjacent color level groups formed by every two adjacent target color levels;
dividing the tone scale sequence according to N target tone scales, (N-1) and X auxiliary tone scales to obtain N+ (N-1) and X tone scale sub-sequence, wherein each tone scale sub-sequence corresponds to one target tone scale or auxiliary tone scale; wherein N is a positive integer greater than 1;
Selecting at least one pixel corresponding to each tone scale sub-number column from the original image data;
covering the tone scale of at least one pixel corresponding to each tone scale sub-number column into a corresponding target tone scale or auxiliary tone scale to obtain first image data;
and overlaying 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, wherein the method comprises the following steps of:
and filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one to obtain a simplified tone scale image.
In one embodiment, the filling and overlaying the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one to obtain the simplified tone scale image includes:
Performing one-to-one matching on X target pseudo tone scale units and X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
A second aspect of an embodiment of the present invention discloses an image tone simplifying apparatus, including:
A determining unit configured to determine at least two target gradations from a gradation sequence of original image data; wherein the color gradation sequence comprises all color gradations arranged according to the size;
A mixing unit 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-tone level unit into adjacent tone level groups formed by every two corresponding adjacent target tone levels in the original image data to obtain a simplified tone 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 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-tone scale unit at least comprises two pixels, and the X target pseudo-tone scale units are in one-to-one correspondence with the X mixing ratios;
the covering unit is specifically configured to cover 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, so as to obtain a simplified tone scale image.
In one embodiment, the image tone simplifying apparatus further includes:
A dividing unit, configured to determine, after the determining unit determines at least two target hues from the hues of the original image data, and before the covering unit covers X target pseudo hues of each adjacent hues into each adjacent hues corresponding to each adjacent hues in the original image data to obtain a simplified hues image, X auxiliary hues in adjacent hues formed by each two adjacent target hues, and divide the hues according to N target hues, (N-1) X auxiliary hues, to obtain n+ (N-1) X hues, each hues corresponding to one target hues or auxiliary hues; wherein N is a positive integer greater than 1;
A selecting unit, configured to select at least one pixel corresponding to each tone scale sub-number column from the original image data;
a merging unit, configured to cover a tone scale of at least one pixel corresponding to each tone scale sub-number column to a corresponding target tone scale or auxiliary tone scale, so as to obtain first image data;
And the covering unit is specifically configured to fill and cover the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one, so as to obtain a simplified tone scale 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 tone scale units and the X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And the covering module is used for respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
A third aspect of an embodiment of the invention discloses an electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor invokes the executable program code stored in the memory for performing the image level reduction method disclosed in the first aspect.
A fourth aspect of the embodiments of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the image gradation simplification method disclosed in the first aspect.
The invention provides an image color level simplifying method, an image color level simplifying device and a storage medium, wherein the image color level simplifying method comprises the following steps: determining at least two target color levels from a color level sequence of the original image data; wherein the tone scale number column includes all tone scales arranged according to the size; mixing every two adjacent target color levels into a target pseudo color level unit; filling and covering the target pseudo-tone scale units into adjacent tone scale groups formed by every two corresponding adjacent target tone scales in the original image data to obtain a simplified tone scale image; therefore, the color level of the simplified color level image can be increased visually by mixing every two adjacent target color levels into pseudo color level units and filling and covering the pseudo color level units in a brightness interval range formed by every two adjacent target color levels, and only N real color levels are reserved actually, so that the effect of brightness color level levels can be reserved, and the color level of the simplified image is 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 specifically stated or otherwise defined, the same reference numerals in different drawings denote the same or similar technical features, and different reference numerals may be used for the same or similar technical features.
FIG. 1 is a flow chart of a method for simplifying image tone scale according to an embodiment of the present invention;
FIG. 2 is a flow chart of another image level reduction method disclosed in an embodiment of the present invention;
Fig. 3 is an exemplary diagram of an original image disclosed in an embodiment of the present invention;
FIG. 4 is a sequence of target and auxiliary levels disclosed in an embodiment of the present invention;
fig. 5 is an exemplary diagram of a first image disclosed in an embodiment of the present invention.
Fig. 6 is a schematic diagram of a pseudo tone scale unit according to an embodiment of the present invention.
FIG. 7 is a schematic diagram of overlaying a target pseudo tone scale cell to an auxiliary tone scale according to an embodiment of the present invention.
Fig. 8 is a simplified tone scale image obtained by the image tone scale simplification method according to the embodiment of the present invention.
Fig. 9 is a simplified tone scale image obtained under the conventional tone scale reduction method disclosed in the embodiment of the present invention.
Fig. 10 is a schematic structural diagram of an image tone simplifying 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.
Reference numerals illustrate:
1001. A determination unit; 1002. a mixing unit; 1003. a covering unit; 1101. a memory; 1102. a processor.
Detailed Description
In order that the invention may be readily understood, a more particular description of specific embodiments thereof will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
Unless defined otherwise or otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. In the context of a realistic scenario in connection with the technical solution of the invention, all technical and scientific terms used herein may also have meanings corresponding to the purpose of the technical solution of the invention. The terms "first" and "second" … "as used herein are used merely for distinguishing between names and not necessarily for describing a particular amount or sequence. The term "and/or" as used herein 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 "fixed" to another element, it can be directly fixed 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 to" another element, it can be directly mounted to the other element or intervening elements may also be present. When an element is referred to as being "disposed on" another element, it can be directly on the other element or intervening elements may also be present.
As used herein, unless specifically stated or otherwise defined, "the" means that the feature or technical content mentioned or described before in the corresponding position may be the same or similar to the feature or technical content mentioned.
Clearly, technical contents or features that are contrary to the object of the present invention or that are clearly contradictory should be excluded.
As shown in fig. 1, an embodiment of the present invention discloses an image tone simplifying method, which includes:
101. at least two target hues are determined from the hues column of the original image data.
Wherein the raw image data may be used to refer to the raw image, which includes various image data of the raw image, such as the number of color levels, the position of each pixel, the hue, the color level, and the like. Wherein the rank order column includes all ranks arranged by size. The number of target color levels can be N, N positive integers greater than 1, and specific values can be set by a developer according to actual requirements. 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 levels may vary, and is not specifically limited herein.
In step 101, the target tone scale can be determined from all the tone scales in the tone scale sequence according to the number N of target tone scales, and each two adjacent target tone scales form an adjacent tone scale group, i.e. N-1 adjacent tone scale groups, so that the brightness differences of the first and the last two bits in each adjacent tone scale group are approximately equal as much as possible.
It will be appreciated that the original image is a multi-level image, and since the range of luminance levels is 0-255, the original image has up to 256 levels, at least n+1 levels. The color mode of the original image is a gray mode, and the size is 450pix x 750pix, wherein pix is a pixel unit.
102. The target pseudo-tone cells are mixed with every two adjacent target tone levels.
Wherein, the method can mix every two adjacent target color levels by adopting a random mixing or permutation and combination mode, and the number of the target pseudo color level units can be one or more. Because brightness difference exists between every two adjacent target color levels, a target pseudo color level unit formed by mixing the two adjacent target color levels can respectively generate brightness difference with the two target color levels, thereby playing a role in transition.
103. And filling and covering the target pseudo-tone scale units into adjacent tone scale groups formed by every two corresponding adjacent target tone scales in the original image data to obtain the simplified tone scale image.
By mixing every two adjacent target color levels into pseudo color level units and filling and covering the pseudo color level units into adjacent color level groups (namely brightness interval ranges) formed by every two adjacent target color levels, the color level of the simplified color level image is visually increased, and only N real color levels are reserved actually, so that the brightness color level effect can be reserved, and the color level of the simplified image is excessively softer.
Optionally, step 102 may include: and mixing every two adjacent target color levels according to the size of the pseudo color level unit and any corresponding X mixing proportion, and obtaining 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 pseudo-tone scale unit size at least comprises two pixels, and X target pseudo-tone scale units are in one-to-one correspondence with X mixing ratios. Accordingly, step 103 may include: 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 the simplified tone scale image.
Alternatively, X auxiliary tone scales may be determined in adjacent tone scale groups formed by every two adjacent target tone scales, and then the X target pseudo tone scale units of each adjacent tone scale group are overlaid onto the X auxiliary tone scales of each adjacent tone scale group corresponding to the original image data, so as to obtain the simplified tone scale image.
Therefore, based on different mixing ratios, the target pseudo-tone units with different light and shade areas can be mixed, and the target pseudo-tone units with different light and shade degrees are covered in the corresponding brightness interval range in the original image data, so that the tone scale of the simplified tone scale image can be increased visually, and more light and shade levels are provided. Finally, N target color levels and (N-1) X pseudo color level effects are generated, the pseudo color levels are formed by mixing every two adjacent target color levels, in fact, the simplified color level image only has N real color levels, is more delicate in visual sense, presents more brightness color levels of the image to a certain extent, enhances the richer display effect of the image under the condition of the simplified color level, and has better color level effect when being 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 cost and quality is considered, and the method is better applied to pattern products in various industries.
As shown in fig. 2, an embodiment of the present invention discloses another image tone simplifying method, which includes:
201. N target color levels are determined from the color level number column of the original image data.
In this embodiment, taking an application of jacquard knitting by a computerized flat knitting machine in knitting industry as an example, an original image is obtained as shown in fig. 3, and a color mode of the original image is a gray mode and a size is 450pix x 750pix. Assuming that the number of the tone levels of the original image is 256, the tone level columns are {0, … …,127, … …,255}, 3 target tone levels are determined from the number of the tone levels, two end points and middle points, namely 0, 127, 255, are respectively taken, and 2 adjacent tone level groups are respectively '0+127', '127+255'.
202. X auxiliary color levels are determined in adjacent color level groups formed by every two adjacent target color levels.
In the embodiment of the present invention, all the color levels in the color level sequence are arranged according to the size sequence (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 sequence, and X auxiliary color levels can be determined in each adjacent color level group according to an approximate bisection method, so as to reflect the excessive brightness level between every two adjacent target color levels.
The specific value of at least one auxiliary tone scale, that is, X is a positive integer greater than or equal to 1, may be determined according to the number of elements of the adjacent tone scale groups, and if the adjacent tone scale groups include more tone scales, a plurality of auxiliary tone scales may be selected correspondingly, which is not limited herein.
Alternatively, 1-3 are generally selected. In this example, x=3 is preferred, and as shown in fig. 4, the auxiliary tone steps 31, 63, 95 are determined in the adjacent tone step group "0+127", and the auxiliary tone steps 159, 191, 223 are determined in the adjacent tone step group "127+255".
203. The color gradation sequence is divided according to N target color gradations, (N-1) and X auxiliary color gradations, and N+ (N-1) and X color gradation sub-sequence is obtained, and each color gradation sub-sequence corresponds to one target color gradation or auxiliary color gradation.
In step 203, the remaining secondary color levels except for the N target color levels and the (N-1) X auxiliary color levels in the color level sequence are combined into the adjacent target color levels or auxiliary color levels, and the brightness differences of the first and the last two bits in each color level sequence are kept to be approximately equal as much as possible by adopting an approximately halving dividing method.
For example, in the present example, the gradation in the gradation range 0 to 15 is divided into a first gradation sub-number column corresponding to the target gradation 0, the gradation in the gradation range 16 to 47 is divided into a second gradation sub-number column corresponding to the auxiliary gradation 31, the gradation in the gradation range 48 to 79 is divided into a third gradation sub-number column corresponding to the auxiliary gradation 63, and so on the basis of the target gradation 0, 127, 255 and the auxiliary gradation 31, 63, 95, 159, 191, 223, and n+ (N-1) X gradation sub-number columns each including one target gradation or auxiliary gradation, and other sub-gradations are formed.
204. At least one pixel corresponding to each tone scale sub-number column is selected from the original image data.
It should be noted that, the original image includes a plurality of pixels, and the color levels of some pixels may be the same. That is, each tone scale in the tone scale sequence may correspond to one or more pixels in the original image data, and each pixel corresponds to one tone scale. Therefore, based on the original corresponding relation, the pixel corresponding to each tone scale in each tone scale sub-number column can be found, so as to obtain at least one pixel corresponding to each tone scale sub-number column.
205. And covering the tone scale of at least one pixel corresponding to each tone scale sub-number column into a corresponding target tone scale or auxiliary tone scale to obtain first image data.
Each of the tone scale sub-number columns includes a target tone scale or auxiliary tone scale and other sub-tone scales, when the tone scale of at least one pixel corresponding to each tone scale sub-number column is covered to the corresponding target tone scale or auxiliary tone scale, the target tone scale or auxiliary tone scale is unchanged, and the other sub-tone scales are covered to the corresponding target tone scale or auxiliary tone scale, the first image data, thereby obtaining a first image with preliminary tone scale simplification, the first image has N+ (N-1) X tone scales.
For example, the first image with preliminary tone scale reduction is obtained by overlaying the tone scale of the pixel corresponding to the tone scale 0-15 in the first tone scale sub-sequence with 0, overlaying the tone scale of the pixel corresponding to the tone scale 16-47 in the second tone scale sub-sequence with 31, and so on.
Steps 202 to 205 may be implemented by dividing the tone scale sequence, merging the remaining secondary tone scales except for the N target tone scales, (N-1) ·x auxiliary tone scales in the tone scale sequence into the target tone scales or auxiliary tone scales adjacent thereto, and then covering the target pseudo tone scale unit onto the merged auxiliary tone scales, so that the transition between every two adjacent target tone scales is more uniform and natural, thereby further enhancing the luminance tone scale effect.
206. And mixing every two adjacent target color levels according to the size of the pseudo color level unit and any corresponding X mixing proportion, and obtaining X target pseudo color level units of each adjacent color level group.
It should be noted that, steps 202-205 and step 206 are not consecutive, in one embodiment, step 201 may be performed before step 202-205 and step 206 are performed simultaneously, or steps 202-205 may be performed first, and step 206 may be performed first; or step 206 is performed before steps 202-205 are performed.
In the embodiment of the invention, brightness difference exists between every two adjacent target color levels, and the brightness difference can be respectively determined as a bright color level and a dark color level. Alternatively, the database may store a plurality of pseudo-tone cell sizes, each of which corresponds to a plurality of different mixing ratios.
In step 206, the size of the pseudo tone scale unit corresponding to the 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 tone scale unit size, mixing (e.g. permutation and combination or random mixing) is performed on the bright tone scale and the dark tone scale to form a plurality of pseudo tone scale units corresponding to each mixing ratio, and finally a target pseudo tone scale unit is determined from the plurality of pseudo tone scale units corresponding to each mixing ratio, so as to obtain X target pseudo tone scale units of each adjacent tone scale group.
Or the size of the pseudo tone cell may be a parameter preset by the user, further, the number X of the auxiliary tone steps in step 202 may be determined according to the designated size of the pseudo tone cell, for example, the designated size of the pseudo tone cell corresponds to Z kinds of mixing ratios, and then X is taken as x.ltoreq.z.
The X target pseudo-tone units are in one-to-one correspondence with the X mixing ratios, so that each target pseudo-tone unit has a bright-dark area with different brightness, a stronger brightness difference is generated visually, and the bright-dark gradation effect presented by each different mixing ratio can be fully utilized.
The pseudo tone cell size at least includes 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 needs, which is not limited herein. Preferably, the pseudo tone cell size is 2pix by 2pix, so that the detail level effect of the image can be better expressed.
Alternatively, if 1+.X+.3, the step 206 may include:
respectively determining each two adjacent target color levels as a bright color level and a dark color level;
Mixing the bright color gradation and the dark color gradation according to the size of the pseudo color gradation unit of the 2X 2 pixels and the corresponding arbitrary X mixing proportion, and obtaining X target pseudo color gradation units of each adjacent color gradation group;
If X is 1-3, the pseudo-tone cell size of 2 pix-2 pix can be selected, and the pseudo-tone cell size corresponds to three mixing ratios of 1 to 3,2 to 2, and 3 to 1. Or if the pseudo tone scale unit size of 2pix X2 pix is set, 1.ltoreq.X.ltoreq.3.
Further alternatively, X mixing ratios may be selected from the three mixing ratio examples according to the size of X for mixing the light gradation and the dark gradation.
Specifically, optionally, if x=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 bright color level and the dark color level to obtain 1 target pseudo color level unit of each adjacent color level group;
If x=2, determining two mixing ratios of 1 to 3 and 3 to 1 from three mixing ratios of 1 to 3, 2 to 2 and 3 to 1, and mixing the bright color gradation and the dark color gradation to obtain 2 target pseudo color gradation units of each adjacent color gradation group;
if x=3, three mixing ratios of 1 to 3, 2 to 2, and 3 to 1 are determined, and the bright and dark tone scales are mixed to obtain 3 target pseudo tone scale units of each adjacent tone scale group.
In this example, a pseudo tone cell size of 2pix by 2pix is preferably used, so taking x=3, exactly corresponding to three mixing ratios. First, for target gradation 0 and 127 constituting adjacent gradation group "0+127", 0 is determined as a bright gradation, and 127 is determined as a dark gradation; for the target tone scales 127 and 255 constituting the adjacent tone scale group "127+255", 127 is determined to be a bright tone scale and 255 is determined to be a dark tone scale; 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-tone scale units corresponding to the three mixing ratios, as shown in fig. 6, fig. 6 only shows part of pseudo-tone scale units corresponding to each mixing ratio by way of example, then determining any one of the pseudo-tone scale units corresponding to each mixing ratio as a target pseudo-tone scale unit, and obtaining 3 target pseudo-tone scale units corresponding to adjacent tone scale groups of 0+127 as Aa, ab and Ac respectively; similarly, 3 target pseudo tone scale units corresponding to the adjacent tone scale groups "127+255" are Ba, bb, bc, respectively.
207. And filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one to obtain a simplified tone scale image.
Since the different mixing ratios are used to mix every two target gradations constituting adjacent gradations, the brightness of the X target pseudo-gradation units of each adjacent gradation is different, and the larger the gradation value of the pixel, the brighter the description. In order to obtain better light and shade excessive effect, the target pseudo tone scale unit with higher brightness degree can be filled and covered to the auxiliary tone scale with larger tone scale value.
Specifically, step 207 may include:
Performing one-to-one matching on X target pseudo tone scale units and X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
As shown in fig. 7, the target pseudo tone cells Aa, ab, ac, ba, bb, bc of the present example are respectively filled and covered on the corresponding auxiliary tone cells 31, 63, 95, 159, 191, 223 in the first image data one by one to obtain simplified tone image data, and further obtain a simplified tone image, which only includes three target tone cells of 0, 127, 255, as shown in fig. 8.
In the embodiment of the invention, the simplified color level image can be imported into a flat knitting machine system of a knitting computer and knitting data is input, and the flat knitting machine system of the knitting computer can select corresponding color yarns (such as black, gray and white) to knit a finished product according to the knitting data and target color levels (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 a computerized flat knitting machine system, and the original image is subjected to level reduction according to a conventional level reduction method by the computerized flat knitting machine system, and the target level n=3 is set as well, so that a reduced level image is obtained as shown in fig. 9.
By contrast, the simplified color level image (as shown in fig. 9) simplified by the traditional method has serious jaggies and serious distortion of image expression, and the simplified color level image (as shown in fig. 8) simplified by the embodiment of the invention has the advantages that the brightness color level effect of the original image shown in fig. 3 is reserved to a great extent, and the problems of serious jaggies and serious distortion of image expression are greatly improved.
Therefore, by implementing the embodiment of the invention, the tone scale of the simplified tone scale image is visually increased by mixing every two adjacent target tone scales into the pseudo tone scale unit and filling and covering the pseudo tone scale unit into the brightness interval range formed by every two adjacent target tone scales, and only N real tone scales are actually reserved, so that the tone scale effect of the brightness tone scale can be reserved, and the tone scale of the simplified image is excessively softer. The color gradation level effect is better when the user looks at the device in a long distance. The multi-tone original image is better converted into the simple tone image, the balance between cost and quality is considered, and the multi-tone original image is better applied to pattern products in various industries.
In addition, the secondary tone scales except the target tone scales and the auxiliary tone scales in the tone scale sequence are combined into the adjacent target tone scales or auxiliary tone scales, and then the target pseudo tone scale units are covered to the combined auxiliary tone scales, so that the transition between every two adjacent target tone scales is more uniform and natural, and the brightness tone scale effect is further enhanced.
As shown in fig. 10, an embodiment of the present invention discloses an image gradation simplifying apparatus including a determining unit 1001, a mixing unit 1002, and a covering unit 1003; wherein,
A determining unit 1001 for determining at least two target gradations from a gradation sequence of original image data; wherein the rank order column includes all ranks arranged by size.
A mixing unit 1002 for mixing every two adjacent target color levels into a target pseudo color level unit.
And a covering unit 1003, configured to fill and cover the target pseudo-tone scale unit into an adjacent tone scale group formed by every two adjacent target tone scales in the original image data, so as to obtain a simplified tone scale image.
Optionally, the mixing unit 1002 is specifically configured to mix each two adjacent target color levels according to the size of the pseudo color level unit and any X mixing ratios corresponding to the size of the pseudo color level unit, so as to obtain X target pseudo color level units of an adjacent color level group formed by each two adjacent target color levels; wherein X is a positive integer greater than or equal to 1, the size of the pseudo-tone scale unit at least comprises two pixels, and X target pseudo-tone scale units are in one-to-one correspondence with X mixing ratios;
Accordingly, the above-mentioned overlay unit 1003 is specifically configured to overlay 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, so as to obtain a simplified tone scale image.
Optionally, the image gradation simplifying apparatus shown in fig. 10 may further include the following units not shown:
A dividing unit, configured to determine X auxiliary color levels in adjacent color level groups formed by each two adjacent target color levels, and divide the color level columns according to N target color levels, (N-1) X auxiliary color levels, to obtain n+ (N-1) X color level sub-order columns, each color level sub-order column corresponding to one target color level or auxiliary color level, after the determining unit 1001 determines at least two target color levels from the color level columns of the original image data, and before the covering unit 1003 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; wherein N is a positive integer greater than 1;
A selecting unit, configured to select at least one pixel corresponding to each tone scale sub-number column from the original image data;
a merging unit, configured to cover a tone scale of at least one pixel corresponding to each tone scale sub-number column to a corresponding target tone scale or auxiliary tone scale, so as to obtain first image data;
And, correspondingly, a covering unit 1003, specifically configured to fill and cover the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one, so as to obtain a simplified tone scale image.
Alternatively, the covering unit 1003 may include the following modules not shown:
The matching module is used for carrying out one-to-one matching on the X target pseudo tone scale units and the X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And the covering module is used for respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
Alternatively, if 1+.X+.3, the above-mentioned mixing unit 1002 may include the following modules not shown:
The determining module is used for determining each two adjacent target color levels as a bright color level and a dark color level respectively;
The mixing module is used for mixing the bright color level and the dark color level according to the size of the pseudo color level unit of the 2X 2 pixels and any corresponding X mixing proportion to obtain X target pseudo color level units of each adjacent color level group; the pseudo tone cell size of 2×2 pixels corresponds to three mixing ratios, namely 1 to 3, 2 to 2, and 3 to 1.
Further alternatively, the above mixing module may specifically be configured to determine a mixing ratio of 2 to 2 from three mixing ratios corresponding to pseudo-tone scale unit sizes of 2×2 pixels when x=1, and mix a bright tone scale and a dark tone scale to obtain 1 target pseudo-tone scale unit of each adjacent tone scale group; and when x=2, determining two mixing ratios of 1 to 3 and 3 to 1 from three mixing ratios corresponding to the pseudo tone scale unit sizes of 2×2 pixels, and mixing the bright tone scale and the dark tone scale to obtain 2 target pseudo tone scale units of each adjacent tone scale group; and when x=3, mixing the bright tone and the dark tone according to three mixing ratios corresponding to the pseudo tone unit sizes of 2×2 pixels, so as to obtain 3 target pseudo tone units of each adjacent tone group.
As shown in fig. 11, an embodiment of the present invention discloses an electronic device including a memory 1101 storing executable program codes and a processor 1102 coupled to the memory 1101;
The processor 1102 calls executable program codes stored in the memory 1101, and executes the image gradation simplification method described in the above embodiments.
The embodiments of the present invention also disclose a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the image gradation simplification method described in the above embodiments.
The foregoing embodiments are provided for the purpose of exemplary reproduction and deduction of the technical solution of the present invention, and are used for fully describing the technical solution, the purpose and the effects of the present invention, and are used for enabling the public to understand the disclosure of the present invention more thoroughly and comprehensively, and are not used for limiting the protection scope of the present invention.
The above examples are also not an exhaustive list based on the invention, and there may be a number of other embodiments not listed. Any substitutions and modifications made without departing from the spirit of the invention are within the scope of the invention.

Claims (6)

1. An image tone simplifying method, comprising:
determining at least two target color levels from a color level sequence of the original image data; wherein the color gradation sequence comprises all color gradations arranged according to the size;
Mixing every two adjacent target color levels according to the size of the pseudo color level unit and any corresponding X mixing proportion, and obtaining 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-tone scale unit at least comprises two pixels, and the X target pseudo-tone scale units are in one-to-one correspondence with the X mixing ratios;
Covering 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;
Wherein after determining at least two target hues from the hues of the original image data and before overlaying the X target pseudo hues of each adjacent hues into each corresponding adjacent hues in the original image data to obtain a simplified hues image, the method further comprises:
determining X auxiliary color levels in adjacent color level groups formed by every two adjacent target color levels;
dividing the tone scale sequence according to N target tone scales, (N-1) and X auxiliary tone scales to obtain N+ (N-1) and X tone scale sub-sequence, wherein each tone scale sub-sequence corresponds to one target tone scale or auxiliary tone scale; wherein N is a positive integer greater than 1;
Selecting at least one pixel corresponding to each tone scale sub-number column from the original image data;
covering the tone scale of at least one pixel corresponding to each tone scale sub-number column into a corresponding target tone scale or auxiliary tone scale to obtain first image data;
and overlaying 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, wherein the method comprises the following steps of:
and filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one to obtain a simplified tone scale image.
2. The image level simplification method according to claim 1, wherein said filling and overlaying the X target pseudo tone cells of each adjacent tone group one by one to the corresponding X auxiliary tone in the first image data to obtain a simplified tone image, respectively, includes:
Performing one-to-one matching on X target pseudo tone scale units and X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
3. An image gradation simplifying apparatus, comprising:
A determining unit configured to determine at least two target gradations from a gradation sequence of original image data; wherein the color gradation sequence comprises all color gradations arranged according to the size;
the mixing unit is used for mixing every two adjacent target color levels according to the size of the pseudo color level unit and any corresponding X mixing ratios, so as 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-tone scale unit at least comprises two pixels, and the X target pseudo-tone scale units are in one-to-one correspondence with the X mixing ratios;
the covering unit is used for covering the X target pseudo tone scale units of each adjacent tone scale group into each adjacent tone scale group corresponding to the original image data to obtain a simplified tone scale image;
A dividing unit, configured to determine, after the determining unit determines at least two target hues from the hues of the original image data, and before the covering unit covers X target pseudo hues of each adjacent hues into each adjacent hues corresponding to each adjacent hues in the original image data to obtain a simplified hues image, X auxiliary hues in adjacent hues formed by each two adjacent target hues, and divide the hues according to N target hues, (N-1) X auxiliary hues, to obtain n+ (N-1) X hues, each hues corresponding to one target hues or auxiliary hues; wherein N is a positive integer greater than 1;
A selecting unit, configured to select at least one pixel corresponding to each tone scale sub-number column from the original image data;
a merging unit, configured to cover a tone scale of at least one pixel corresponding to each tone scale sub-number column to a corresponding target tone scale or auxiliary tone scale, so as to obtain first image data;
And the covering unit is specifically configured to fill and cover the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data one by one, so as to obtain a simplified tone scale image.
4. The image gradation simplification apparatus as claimed in claim 3, wherein said covering unit includes:
The matching module is used for carrying out one-to-one matching on the X target pseudo tone scale units and the X auxiliary tone scales of each adjacent tone scale group; wherein, the larger the value of the auxiliary tone scale, the higher the brightness of the matched target pseudo tone scale unit;
And the covering module is used for respectively filling and covering the X target pseudo tone scale units of each adjacent tone scale group to the corresponding X auxiliary tone scales in the first image data according to the matching relation to obtain a simplified tone scale image.
5. An electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor invokes the executable program code stored in the memory for performing the image level reduction method of claim 1 or 2.
6. A computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the image gradation simplification method according to claim 1 or 2.
CN202110572391.4A 2021-05-25 2021-05-25 Image tone simplifying method and device, equipment and storage medium Active CN113222851B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

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

Family

ID=77098326

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113222851B (en)

Families Citing this family (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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100580624B1 (en) * 2003-09-19 2006-05-16 삼성전자주식회사 Method and apparatus for displaying image, and computer-readable recording media for storing computer program
CN104618701B (en) * 2015-01-13 2017-03-29 小米科技有限责任公司 Image processing method and device, electronic equipment
CN109844809B (en) * 2017-11-30 2022-04-15 深圳配天智能技术研究院有限公司 Image processing method and device and computer readable storage medium
CN111784590B (en) * 2019-04-29 2024-09-20 北京京东尚科信息技术有限公司 Image processing method, device and system and computer storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113222851A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN101185113B (en) Double displays device
US5258747A (en) Color image displaying system and method thereof
US5734369A (en) Method and apparatus for dithering images in a digital display system
US5473737A (en) Method and apparatus for displaying a composite image made up of a foreground image and a background image
CN100573636C (en) The method and apparatus of processing video image displayed data on display device
US5933131A (en) Luminance controlled color resolution reduction
US7663678B2 (en) Gamma correction, image processing method and program, gamma correction circuit, image processing apparatus, and display apparatus
KR19990087566A (en) Mixing Video Images at Home Communication Terminals
US5175807A (en) Video signal processing with added probabilistic dither
CN1012302B (en) Color image dispaly system
CN101388950B (en) Content-adaptive contrast improving method and apparatus for digital image
JP2769345B2 (en) Display control device
US20010014175A1 (en) Method for rapid color keying of color video images using individual color component look-up-tables
CN113222851B (en) Image tone simplifying method and device, equipment and storage medium
CN102187657A (en) Contrast enhancement of images
KR100517189B1 (en) Graphical and video signal mixing devices and their mixing methods
CN109313878B (en) Display device and display device control method
US7623270B2 (en) Method of processing a digital image by means of ordered dithering technique description
JP3332151B2 (en) Electronic processing device for processing digital image data and method for processing digital image data
CN101083720A (en) TV receiver and TV receiving method
CN109920381B (en) Method and equipment for adjusting backlight value
CN103325330A (en) Image processor and image processing method
JPH01321578A (en) Picture display system
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
CN110689860B (en) Image representation method, device and computer storage medium

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
GR01 Patent grant
GR01 Patent grant