Context-aware text color recommendation system

Embodiments are disclosed for determining a context-aware text color recommendation for text at a text location on an image. In particular, in one or more embodiments, the disclosed systems and methods comprise obtaining an image and a text location on the image, identifying at least one color theme based on a color harmonic template associated with the image, modifying the at least one color theme based on characteristics of the image, determining accessibility for at least one color in the at least one color theme based on the text location on the image, and determining a color palette recommendation for text at the text location on the image based on the determined accessibility for the at least one color in the at least one color theme.

BACKGROUND

Conventional computer graphic editing systems enable users to create or manipulate images interactively on a computer. A very common task in these conventional computer graphic editing systems is the composition of text over a background image. Among the many aspects of the text to consider are location and color. For example, finding an aesthetically pleasing color for the text that is appropriate for the background image, while being accessible (e.g., easy for a reader to read) can often be important factors to achieving a successful composition.

Some existing solutions are able to model objective and/or personalized aesthetic preferences, to improve the appeal of arbitrary color themes, or recommend new colors to add to a theme. However, these solutions are typically based only on aesthetics and do not consider accessibility nor contextual spatial constraints, with their context being only the color theme itself. Other existing solutions focus on data visualizations, where there are rarely existing colors, and thus have the freedom to determine any color theme.

These and other problems exist with regard to composition of text over a background image.

SUMMARY

Introduced here are techniques/technologies for determining font colors for text, given the text's placement over a given background image, that both aesthetically match the given background image, while achieving sufficient contrast to make the text accessible (e.g., easily readable). To address the aesthetics stage, a context-aware text color recommendation system can use a curated database of color palettes and identify the color palettes that best match an input image. To address the accessibility stage, the context-aware text color recommendation system can identify the colors in the identified color palettes that are able to achieve at least a target contrast ratio with respect to a given text location on the given background image.

In particular, in one or more embodiments, the disclosed systems and methods may include obtaining an image and a text location on the image from a user. An image color analysis of the image is generated that indicates the distribution of colors in the image. Using the image color analysis, a color harmonic template associated with the image can be determined. A plurality of color themes is filtered using the determined color harmonic template to identify a plurality of filtered color themes. Some or all of the plurality of filtered color themes are then modified by rotating the primary angles of the plurality of filtered color themes to match the angle of the primary axis of the image. The plurality of filtered color themes are then sorted based on the amount of rotation required, and a subset having the least rotation can be selected as color themes that most aesthetically match the image. Using the text location, the accessibility of the colors from the most aesthetic color themes can be determined, with the most accessible colors being chosen as colors for a color palette recommendation that can be outputted to a computing device.

In some embodiments, determining the accessibility for each color in the plurality of filtered color themes includes computing a luminance of the image at the text location and computing a luminance for each color, individually in the plurality of filtered color themes. The luminance of each color can then be compared with the luminance of the image at the text location to determine a contrast ratio for each color. Colors for the color palette recommendation can then be selected from the colors have contrast ratios above a target contrast ratio.

In some embodiments, an updated text location on the image can be received. For example, via user selection of an updated text selection or an action that causes the movement of text from the text location to an updated text location. The accessibility of the colors from the most aesthetic color themes can then be determined for the updated text location, with a new color palette recommendation based on the contrast ratios between the luminance of colors in the most aesthetic color themes and the luminance of the updated text location.

Additional features and advantages of exemplary embodiments of the present disclosure will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of such exemplary embodiments.

DETAILED DESCRIPTION

One or more embodiments of the present disclosure include a context-aware text color recommendation system that provides color recommendations for text over a background image. When placing text over a background image, it is important to consider how the color of the text will complement the background image. For example, colors at opposite sides of a color wheel are complimentary and can produce a high contrast. For automatic algorithms, however, determining colors for text at a particular text location on an image that are both aesthetically pleasing and accessible can be a particularly challenging task.

To address these issues, the context-aware text color recommendation system performs a two-stage process: an aesthetics stage and an accessibility stage. In the aesthetics stage, the context-aware text color recommendation system focuses on identifying aesthetic color themes compatible with the color distribution from a received image. In the accessibility stage, the context-aware text color recommendation system uses a provided location for text on the received image to identify colors within the aesthetic color themes that have contrast ratios with the location for text on the received image that are above a target contrast ratio (e.g., easy to read).

FIG.1illustrates a diagram of a process of determining a context-aware text color recommendation in accordance with one or more embodiments. As shown inFIG.1, in one or more embodiments, a context-aware text color recommendation system102receives an image100, as shown at numeral 1. For example, the context-aware text color recommendation system102receives the image100from a user via a computing device. In one example, a user may select an image in a document processing application or an image processing application. In another example, a user may submit an image to a web service or an application configured to receive images as inputs. The image100may be any type of digital visual media.

In one or more embodiments, the context-aware text color recommendation system102includes an image analyzer104that receives the image100. In one or more embodiments, the image analyzer104generates an image color analysis112from the received image100, as shown at numeral2. In one or more embodiments, the image analyzer104analyzes the image100and generates the image color analysis112in the form of a 3D histogram. In one or more embodiments, a 3D histogram is a representation of the distribution of colors in the image100. For example, a 3D histogram for a digital image can be a three-dimensional representation of the number of pixels in the image corresponding to a color or range of colors. In one or more alternatives embodiments, instead of generating a 3D histogram, the image analyzer104analyzes the image100and generates the image color analysis112in the form of a color palette. In one or more embodiments, the color palette includes the X most frequently used colors in the image100. In some embodiments, the color palette includes however many colors are above a defined frequency threshold. In one or more embodiments, the context-aware text color recommendation system102determines whether to generate a 3D histogram or a color palette as part of the image color analysis112based on a computing device type, an application type, available computing resources, etc. In one or more embodiments, the image analyzer104then passes the image color analysis112to a template fitter106.

In one or more embodiments, the template fitter106determines a fitted template114for the image100, as shown at numeral3. In one or more embodiments, the template fitter106compares the image color analysis112of the image100against a plurality of harmonic templates. In one embodiment, the template fitter106distinguishes between at least the following harmonic templates: monochromatic, analogous, complementary, single split, triadic, double split and square. In other embodiments, template fitter106distinguishes between a greater or a fewer number of harmonic templates. In one or more embodiments, the template fitter106determines the fitted template114as being the harmonic template that best matches the color distribution in the image color analysis112of the image100.

As shown inFIG.1, the context-aware text color recommendation system102can include a palette identification module108that determines matching palettes116, as shown at numeral4. For example, the palette identification module108receives the fitted template114from template fitter106and determines matching palettes116. To determine matching templates116, the palette identification module108first retrieves a plurality of color themes. Each of the color themes can be a color palette. In one embodiment, each color palette includes five colors. In other embodiments, each color palette can include a greater or fewer number of colors. While in one embodiment, the palette identification module108retrieves1000color themes, in other embodiments, a greater or a fewer number of color themes are retrieved. In one or more embodiment, the palette identification module108then filters the retrieved color themes based on the fitted template114of image100. For example, if the fitted template114of image100is analogous, the palette identification module108filters out any colors themes that are not of the analogous type.

After filtering the color themes based on the fitted template114of image100, the palette identification module108then, if not already matching, rotates the primary axis of the filtered color themes to match the primary axis of the image100, e.g., determined based on fitted template determined using the image color analysis112of the image100. The palette identification module108can then calculate the amount of rotation performed for each filtered color theme, and then sort the filtered color themes in order based on the amount of rotation of the primary axis. In one or more embodiments, where the fitted template114does not contain a wide variation in hues (e.g., when the fitted template114is analogous or monochrome), the palette identification module108can repeat this process by determining color themes based on rotation from the complementary color axis (180 degrees from the primary axis of the image100) and/or the accent color axis (90 degrees from the primary axis of the image100). In such embodiments, the palette identification module108can calculate the amount of rotation for each of the analogous or monochromatic templates based on the amount of rotation from their corresponding axis. The analogous or monochromatic templates can then be sorted with the other matching templates. In one or more embodiments, the palette identification module108selects some or all of the sorted color themes as the matching palettes116and sends the matching palettes116to a color selecting module110.

At numeral5, the context-aware text color recommendation system102receives a text location118for text on the image100. For example, the context-aware text color recommendation system102receives the text location118from a user via a computing device. In one example, a user may select the text location118by selecting a location or portion of the image100in a document processing application or an image processing application. In one or more embodiments, the text location118can be a cursor location on the image100at which the text is to be entered, a bounding box with a selected dimensions that is to contain the text, etc. In one or more embodiments, the color selecting module110receives the text location118.

In one or more embodiments, the color selecting module110generates a palette recommendation130using the received text location128and the matching palettes116, as shown at numeral6. Web Content Accessibility Guidelines (WCAG) relates the readability of text with the contrast ratio between text color and the immediate region of the image100in which a bounding box containing the text is located. The contrast ratio can be defined as:

C⁡(L1,L2)=L1+0.05L2+0.05
where L1is the relative luminance of the lighter of the colors of the text and the image, and L2is the relative luminance of the darker of the colors of the text and the image.

In one or more embodiment, an accessibility analyzer120in the color selecting module110computes the luminance of the background portion that falls inside a bounding box for the text, Lavg. In one or more embodiments, Lavgis the average luminance for the bounding box, calculated by determining the luminance of each individual pixel of the image100within the bounding box. The accessibility analyzer120then computes C(Lavg, Li) for each color in each palette from the sorted color themes in the matching palettes116.

The computed contrast ratio can then be compared to a target contrast ratio. In one or more embodiments, typical target contrast ratio target, based on WCAG, can include A=3, AA=4.5, and AAA=7. For example, a contrast ratio of “3” indicates that one of the colors is three times lighter or darker than the other color. In some embodiments, contrast ratio targets can be any value between 1 and 21. In one or more embodiments, the target contrast ratio target can be a user-specified value.

In one embodiment, if the resulting contrast ratio is above a target threshold, it indicates that the contrast is sufficient to ensure accessibility (e.g., readability of the text at the selected text location). In such occurrences, the color is added to a list of valid colors. If the resulting contrast ratio is below the user specified target threshold, the color is discarded. In one embodiment, to provide more variations in color selection, the accessibility analyzer120retrieves the first M colors, and finds K clusters using K-means clustering, where the value of K is based on the number of color recommendations to be presented to the user. In one or more embodiments, the accessibility analyzer120selects the centroid of each of the K clusters. In some embodiments, the value of K is ten, but in other embodiments, the value of K is can be greater or smaller.

At numeral7, the context-aware text color recommendation system102can return the color palette recommendation130to the user. After the process described above in numerals 1-6, the color palette recommendation contains colors that both aesthetically match the colors of the image100, in addition to having enough contrast with the location on the image to be accessible. In one or more embodiment, the color palette recommendation130is sent to the user or computing device that initiated the process with the context-aware text color recommendation system102.

In one or more alternative embodiments, instead of determining the average luminance of the portion of the image100that falls inside a bounding box for the text, the context-aware text color recommendation system102inserts a solid color plate over the image100at the text location118. For example, if the image100at the text location118includes a large amount of textures, the context-aware text color recommendation system102can suggest one or more colors for a solid color plate for placement on the image100to accommodate text. In one or more embodiments, the context-aware text color recommendation system102determines that the image100at the text location118includes a large amount of textures by measuring the standard deviation of the luminance of the pixels inside the bounding box. If the standard deviation if greater than a threshold, the context-aware text color recommendation system102can automatically insert the solid color plate, or display a notification recommending the user to manually select or create the solid color plate. In another embodiment, the context-aware text color recommendation system102determines the amount of texture by analyzing the pixels inside the bounding box in the frequency domain. In the frequency domain, the existence of high frequencies above a threshold could trigger the automatic addition or recommendation of a solid color plate.

In such embodiments, the context-aware text color recommendation system102can determine one or more plate color recommendations that have an acceptable contrast ratio (e.g., above a first contrast ratio target threshold) with the image100at the text location118. Further, the context-aware text color recommendation system102can then determine colors for the color palette recommendation130that have an acceptable contrast ratio (e.g., above a second contrast ratio target threshold) with the selected color for the solid color plate.

In another embodiment, the context-aware text color recommendation system102first determines the color palette recommendation130, as described above, and then determines one or more plate color recommendations that have an acceptable contrast ratio with either the colors in the color palette recommendation130or a selected color from the color palette recommendation130. This solution can provide plate color recommendations that are compatible both with the image100and the selected color for the text.

In one or more alternative embodiments, instead of retrieving the plurality of color themes from a database or storage manager, the palette identification module108can dynamically generate the plurality of color themes. For example, using the fitted template114that identifies a type of harmonic template most closely matching the color distribution of the image100, the palette identification module108can sample colors along the axes of the fitted template114. In such embodiments, the palette fitting, filtering, alignment, and ordering can be bypassed, as the sampled colors closely match the harmonic template of the fitted template114. For example, after colors are sampled along one of the axes of the fitted template114, the accessibility of the color can be determined (e.g., by determining the color's contrast ratio to the text location118).

FIG.2illustrates a diagram of a process of determining a context-aware text color recommendation in accordance with one or more embodiments. In one or more embodiments, the process of a context-aware text color recommendation system202determining a color palette recommendation can be divided into two stages: an aesthetics stage and an accessibility stage. In such embodiments, the aesthetics stage focuses on identifying aesthetic color themes compatible with the color distribution from a received image, while the accessibility stages focuses on finding colors within those themes that have enough contrast with the local background to be accessible (e.g., easy to read).

In the aesthetics stage, the context-aware text color recommendation system202receives an image200as an input. The context-aware text color recommendation system202determines a fitted template204for the image200. In one embodiment, the fitted template204for the image200can be one of the following harmonic templates: monochromatic, analogous, complementary, single split, triadic, double split and square. After determining the fitted template204for the image200, the context-aware text color recommendation system202accesses a palettes database206to retrieve a plurality of color themes. The context-aware text color recommendation system202filters the plurality of color themes to identify a plurality of fitted templates208, where the plurality of fitted templates408are of the same harmonic template as the fitted template204for the image200. The context-aware text color recommendation system202can then rotate one or more of the plurality of fitted templates208based on the angle of the primary axis of the fitted template204for the image200. In one or more embodiments, the result is a set of aligned color themes210. In one or more embodiments, the context-aware text color recommendation system202can sort the color themes in the set of aligned color themes210based on the amount of rotation required for each color theme to match the angle of the primary axis of the fitted template204for the image200.

In the accessibility stage, the context-aware text color recommendation system202receives a text location212on an image200as an input. In one or more embodiments, the context-aware text color recommendation system202receives a text location212when a user clicks, taps, or otherwise interacts with an underlying application. In one or more embodiments, the context-aware text color recommendation system202computes the average luminance214of the background portion that falls inside a bounding box for the text, Lavg. The context-aware text color recommendation system202can further compute C(Lavg, Li) for each color in each palette from the set of aligned color themes210using a contrast ratio defined as:

C⁡(L1,L2)=L1+0.05L2+0.05
where L1is the relative luminance of the lighter of the colors, and L2is the relative luminance of the darker of the colors.

In one or more embodiments, the color theme in the set of aligned color themes210contain five colors. In one or more embodiments, the context-aware text color recommendation system202compares the calculated contrast ratios for each color in each color theme in the set of aligned color themes210against a target contrast ratio216. In one embodiment, if the resulting contrast ratio is above target contrast ratio216, that color is added to a list of valid colors. If the resulting contrast ratio is below the target contrast ratio216, the color is discarded. As illustrated inFIG.2, the colors in box218have been discarded for not meeting the target contrast ratio216. The colors in box220meet or exceed the target contrast ratio216and can be used as candidate colors for presenting to the user in a color palette.

FIG.3illustrates a diagram of an example image analyzer and template fitter in accordance with one or more embodiments. InFIG.3, a context-aware text color recommendation system302includes an image analyzer304and a template fitter310. In other embodiments, the context-aware text color recommendation system302includes more or fewer modules than illustrated inFIG.3.

As illustrated inFIG.3, when the context-aware text color recommendation system302receives an image300as an input, the image300it is provided to the image analyzer304. In one or more embodiments, the image analyzer304is configured to analyze the image300to generate a representation of the color distribution in the image300. For example, the image analyzer304can generate a 3D histogram (e.g., histogram306) or a color palette (color palette308). In one embodiment, the determination of whether to generate a 3D histogram or a color palette is based on the image analysis performed by the image analyzer304. For example, if a 3D histogram of the image300would include a large number of colors (e.g., above a threshold amount), the image analyzer304may determine that this would result in a slower template fitting and generate a color palette for the image300.

After the image analyzer304completes the image analysis, the output (e.g., either the histogram306or the color palette308) is sent to the template fitter310. In one or more embodiments, the template fitter310determines a fitted template312for the image300. In one or more embodiments, the template fitter310attempts to fit the color distribution of the image300against a plurality of harmonic templates. In one embodiment, the template fitter310distinguishes between the following harmonic templates: monochromatic, analogous, complementary, single split, triadic, double split and square. In other embodiments, template fitter310distinguishes between a greater or a fewer number of harmonic templates. In one or more embodiments, the template fitter310determines the fitted template312as being the harmonic template that best matches the color distribution for the image300. In the example illustrated inFIG.3, the template fitter310determined the fitted template312for the image300to be triadic.

In one or more embodiments, in addition to determining the harmonic template for the image300, the template fitter310also determines a configuration for the fitted template312for the image300, including its primary axis, indicated by label314, and the angle of the primary axis.

FIG.4illustrates a diagram of an example palette identification module in accordance with one or more embodiments. InFIG.4, a palette identification module402includes a palette fitting module406and a palette filtering module410. In other embodiments, the palette identification module402includes more or fewer modules than illustrated inFIG.4.

As illustrated inFIG.4, the palette identification module402retrieves a plurality of color themes404. In one embodiment, the palette identification module402retrieves the plurality of color themes404from a database or storage manager. In one embodiment, the palette identification module402retrieves the plurality of color themes404from a curated database. For example, the plurality of color themes404includes the M color themes having the highest ratings (e.g., based on scores or a user ranking) or being the most frequently used.

As illustrated inFIG.4, each of the plurality of color themes404is a color palette of five colors. In other embodiments, each of the plurality of color themes404can include a greater or a fewer number of colors. In one or more embodiments, the plurality of color themes404are provided as inputs to the palette fitting module406. The palette fitting module406fits each of the plurality of color themes404into one of the plurality of harmonic templates described previously, resulting in the plurality of fitted templates408.

In one or more embodiments, in addition to determining the harmonic template for each of the plurality of color themes404, the palette fitting module406also determines a configuration for each of the fitted templates408, including the angle of its primary axis.

As illustrated inFIG.4, after each of the plurality of color themes404are fitted to one of the plurality of harmonic templates, the information is provided as input to the palette filtering module410. The palette filtering module410can also receive fitted template412having a primary axis413. As illustrated inFIG.4, fitted template412and primary axis413correspond to fitted template312and primary axis314, respectively. In one or more embodiments, the palette filtering module410filters the plurality of color themes404by comparing the plurality of fitted templates408with the fitted template412. Continuing the example ofFIG.3, because the fitted template412is triadic, the palette filtering module410can filter out all of color themes in the plurality of color themes404that are not of the triadic type, resulting in the filtered set of color themes414.

FIG.5illustrates a diagram of an example palette identification module in accordance with one or more embodiments. The palette identification module502includes additional modules in addition to those illustrated inFIG.4. As illustrated inFIG.5, a palette identification module502includes an alignment module506and an ordering module510. In other embodiments, the palette identification module502includes more or fewer modules than illustrated inFIG.5.

As illustrated inFIG.5, each color theme in the filtered set of color themes504includes a primary axis (e.g., labels505A-C). Continuing the example ofFIG.3, the alignment module506adapts the filtered set of color themes504by rotating the palette in hue, chroma, and lightness (HCL) space. For example, the alignment module506aligns the primary axes505A-C of the filtered set of color themes504based on the angle of the primary axis413of the fitted template412of the image300. For example, the alignment module506rotates any of the primary axis505A-C of the filtered set of color themes504that have angle values different from the primary axis413of the fitted template412. In one or more embodiments, the output of the alignment module506is the set of aligned color themes508.

In some embodiments, the rotation performed by the alignment module506the global rotation in HCL can push some colors out of gamut, causing a display or any other reproduction system to show the colors incorrectly. In such situations, the alignment module506projects the colors back into sRGB by clamping their RGB values to the range of [0,1] when converting from HCL to sRGB.

In some embodiments, when the fitted template412of the image300was determined to be fitted to either the monochrome and analogous harmonic template, the alignment module506can generate additional variety in the set of aligned color themes508by aligning the primary axis of some of the filtered set of color themes504by 90 degrees (to identify accent colors) or 180 degrees (to identify complementary colors) with respect to the primary axis for the fitted template412of the image300.

The ordering module510can then receive the set of aligned color themes508. In one or more embodiments, the ordering module510calculates the amount of rotation (e.g., the number of degrees) that was applied to each color theme in the filtered set of color themes504to align the primary axes. In one or more embodiments, the ordering module510calculates sorts the set of aligned color themes508based on the amount of rotation of the primary axis to match the angle of the primary axis413of the image300, resulting in sorted color themes512. In one or more embodiments, for complementary and axis colors, the sorting criteria is based on an amount of rotation from their corresponding axis. In one or more embodiments, the palette identification module108selects some or all of the sorted color themes512to send to a color selecting module110.

FIG.6illustrates example user interfaces showing example outputs of the context-aware text color recommendation system in accordance with one or more embodiments.

As illustrated inFIG.6, a graphical user interface (GUI)600includes an image602displayed in an application (e.g., an image processing application). GUI600depicts the results provided by a context-aware text color recommendation system102in response to receiving the image602and receiving a text location604, as described herein. For example, the context-aware text color recommendation system102determines the accessibility for each color in a plurality of filtered color themes, determined to aesthetically match the image, based on the text location on the image. The resulting output is displayed in the GUI600as color palette606. In one or more embodiments, color palette606includes a plurality of recommended colors that the context-aware text color recommendation system102determined would display text in the text location604that both aesthetically match the colors in the in the text location604and have accessibility (e.g., be easy to read).

Similarly, GUI600depicts the results provided by the context-aware text color recommendation system102in response to a user selection of an updated text location654. For example, in response to a user selecting the updated text location654or moving the text from text location604to updated text location654, the context-aware text color recommendation system102generated an updated color palette656. For example, the context-aware text color recommendation system102determines the accessibility for each color in the same plurality of filtered color themes based on the updated text location on the image. In one or more embodiments, updated color palette656includes a plurality of recommended colors that the context-aware text color recommendation system102determined would display text in the updated color palette656that both aesthetically match the colors in the image and have accessibility give the updated text location654. In one or more embodiments, when the text is moved (e.g., from text location604to text location654), the context-aware text color recommendation system102automatically updates the text color for the text at text location654to one of the colors in updated color palette656.

FIG.7illustrates a schematic diagram of a context-aware text color recommendation system (e.g., “context-aware text color recommendation system” described above) in accordance with one or more embodiments. As shown, the context-aware text color recommendation system700may include, but is not limited to, an image analyzer702, a template fitter704, a palette identification module706, and a color selecting module708. As shown, the palette identification module706includes a palette fitting module712a palette filtering module714, and alignment module716, and an ordering module718. As shown, the color selecting module708includes an accessibility analyzer720. The storage manager710includes templates data722and palettes data724.

As illustrated inFIG.7, the context-aware text color recommendation system700includes an image analyzer702. The image analyzer702can receive or retrieve an image from a computing device. The image analyzer702can process the image to generate an image color analysis. In one or more embodiments, the image color analysis is a 3D histogram or a color palette representing the distribution of colors in the received image.

As further illustrated inFIG.7, the context-aware text color recommendation system700also includes a template fitter704. The template fitter704can receive or retrieve the image color analysis for the received image (e.g., from the image analyzer702). In one or more embodiments, the template fitter704determines a fitted template for the image. In one or more embodiments, the template fitter704attempts to fit the color distribution of the image to the closest harmonic template of a plurality of harmonic templates. In one embodiment, the template fitter704compares or analyzes the color distribution of the image against the following harmonic templates: monochromatic, analogous, complementary, single split, triadic, double split and square. In other embodiments, template fitter704distinguishes between a greater or a fewer number of harmonic templates.

As further illustrated inFIG.7, the context-aware text color recommendation system700also includes a palette identification module706. The palette identification module706can include a palette fitting module712a palette filtering module714, and alignment module716, and an ordering module718. The palette fitting module712can receive or access a plurality of color themes from palettes data (e.g., from storage manager710). The palette fitting module712can then fit each of the plurality of color themes into one of the plurality of harmonic templates described previously, resulting in the plurality of fitted templates. The palette filtering module714can then filter the plurality of fitted templates by comparing the plurality of fitted templates with the fitted template for the received image to generate a filtered set of color themes.

The filtered set of color themes can then be passed through the alignment module716to align the primary axis of each color theme in the filtered set of color themes to the primary axis of the fitted template for the received image, generating a set of aligned color themes. The ordering module718can then order the set of aligned color themes based on the amount of rotation that was needed to align the color theme with the fitted template for the image. The palette identification module706can select some or all of the sorted (or ordered) color themes

As further illustrated inFIG.7, the context-aware text color recommendation system700also includes a color selecting module708. The color selecting module708can include an accessibility analyzer720. In one or more embodiments, the color selecting module708receive a text location (e.g., from a user computing device) that indicates a location on the received image that the user has selected for the placement of text over the image. In one or more embodiments, the color selecting module110generates a color palette recommendation for text at the text location, based on the received text location128and a plurality of color themes in the sorted color themes, as described above.

As illustrated inFIG.7, the context-aware text color recommendation system700also includes the storage manager710. The storage manager710maintains data for the context-aware text color recommendation system700. The storage manager710can maintain data of any type, size, or kind as necessary to perform the functions of the context-aware text color recommendation system700. The storage manager710, as shown inFIG.7, includes the templates data722. The templates data722can include data for each of a plurality of harmonic templates (e.g., monochromatic, analogous, complementary, single split, triadic, double split and square) that the template fitter704can use to determine a fitted template for a received image, as discussed in additional detail above.

As further illustrated inFIG.7, the storage manager710also includes palettes data724. For example, the palettes data724can include a plurality of color themes that can be used by the palette identification module to identify one or more color themes that aesthetically match a received image.

Each of the components702-710of the context-aware text color recommendation system700and their corresponding elements (as shown inFIG.7) may be in communication with one another using any suitable communication technologies. It will be recognized that although components702-710and their corresponding elements are shown to be separate inFIG.7, any of components702-710and their corresponding elements may be combined into fewer components, such as into a single facility or module, divided into more components, or configured into different components as may serve a particular embodiment.

The components702-710and their corresponding elements can comprise software, hardware, or both. For example, the components702-710and their corresponding elements can comprise one or more instructions stored on a computer-readable storage medium and executable by processors of one or more computing devices. When executed by the one or more processors, the computer-executable instructions of the context-aware text color recommendation system700can cause a client device and/or a server device to perform the methods described herein. Alternatively, the components702-710and their corresponding elements can comprise hardware, such as a special purpose processing device to perform a certain function or group of functions. Additionally, the components702-710and their corresponding elements can comprise a combination of computer-executable instructions and hardware.

Furthermore, the components702-710of the context-aware text color recommendation system700may, for example, be implemented as one or more stand-alone applications, as one or more modules of an application, as one or more plug-ins, as one or more library functions or functions that may be called by other applications, and/or as a cloud-computing model. Thus, the components702-710of the context-aware text color recommendation system700may be implemented as a stand-alone application, such as a desktop or mobile application. Furthermore, the components702-710of the context-aware text color recommendation system700may be implemented as one or more web-based applications hosted on a remote server. Alternatively, or additionally, the components of the context-aware text color recommendation system700may be implemented in a suit of mobile device applications or “apps.” To illustrate, the components of the context-aware text color recommendation system700may be implemented in a document processing application or an image processing application, including but not limited to ADOBE® Acrobat, ADOBE® Photoshop, and ADOBE® Illustrator. “ADOBE®” is either a registered trademark or trademark of Adobe Inc. in the United States and/or other countries.

FIGS.1-7, the corresponding text, and the examples, provide a number of different systems and devices that allows a context-aware text color recommendation system to determine a recommended color palette based on a received image and a text location on the image. In addition to the foregoing, embodiments can also be described in terms of flowcharts comprising acts and steps in a method for accomplishing a particular result. For example,FIG.8illustrates a flowchart of an exemplary method in accordance with one or more embodiments. The method described in relation toFIG.8may be performed with less or more steps/acts or the steps/acts may be performed in differing orders. Additionally, the steps/acts described herein may be repeated or performed in parallel with one another or in parallel with different instances of the same or similar steps/acts.

FIG.8illustrates a flowchart800of a series of acts in a method of determining a context-aware text color recommendation in accordance with one or more embodiments. In one or more embodiments, the method800is performed in a digital medium environment that includes the context-aware text color recommendation system700. The method800is intended to be illustrative of one or more methods in accordance with the present disclosure and is not intended to limit potential embodiments. Alternative embodiments can include additional, fewer, or different steps than those articulated inFIG.8.

As shown inFIG.8, the method800includes an act802of obtaining an image and a text location on the image. For example, the context-aware text color recommendation system can receive the image from a user (e.g., via a computing device). A user may select an image in a document processing application or an image processing application, or the user may submit an image to a web service or an application configured to receive images as inputs. In one or more embodiments, the context-aware text color recommendation system can receive the image and the text location prior to performing additional steps in the method800. In other embodiments, the context-aware text color recommendation system receives the text location subsequent to receiving the image and performing additional steps in the method800.

As shown inFIG.8, the method800also includes an act804of identifying at least one color theme based on a color harmonic template associated with the image. In one or more embodiments, identifying the at least one color theme based on the color harmonic template associated with the image includes filtering a plurality of color themes to identify a plurality of filtered color themes based on the color harmonic template associated with the image. In one or more embodiments, the context-aware text color recommendation system filters the plurality of color themes based on an image color analysis of the image. For example, using a representation of the distribution of colors in the image, the context-aware text color recommendation system determines a harmonic template that most closely matches the distribution of colors in the image. After determining the appropriate harmonic template, the context-aware text color recommendation system determines a plurality of color themes (e.g., color palettes) that are of the same harmonic template as the image.

As shown inFIG.8, the method800also includes an act806of modifying the at least one color theme based on characteristics of the image. In one or more embodiments, modifying the at least one color theme based on characteristics of the image includes determining an angle of a primary axis of the image based on the color harmonic template associated with the image (e.g., determined from the image color analysis). In such embodiments, the context-aware text color recommendation system then rotates the primary axis of the at least one color theme to match the angle of the primary axis of the image.

As shown inFIG.8, the method800also includes an act808of determining accessibility for at least one color in the at least one color theme based on the text location on the image. In one or more embodiments, the context-aware text color recommendation system computes a luminance of the image at the text location. Further, the context-aware text color recommendation system can compute a luminance for the at least one color in the at least one color theme. The luminance computed for the at least one color can then be compared to the luminance of the image at the text location to compute a contrast ratio for the at least one color.

As shown inFIG.8, the method800also includes an act810of determining a color palette recommendation for text at the text location on the image based on the determined accessibility for the at least color in the at least one color theme. For example, the context-aware text color recommendation system selects one or more colors having contrast ratios above a target contrast ratio. In one or more embodiments, the context-aware text color recommendation system selects a subset of the colors determined to be accessible. For example, the X colors with the highest contrast ratios above the target contrast ratio can be selected for the color palette recommendation. The color palette recommendation can then be provided to the requesting computing device. For example, the color palette recommendation can be presented on a user interface on the requesting computing device.

FIG.9illustrates a schematic diagram of an exemplary environment900in which the context-aware text color recommendation system700can operate in accordance with one or more embodiments. In one or more embodiments, the environment900includes a service provider902which may include one or more servers904connected to a plurality of client devices906A-906N via one or more networks908. The client devices906A-906N, the one or more networks908, the service provider902, and the one or more servers904may communicate with each other or other components using any communication platforms and technologies suitable for transporting data and/or communication signals, including any known communication technologies, devices, media, and protocols supportive of remote data communications, examples of which will be described in more detail below with respect toFIG.10.

AlthoughFIG.9illustrates a particular arrangement of the client devices906A-906N, the one or more networks908, the service provider902, and the one or more servers904, various additional arrangements are possible. For example, the client devices906A-906N may directly communicate with the one or more servers904, bypassing the network908. Or alternatively, the client devices906A-906N may directly communicate with each other. The service provider902may be a public cloud service provider which owns and operates their own infrastructure in one or more data centers and provides this infrastructure to customers and end users on demand to host applications on the one or more servers904. The servers may include one or more hardware servers (e.g., hosts), each with its own computing resources (e.g., processors, memory, disk space, networking bandwidth, etc.) which may be securely divided between multiple customers, each of which may host their own applications on the one or more servers904. In some embodiments, the service provider may be a private cloud provider which maintains cloud infrastructure for a single organization. The one or more servers904may similarly include one or more hardware servers, each with its own computing resources, which are divided among applications hosted by the one or more servers for use by members of the organization or their customers.

Similarly, although the environment900ofFIG.9is depicted as having various components, the environment900may have additional or alternative components. For example, the environment900can be implemented on a single computing device with the context-aware text color recommendation system700. In particular, the context-aware text color recommendation system700may be implemented in whole or in part on the client device902A.

As illustrated inFIG.9, the environment900may include client devices906A-906N. The client devices906A-906N may comprise any computing device. For example, client devices906A-906N may comprise one or more personal computers, laptop computers, mobile devices, mobile phones, tablets, special purpose computers, TVs, or other computing devices, including computing devices described below with regard toFIG.10. Although three client devices are shown inFIG.9, it will be appreciated that client devices906A-906N may comprise any number of client devices (greater or smaller than shown).

Moreover, as illustrated inFIG.9, the client devices906A-906N and the one or more servers904may communicate via one or more networks908. The one or more networks908may represent a single network or a collection of networks (such as the Internet, a corporate intranet, a virtual private network (VPN), a local area network (LAN), a wireless local network (WLAN), a cellular network, a wide area network (WAN), a metropolitan area network (MAN), or a combination of two or more such networks. Thus, the one or more networks908may be any suitable network over which the client devices906A-906N may access service provider902and server904, or vice versa. The one or more networks908will be discussed in more detail below with regard toFIG.10.

In addition, the environment900may also include one or more servers904. The one or more servers904may generate, store, receive, and transmit any type of data, including templates data722, palettes data724, or other information. For example, a server904may receive data from a client device, such as the client device906A, and send the data to another client device, such as the client device902B and/or902N. The server904can also transmit electronic messages between one or more users of the environment900. In one example embodiment, the server904is a data server. The server904can also comprise a communication server or a web-hosting server. Additional details regarding the server904will be discussed below with respect toFIG.10.

As mentioned, in one or more embodiments, the one or more servers904can include or implement at least a portion of the context-aware text color recommendation system700. In particular, the context-aware text color recommendation system700can comprise an application running on the one or more servers904or a portion of the context-aware text color recommendation system700can be downloaded from the one or more servers904. For example, the context-aware text color recommendation system700can include a web hosting application that allows the client devices906A-906N to interact with content hosted at the one or more servers904. To illustrate, in one or more embodiments of the environment900, one or more client devices906A-906N can access a webpage supported by the one or more servers904. In particular, the client device906A can run a web application (e.g., a web browser) to allow a user to access, view, and/or interact with a webpage or website hosted at the one or more servers904.

Upon the client device906A accessing a webpage or other web application hosted at the one or more servers904, in one or more embodiments, the one or more servers904can provide a user of the client device906A with an interface to provide an image file or a document including an image, or an interface to select a portion of a document including an image. In one or more embodiments, the one or more servers904can further provide a user of the client device906A with an interface to provide a text location on the image. Upon receiving the image and the text location, the one or more servers904can automatically perform the methods and processes described above to determine a recommended color palette for text at the text location on the image. The one or more servers904can provide an output including the recommended color palette to the client device906A for display to the user.

As just described, the context-aware text color recommendation system700may be implemented in whole, or in part, by the individual elements902-908of the environment900. It will be appreciated that although certain components of the context-aware text color recommendation system700are described in the previous examples with regard to particular elements of the environment900, various alternative implementations are possible. For instance, in one or more embodiments, the context-aware text color recommendation system700is implemented on any of the client devices906A-N. Similarly, in one or more embodiments, the context-aware text color recommendation system700may be implemented on the one or more servers904. Moreover, different components and functions of the context-aware text color recommendation system700may be implemented separately among client devices906A-906N, the one or more servers904, and the network908.

FIG.10illustrates, in block diagram form, an exemplary computing device1000that may be configured to perform one or more of the processes described above. One will appreciate that one or more computing devices such as the computing device1000may implement the image processing system. As shown byFIG.10, the computing device can comprise a processor1002, memory1004, one or more communication interfaces1006, a storage device1008, and one or more I/O devices/interfaces1010. In certain embodiments, the computing device1000can include fewer or more components than those shown inFIG.10. Components of computing device1000shown inFIG.10will now be described in additional detail.

In particular embodiments, processor(s)1002includes hardware for executing instructions, such as those making up a computer program. As an example, and not by way of limitation, to execute instructions, processor(s)1002may retrieve (or fetch) the instructions from an internal register, an internal cache, memory1004, or a storage device1008and decode and execute them. In various embodiments, the processor(s)1002may include one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), systems on chip (SoC), or other processor(s) or combinations of processors.

The computing device1000includes memory1004, which is coupled to the processor(s)1002. The memory1004may be used for storing data, metadata, and programs for execution by the processor(s). The memory1004may include one or more of volatile and non-volatile memories, such as Random Access Memory (“RAM”), Read Only Memory (“ROM”), a solid state disk (“SSD”), Flash, Phase Change Memory (“PCM”), or other types of data storage. The memory1004may be internal or distributed memory.

The computing device1000can further include one or more communication interfaces1006. A communication interface1006can include hardware, software, or both. The communication interface1006can provide one or more interfaces for communication (such as, for example, packet-based communication) between the computing device and one or more other computing devices1000or one or more networks. As an example and not by way of limitation, communication interface1006may include a network interface controller (NIC) or network adapter for communicating with an Ethernet or other wire-based network or a wireless NIC (WNIC) or wireless adapter for communicating with a wireless network, such as a WI-FI. The computing device1000can further include a bus1012. The bus1012can comprise hardware, software, or both that couples components of computing device1000to each other.

The computing device1000includes a storage device1008includes storage for storing data or instructions. As an example, and not by way of limitation, storage device1008can comprise a non-transitory storage medium described above. The storage device1008may include a hard disk drive (HDD), flash memory, a Universal Serial Bus (USB) drive or a combination these or other storage devices. The computing device1000also includes one or more input or output (“I/O”) devices/interfaces1010, which are provided to allow a user to provide input to (such as user strokes), receive output from, and otherwise transfer data to and from the computing device1000. These I/O devices/interfaces1010may include a mouse, keypad or a keyboard, a touch screen, camera, optical scanner, network interface, modem, other known I/O devices or a combination of such I/O devices/interfaces1010. The touch screen may be activated with a stylus or a finger.

In the foregoing specification, embodiments have been described with reference to specific exemplary embodiments thereof. Various embodiments are described with reference to details discussed herein, and the accompanying drawings illustrate the various embodiments. The description above and drawings are illustrative of one or more embodiments and are not to be construed as limiting. Numerous specific details are described to provide a thorough understanding of various embodiments.