Digital design recoloring and enhancement methods utilizing a text-to-image diffusion model
The systems, methods, and non-transitory computer-readable media include recoloring a digital design according to colors of a digital image and further generating an enhanced recolored digital design. In particular, in some embodiments, the disclosed systems identify a digital image for recoloring a digital design and recolors the digital design utilizing a color affine transformation algorithm to generate a recolored digital design. Further, in some embodiments, the disclosed systems generate the enhanced recolored digital design by transforming one or more colors of the recolored digital design to be within a range of the colors of the digital image utilizing a convex hull projection method. Moreover, in some embodiments, the disclosed systems further enhance the recolored digital design utilizing a contrast enhancement algorithm to modify luminescence values.
1 . A system comprising:
one or more memory components; and
one or more processing devices coupled to the one or more memory components, the one or more processing devices to perform operations comprising:
identifying a digital image for recoloring a digital design;
recoloring, utilizing a color affine transformation algorithm, colors of the digital design according to colors of the digital image to generate a recolored digital design comprising mapped colors; and
generating an enhanced recolored digital design by:
utilizing a convex hull projection method to construct a convex hull from the colors of the digital image;
projecting the mapped colors of the recolored digital design toward the convex hull to generate transformed colors; and
modifying, utilizing a contrast enhancement algorithm, luminescence values of the transformed colors to increase color separation.
2 . The system of claim 1 , wherein the operations further comprise:
determining a statistical distribution of a first range of colors of the digital design; and
from the statistical distribution, reducing the colors of the digital design to a second range of colors smaller than the first range of colors.
3 . The system of claim 1 , wherein the operations further comprise converting a first range of colors of the digital design within an RGB color space to an HSL color space.
4 . The system of claim 3 , wherein the operations further comprise:
initializing, utilizing a clustering algorithm, a set of color clusters with a range of colors smaller than the first range of colors; and
clustering, utilizing the clustering algorithm, the first range of colors of the digital design to the set of color clusters.
5 . The system of claim 4 , wherein utilizing the clustering algorithm comprises:
determining for a first color of the first range of colors, a hue value is within a predefined hue threshold of a first cluster of the set of color clusters, a saturation value matches a saturation value of the first cluster of the set of color clusters, and lightness value is within a predefined lightness threshold of the first cluster of the set of color clusters; and
assigning the first color to the first cluster of the set of color clusters.
6 . The system of claim 1 , wherein utilizing the color affine transformation algorithm comprises:
generating a three-dimensional array representation of the colors of the digital image;
generating a three-dimensional array representation of colors of the digital design;
generating, a first set of arrays from the three-dimensional array representation of the digital image and a second set of arrays from the three-dimensional array representation of the digital design; and
transforming the second set of arrays of the digital design according to the first set of arrays of the digital image.
7 . The system of claim 1 , wherein utilizing the convex hull projection method further comprises:
projecting the mapped colors towards a surface of the convex hull by transforming the mapped colors of the recolored digital design to align with the convex hull, wherein the mapped colors are treated as a set of points in a three-dimensional space;
determining a geometric structure that contains the set of points in the three-dimensional space as the geometric structure of the convex hull; and
generating a transformed recolored digital design based on the geometric structure of the convex hull.
8 . The system of claim 1 , wherein utilizing the contrast enhancement algorithm comprises modifying brightness or darkness values of the digital design.
9 . A non-transitory computer-readable medium storing executable instructions which, when executed by at least one processing device, cause the at least one processing device to perform operations comprising:
identifying a digital image for recoloring a digital design;
recoloring, utilizing a color affine transformation algorithm, colors of the digital design according to colors of the digital image to generate a recolored digital design comprising mapped colors; and
generating an enhanced recolored digital design by:
utilizing a convex hull projection method to construct a convex hull from the colors of the digital image;
projecting the mapped colors of the recolored digital design toward the convex hull to generate transformed colors; and
modifying, utilizing a contrast enhancement algorithm, luminescence values of the transformed colors to increase color separation.
10 . The non-transitory computer-readable medium of claim 9 , wherein the operations further comprise:
determining a statistical distribution of a first range of colors of the digital design; and
from the statistical distribution, reducing the first range of colors of the digital design to a second range of colors smaller than the first range of colors.
11 . The non-transitory computer-readable medium of claim 9 , wherein recoloring, utilizing the color affine transformation algorithm comprises:
generating a three-dimensional array representation of the colors of the digital image;
generating a three-dimensional array representation of colors of the digital design;
generating, a first set of arrays from the three-dimensional array representation of the digital image and a second set of arrays from the three-dimensional array representation of the digital design; and
transforming the second set of arrays of the digital design according to the first set of arrays of the digital image.
12 . The non-transitory computer-readable medium of claim 9 , wherein generating an enhanced recolored digital design further comprises:
projecting the mapped colors toward a surface of the convex hull by transforming the mapped colors of the recolored digital design to align with the convex hull, wherein the mapped colors are treated as a set of points in a three-dimensional space;
determining a geometric structure that contains the set of points in the three-dimensional space as the geometric structure of the convex hull;
generating a transformed recolored digital design based on the geometric structure of the convex hull; and
modifying the transformed recolored digital design by utilizing the contrast enhancement algorithm to modify brightness or darkness values to generate the enhanced recolored digital design.
13 . A method comprising:
identifying a digital image for recoloring a digital design;
recoloring, utilizing a color affine transformation algorithm, colors of the digital design according to colors of the digital image to generate a recolored digital design comprising mapped colors; and
generating an enhanced recolored digital design by:
utilizing a convex hull projection method to construct a convex hull from the colors of the digital image;
projecting the mapped colors of the recolored digital design toward the convex hull to generate transformed colors; and
modifying, utilizing a contrast enhancement algorithm, luminescence values of the transformed colors to increase color separation.
14 . The method of claim 13 , further comprising:
determining a statistical distribution of a first range of colors of the digital design; and
from the statistical distribution, reducing the colors of the digital design to a second range of colors smaller than the first range of colors.
15 . The method of claim 13 , further comprising converting a first range of colors of the digital design within an RGB color space to an HSL color space.
16 . The method of claim 15 , further comprising:
initializing, utilizing a clustering algorithm, a set of color clusters with a range of colors smaller than the first range of colors; and
clustering, utilizing the clustering algorithm, the first range of colors of the digital design to the set of color clusters.
17 . The method of claim 16 , wherein utilizing the clustering algorithm comprises:
determining for a first color of the first range of colors, a hue value is within a predefined hue threshold of a first cluster of the set of color clusters, a saturation value matches a saturation value of the first cluster of the set of color clusters, and lightness value is within a predefined lightness threshold of the first cluster of the set of color clusters; and
assigning the first color to the first cluster of the set of color clusters.
18 . The method of claim 13 , wherein utilizing the color affine transformation algorithm comprises:
generating a three-dimensional array representation of the colors of the digital image;
generating a three-dimensional array representation of colors of the digital design;
generating, a first set of arrays from the three-dimensional array representation of the digital image and a second set of arrays from the three-dimensional array representation of the digital design; and
transforming the second set of arrays of the digital design according to the first set of arrays of the digital image.
19 . The method of claim 13 , wherein utilizing the convex hull projection method further comprises:
projecting the mapped colors towards a surface of the convex hull by transforming the mapped colors of the recolored digital design to align with the convex hull, wherein the mapped colors are treated as a set of points in a three-dimensional space;
determining a geometric structure that contains the set of points in the three-dimensional space as the geometric structure of the convex hull; and
generating a transformed recolored digital design based on the geometric structure of the convex hull.
20 . The method of claim 13 , wherein utilizing the contrast enhancement algorithm comprises modifying brightness or darkness values of the digital design.