# US 10,769,827 B1 · Determining whether to overlay text included in a content item on an image included in the content item for presentation to a user of an online system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,769,827 B1
- Document ID: US10769827B1
- Status: Granted
- Kind: B1
- Application number: 15/963,035
- Filed: 2018-04-25
- Granted: 2020-09-08
- Earliest claimed: 2018-04-25
- Assignees: Facebook, Inc.
- Applicants: Facebook, Inc.
- Inventors: Brian Amerige; Thomas Reese; Christopher Joseph Welch
- Web page: https://patentgrep.com/patent/US10769827B1

## CPC

- G06Q 10/40: Business processes related to social networking or social networking services
- G06F 40/106: Display of layout of documents; Previewing
- G06T 11/60: Creating or editing images; Combining images with text
- G06V 10/56: relating to colour
- G06V 20/20: in augmented reality scenes
- G06V 30/153: {using recognition of characters or words}
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

An online system presents a user with a content item including an image and text. The online system overlays the text on the image if it predicts doing so will not render the text unreadable. To predict whether the overlay will render the text unreadable, the online system computes values describing various visual characteristics of a segment of the image on which the text may be overlaid and compares the values to corresponding threshold values. Based on the comparison, the online system predicts a readability of the text if overlaid on the segment. If the predicted readability is at least a threshold readability, the online system overlays the text on the segment of the image and presents the content item to the user with the text overlaid on the image. Otherwise, the online system presents the content item to the user with the text not overlaid on the image.

## Claims

### Claim 1

A method comprising:
identifying an opportunity to present content to a user of an online system;
selecting a content item for presentation to the user, the content item comprising an image and text associated with the image;
identifying a segment of the image on which the text may be overlaid, the segment comprising a plurality of pixels forming a portion of the image;
computing a brightness value describing a magnitude of brightness of at least a threshold number of pixels of the plurality of pixels comprising the segment;
determining that the brightness value associated with the segment is greater than a lower threshold value and less than a high threshold value;
determining that a readability of the text if overlaid on the segment is below a threshold readability;
responsive to determining that the readability of the text is below the threshold readability:
applying an opacity gradient to the segment, the opacity gradient modifying an opacity of a set of pixels of the plurality of pixels comprising the segment,
selecting one or more characteristics of a font for the text based at least in part on the brightness value,
generating a user interface comprising the content item, wherein the text associated with the image is overlaid on the segment in the font having the one or more characteristics, and
presenting the user interface to the user.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
computing a color value that describes a distribution of color among an additional threshold number of pixels of the plurality of pixels comprising the segment.

### Claim 3 (depends on 2)

The method of claim 2, wherein computing the color value comprises:
detecting a plurality of colors comprising the segment;
quantizing the plurality of colors to generate a quantized set of colors; and
computing the color value based at least in part on the quantized set of colors.

### Claim 4 (depends on 2)

The method of claim 2, wherein computing the color value comprises:
detecting one or more colors comprising a set of adjacent pixels of the plurality of pixels comprising the segment; and
computing the color value based at least in part on a number of the one or more colors comprising the set of adjacent pixels.

### Claim 5 (depends on 1)

The method of claim 1, wherein a characteristic of the one or more characteristics of the font for the text is a magnitude of brightness of the font.

### Claim 6 (depends on 1)

The method of claim 1, wherein a characteristic of the one or more characteristics of the font for the text is a color of the font.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
determining opacity values of the opacity gradient based on the brightness value.

### Claim 8 (depends on 7)

The method of claim 7, wherein the opacity values of the opacity gradient are a function of the brightness value in which the opacity values increase with an increasing brightness value and decrease with a decreasing brightness value.

### Claim 9

A computer program product comprising a non-transitory computer readable storage medium having instructions encoded thereon that, when executed by a processor, cause the processor to:
identify an opportunity to present content to a user of an online system;
select a content item for presentation to the user, the content item comprising an image and text associated with the image;
identify a segment of the image on which the text may be overlaid, the segment comprising a plurality of pixels forming a portion of the image;
compute a brightness value describing a magnitude of brightness of at least a threshold number of pixels of the plurality of pixels comprising the segment;
determine that the brightness value associated with the segment is greater than a lower threshold value and less than a high threshold value;
determine that a readability of the text if overlaid on the segment is below a threshold readability;
responsive to determining that the readability of the text is below the threshold readability:
apply an opacity gradient to the segment, the opacity gradient modifying an opacity of a set of pixels of the plurality of pixels comprising the segment,
select one or more characteristics of a font for the text based at least in part on the brightness value,
generate a user interface comprising the content item, wherein the text associated with the image is overlaid on the segment in the font having the one or more characteristics, and
present the user interface to the user.

### Claim 10 (depends on 9)

The computer program product of claim 9, wherein the computer readable storage medium further has instructions encoded thereon that, when executed by a processor, cause the processor to:
compute a color value that describes a distribution of color among an additional threshold number of pixels of the plurality of pixels comprising the segment.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the instructions that cause the processor to compute the color value comprise instructions that cause the processor to:
detect a plurality of colors comprising the segment;
quantize the plurality of colors to generate a quantized set of colors; and
compute the color value based at least in part on the quantized set of colors.

### Claim 12 (depends on 10)

The computer program product of claim 10, wherein the instructions that cause the processor to compute the color value comprise instructions that cause the processor to:
detect one or more colors comprising a set of adjacent pixels of the plurality of pixels comprising the segment; and
compute the color value based at least in part on a number of the one or more colors comprising the set of adjacent pixels.

### Claim 13 (depends on 9)

The computer program product of claim 9, wherein a characteristic of the one or more characteristics of the font for the text is a magnitude of brightness of the font.

### Claim 14 (depends on 9)

The computer program product of claim 9, wherein a characteristic of the one or more characteristics of the font for the text is a color of the font.

### Claim 15 (depends on 9)

The computer program product of claim 9, wherein the computer readable storage medium further has instructions encoded thereon that, when executed by a processor, cause the processor to:
determine opacity values of the opacity gradient based on the brightness value.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the opacity values of the opacity gradient are a function of the brightness value in which the opacity values increase with an increasing brightness value and decrease with a decreasing brightness value.
